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

Commit

Permalink
RC
Browse files Browse the repository at this point in the history
  • Loading branch information
wenfeng song committed Jun 27, 2022
1 parent 24bdf13 commit 1d3e64b
Show file tree
Hide file tree
Showing 37 changed files with 26,145 additions and 6,538 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@ npm-debug.log
yarn-debug.log
yarn-error.log
dist
.gitconfig
.idea
194 changes: 79 additions & 115 deletions README.md

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions documentation/hooks/useCamera.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ The useCamera hook gathers functions responsible for managing cameras.

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

## Examples

Expand Down Expand Up @@ -46,13 +46,13 @@ useEffect(() => {
### Check camera permission

```javascript
const { hasCameraPermission } = useCamera();
const { getCameraPermission } = useCamera();
const [isCameraPermission, setIsCameraPermission] = useState(false);

useEffect(() => {
(async () => {
try {
const hasAccess = await hasCameraPermission();
const hasAccess = await getCameraPermission();
setIsCameraPermission(hasAccess);
} catch {
setIsCameraPermission(false);
Expand Down
6 changes: 3 additions & 3 deletions documentation/hooks/useConference.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ The useConference hook gathers functions responsible for managing conferences.
| Name | Type | Description |
| ------------------ | --------------------------- | ------------------------------------- |
| `conference` | Conference | The object of the current conference. |
| `joinConference` | (Conference) => void | Joins a conference. |
| `createConference` | (ConferenceOptions) => void | Creates a conference. |
| `leaveConference` | () => void) | Leaves a conference. |
| `createConference` | (ConferenceOptions) => Promise<Conference> | Creates a conference. |
| `joinConference` | (Conference, JoinOptions) => Promise<Conference> | Joins a conference. |
| `leaveConference` | () => Promise<void> | Leaves a conference.

## Examples

Expand Down
6 changes: 3 additions & 3 deletions documentation/hooks/useMicrophone.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ The useMicrophone hook gathers functions responsible for managing microphones.
| ------------------------- | ----------------------- | ----------------------------------------------- |
| `getMicrophones` | () => Promise<Mic[]> | Gets a list of the available microphones. |
| `selectMicrophone` | (Mic) => void) | Selects a microphone. |
| `hasMicrophonePermission` | () => Promise<boolean>) | Check status of browser microphone permissions. |
| `getMicrophonePermission` | () => Promise<boolean>) | Check status of browser microphone permissions. |

## Examples

Expand Down Expand Up @@ -38,13 +38,13 @@ const { toggleAudio } = useMicrophone();
### Check microphone permission

```javascript
const { hasMicrophonePermission } = useMicrophone();
const { getMicrophonePermission } = useMicrophone();
const [isMicrophonePermission, setIsMicrophonePermission] = useState(false);

useEffect(() => {
(async () => {
try {
const hasAccess = await hasMicrophonePermission();
const hasAccess = await getMicrophonePermission();
setIsMicrophonePermission(hasAccess);
} catch {
setIsMicrophonePermission(false);
Expand Down
6 changes: 2 additions & 4 deletions documentation/hooks/useParticipants.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,9 @@ participants.map((p) => {

```javascript
const { participantsStatus } = useParticipants();
const { isSpeaking } = participantsStatus[participant.id] || {};
const { isSpeaking } = participantsStatus[participant.id] || {};

let content;

if(isSpeaking) {
if (isSpeaking) {
return <SpeakingIndicator>
}

Expand Down
8 changes: 4 additions & 4 deletions documentation/hooks/useSession.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ The useSession hook gathers functions responsible for managing sessions.
| -------------- | -------- | ------------------------------------------------- |
| `openSession` | () => {} | Opens a new Dolby.io session. |
| `closeSession` | () => {} | Closes the current Dolby.io session. |
| `user` | User | The object of the local participant in a session. |
| `participant` | Participant | The object of the local participant in a session. |

## Examples

Expand Down Expand Up @@ -36,10 +36,10 @@ const close = async () => {
<button onClick={close}>...</button>;
```

### Get local user data
### Get local participant data

```javascript
const { user } = useSession();
const { participant } = useSession();

<p>{user.info.name}</p>;
<p>{participant.info.name}</p>;
```
8 changes: 4 additions & 4 deletions documentation/hooks/useSpeaker.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ The useSpeaker hook gathers functions responsible for managing speakers.

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

## Examples

Expand All @@ -18,10 +18,10 @@ The useSpeaker hook gathers functions responsible for managing speakers.
```javascript
const { getSpeakers, selectSpeaker } = useSpeaker();
const speakers = getSpeakers();
...

return (
speakers.map((s) => (
<div onClick={() => selectSpeaker(s)}>...</div>
<div onClick={() => selectSpeaker(s)}>...</div>
))
)
```
2 changes: 1 addition & 1 deletion documentation/hooks/useVideo.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ The useVideo hook gathers functions responsible for managing state of video tran
| Name | Type | Description |
| ----------------------- | ----------------------- | ------------------------------------------- |
| `isVideo` | boolean | Indicates video state of local user. |
| `toggleVideo` | () => void) | Toggles video of local user. |
| `toggleVideo` | () => void | Toggles video of local user. |

## Examples

Expand Down
Loading

0 comments on commit 1d3e64b

Please sign in to comment.