Skip to content
This repository was archived by the owner on Aug 30, 2024. It is now read-only.

Commit 1d3e64b

Browse files
author
wenfeng song
committed
RC
1 parent 24bdf13 commit 1d3e64b

37 files changed

+26145
-6538
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,5 @@ npm-debug.log
55
yarn-debug.log
66
yarn-error.log
77
dist
8+
.gitconfig
9+
.idea

README.md

+79-115
Large diffs are not rendered by default.

documentation/hooks/useCamera.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ The useCamera hook gathers functions responsible for managing cameras.
66

77
| Name | Type | Description |
88
| ----------------------- | ----------------------- | ------------------------------------------- |
9-
| `getCameras` | () => Promise<Camera[]> | Gets the list of the available cameras. |
10-
| `selectCamera` | (Camera) => void) | Selects a camera. |
11-
| `getDefaultLocalCamera` | () => Promise<Camera>) | Gets data of default camera. |
12-
| `hasCameraPermission` | () => Promise<boolean>) | Check status of browser camera permissions. |
9+
| `getCameras` | () => Promise<MediaDeviceInfo[]> | Gets the list of the available cameras. |
10+
| `selectCamera` | (string) => Promise<string> | Selects a camera. |
11+
| `getDefaultLocalCamera` | () => Promise<MediaDeviceInfo> | Gets data of default camera. |
12+
| `getCameraPermission` | () => Promise<boolean> | Check status of browser camera permissions. |
1313

1414
## Examples
1515

@@ -46,13 +46,13 @@ useEffect(() => {
4646
### Check camera permission
4747

4848
```javascript
49-
const { hasCameraPermission } = useCamera();
49+
const { getCameraPermission } = useCamera();
5050
const [isCameraPermission, setIsCameraPermission] = useState(false);
5151

5252
useEffect(() => {
5353
(async () => {
5454
try {
55-
const hasAccess = await hasCameraPermission();
55+
const hasAccess = await getCameraPermission();
5656
setIsCameraPermission(hasAccess);
5757
} catch {
5858
setIsCameraPermission(false);

documentation/hooks/useConference.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ The useConference hook gathers functions responsible for managing conferences.
77
| Name | Type | Description |
88
| ------------------ | --------------------------- | ------------------------------------- |
99
| `conference` | Conference | The object of the current conference. |
10-
| `joinConference` | (Conference) => void | Joins a conference. |
11-
| `createConference` | (ConferenceOptions) => void | Creates a conference. |
12-
| `leaveConference` | () => void) | Leaves a conference. |
10+
| `createConference` | (ConferenceOptions) => Promise<Conference> | Creates a conference. |
11+
| `joinConference` | (Conference, JoinOptions) => Promise<Conference> | Joins a conference. |
12+
| `leaveConference` | () => Promise<void> | Leaves a conference.
1313

1414
## Examples
1515

documentation/hooks/useMicrophone.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ The useMicrophone hook gathers functions responsible for managing microphones.
88
| ------------------------- | ----------------------- | ----------------------------------------------- |
99
| `getMicrophones` | () => Promise<Mic[]> | Gets a list of the available microphones. |
1010
| `selectMicrophone` | (Mic) => void) | Selects a microphone. |
11-
| `hasMicrophonePermission` | () => Promise<boolean>) | Check status of browser microphone permissions. |
11+
| `getMicrophonePermission` | () => Promise<boolean>) | Check status of browser microphone permissions. |
1212

1313
## Examples
1414

@@ -38,13 +38,13 @@ const { toggleAudio } = useMicrophone();
3838
### Check microphone permission
3939

4040
```javascript
41-
const { hasMicrophonePermission } = useMicrophone();
41+
const { getMicrophonePermission } = useMicrophone();
4242
const [isMicrophonePermission, setIsMicrophonePermission] = useState(false);
4343

4444
useEffect(() => {
4545
(async () => {
4646
try {
47-
const hasAccess = await hasMicrophonePermission();
47+
const hasAccess = await getMicrophonePermission();
4848
setIsMicrophonePermission(hasAccess);
4949
} catch {
5050
setIsMicrophonePermission(false);

documentation/hooks/useParticipants.md

+2-4
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,9 @@ participants.map((p) => {
3232

3333
```javascript
3434
const { participantsStatus } = useParticipants();
35-
const { isSpeaking } = participantsStatus[participant.id] || {};
35+
const { isSpeaking } = participantsStatus[participant.id] || {};
3636

37-
let content;
38-
39-
if(isSpeaking) {
37+
if (isSpeaking) {
4038
return <SpeakingIndicator>
4139
}
4240

documentation/hooks/useSession.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ The useSession hook gathers functions responsible for managing sessions.
88
| -------------- | -------- | ------------------------------------------------- |
99
| `openSession` | () => {} | Opens a new Dolby.io session. |
1010
| `closeSession` | () => {} | Closes the current Dolby.io session. |
11-
| `user` | User | The object of the local participant in a session. |
11+
| `participant` | Participant | The object of the local participant in a session. |
1212

1313
## Examples
1414

@@ -36,10 +36,10 @@ const close = async () => {
3636
<button onClick={close}>...</button>;
3737
```
3838

39-
### Get local user data
39+
### Get local participant data
4040

4141
```javascript
42-
const { user } = useSession();
42+
const { participant } = useSession();
4343

44-
<p>{user.info.name}</p>;
44+
<p>{participant.info.name}</p>;
4545
```

documentation/hooks/useSpeaker.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ The useSpeaker hook gathers functions responsible for managing speakers.
66

77
| Name | Type | Description |
88
| --------------- | ------------------------ | ---------------------------------------- |
9-
| `getSpeakers` | () => Promise<Speaker[]> | Gets the list of the available speakers. |
10-
| `selectSpeaker` | (Speaker) => void) | Selects a speaker. |
9+
| `getSpeakers` | () => Promise<MediaDeviceInfo[]> | Gets the list of the available speakers. |
10+
| `selectSpeaker` | (string) => Promise<string> | Selects a speaker. |
1111

1212
## Examples
1313

@@ -18,10 +18,10 @@ The useSpeaker hook gathers functions responsible for managing speakers.
1818
```javascript
1919
const { getSpeakers, selectSpeaker } = useSpeaker();
2020
const speakers = getSpeakers();
21-
...
21+
2222
return (
2323
speakers.map((s) => (
24-
<div onClick={() => selectSpeaker(s)}>...</div>
24+
<div onClick={() => selectSpeaker(s)}>...</div>
2525
))
2626
)
2727
```

documentation/hooks/useVideo.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ The useVideo hook gathers functions responsible for managing state of video tran
77
| Name | Type | Description |
88
| ----------------------- | ----------------------- | ------------------------------------------- |
99
| `isVideo` | boolean | Indicates video state of local user. |
10-
| `toggleVideo` | () => void) | Toggles video of local user. |
10+
| `toggleVideo` | () => void | Toggles video of local user. |
1111

1212
## Examples
1313

0 commit comments

Comments
 (0)