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

Latest commit

 

History

History
72 lines (53 loc) · 2.58 KB

File metadata and controls

72 lines (53 loc) · 2.58 KB

useConference

The useConference hook gathers functions responsible for managing conferences.

Members

Name Type Description
conference Conference The object of the current conference.
createConference (ConferenceOptions) => Promise Creates a conference.
fetchConference (id) => Promise Fetches a conference.
joinConference (Conference, JoinOptions) => Promise Joins a conference.
leaveConference () => Promise Leaves a conference.
maxVideoForwarding number Retrieves maximum video forwarding for current user
setVideoForwarding (maxVideoForwarding: number, options?: Partial) => Promise Sets videoForwarding for limiting incomming video streams

Examples

React

Get conference data

const { conference } = useConference();

<span>{conference.alias}</span>;

Create and join conference

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);

Leave conference

const { leaveConference } = useConference();

<button onClick={leaveConference}>...</button>;

Set videoForwarding conference

const { setVideoForwarding } = useConference();

<button
  onClick={() =>
    setVideoForwarding({ maxVideoForwarding: 2, options: { strategy: VideoForwardingStrategy.LastSpeaker } })
  }
>
  ...
</button>;