The useConference hook gathers functions responsible for managing conferences.
import { useConference } from '@dolbyio/comms-uikit-react';
Name | Type | Description |
---|---|---|
conference |
Conference | The object of the current conference. |
createConference |
(ConferenceOption) => Promise<Conference> | Creates a conference. |
fetchConference |
(id) => Promise<Conference> | Fetches a conference. |
joinConference |
(Conference, JoinOptions) => Promise<Conference> | Joins a conference. |
leaveConference |
() => Promise<void> | Leaves a conference. |
maxVideoForwarding |
number | Retrieves maximum video forwarding for current user |
setVideoForwarding |
(maxVideoForwarding: number, options?: Partial) => Promise<void> | Sets videoForwarding for limiting incomming video streams |
const { conference } = useConference();
<span>{conference.alias}</span>;
Read more on
Conference
model here.
const { createConference, joinConference } = useConference();
const conferenceOptions = {
alias: 'My Conference',
params: {
dolbyVoice: true,
},
};
const newConference = await createConference(conferenceOptions);
const joinOptions = {
constraints: {
audio: true,
video: false,
},
};
await joinConference(newConference, joinOptions);
Read more on
JoinOptions
model here.
const { leaveConference } = useConference();
<button onClick={leaveConference}>...</button>;
const { setVideoForwarding } = useConference();
<button onClick={() => setVideoForwarding({ maxVideoForwarding: 2, options: { strategy: 'lastSpeakerStrategy' } })}>
...
</button>;
Read more on
VideoFowardingStrategy
model here.