Skip to main content
Version: 0.0.x

Methods returned by useMeeting Hook

join()

  • It is used to join a meeting.
  • During intialization using the <MeetingProvider>, if joinWithoutInteraction is set to true, participant will automatically join the meeting. If it is false explicity call for join() should be made.

Events associated with join():

Participant having ask_join permission inside token

  • If a token contains the permission ask_join, then the participant will not join the meeting directly after calling join(), but an event will be emitted to the participant having the permission allow_join called onEntryRequested.

  • After the decision from the remote participant, an event will be emitted to participant called onEntryResponded. This event will contain the decision made by the remote participant.

Participant having allow_join permission inside token

  • If a token containing the permission allow_join, then the participant will join the meeting derectly after calling join().

leave()

  • leave() is used to leave a meeting for local participant only.

Events associated with leave():


end()

  • end() is used to end a meeting for all participants.

Events associated with end():


enableMic()

  • enableMic() is used to enable mic of the local participant.

Events associated with enableMic():


disableMic()

  • disableMic() is used to disable mic of the local participant.

Events associated with disableMic():


toggleMic()

  • toggleMic() is used to toogle mic of the local participant.

Events associated with toggleMic():


enableWebcam()

  • enableWebcam() is used to enable webcam of the local participant.

Events associated with enableWebcam():


disableWebcam()

  • disableWebcam() is used to disable webcam of the local participant.

Events associated with disableWebcam():


toggleWebcam()

  • toggleWebcam() is used to toogle webcam of the local participant.

Events associated with toggleWebcam():


enableScreenShare()

  • enableScreenShare() is used to enable screen share of the local participant.

Events associated with enableScreenShare():


disableScreenShare()

  • disableScreenShare() is used to disable screen share of the local participant.

Events associated with disableScreenShare():


toggleScreenShare()

  • toggleScreenShare() is used to toogle screen share of the local participant.

Events associated with toggleScreenShare():

caution

For React Native iOS Screen Share feature, you need to follow this guide React Native iOS Screen Share


startRecording()

  • startRecording is used to start meeting recording.

  • webhookUrl will be triggered when the recording is completed and stored into server. Read more about webhooks here.

  • awsDirPath will be the path for the your S3 bucket where you want to store recordings to. To allow us to store recording in your S3 bucket, you will need to fill this form by providing the required values. VideoSDK AWS S3 Integration

Parameters

  • webhookUrl: String
  • awsDirPath: String
  • config:
    • layout:
      • type: "GRID" | "SPOTLIGHT" | "SIDEBAR"
      • priority: "SPEAKER" | "PIN"
      • gridSize: Number max 25

Events associated with startRecording():

Example

const webhookUrl = "https://webhook.your-api-server.com";

const awsDirPath = "/meeting-recordings/";

const config = {
layout: {
type: "SPOTLIGHT",
priority: "PIN",
gridSize: 9,
},
};

const { startRecording } = useMeeting();

startRecording(webhookUrl, awsDirPath, config);

stopRecording()

  • stopRecording() is used to stop the meeting recording.

Events associated with stopRecording():


startLiveStream()

  • startLiveStream() is used to start meeting livestreaming.

  • You will be able to start live stream meetings to other platforms such as Youtube, Facebook, etc. that support RTMP streaming.

Parameters

  • outputs: Array<{ url: String, streamKey: String }>
  • config:
    • layout:
      • type: "GRID" | "SPOTLIGHT" | "SIDEBAR"
      • priority: "SPEAKER" | "PIN"
      • gridSize: Number max 25

Events associated with startLiveStream():

Example

const outputs = [
{
url: "rtmp://a.rtmp.youtube.com/live2",
streamKey: "<STREAM_KEY>",
},
{
url: "rtmps://",
streamKey: "<STREAM_KEY>",
},
];

const config = {
layout: {
type: "SPOTLIGHT",
priority: "PIN",
gridSize: 9,
},
};

const { startLiveStream } = useMeeting();

startLivestream(outputs, config);

stopLiveStream()

  • stopLiveStream() is used to stop the live streaming to social media.

Events associated with stopLiveStream():


startHls()

  • startHls() will start HLS streaming of your meeting.

  • You will be able to start HLS and watch the live stream of meeting over HLS.

Parameters

  • config:
    • layout:
      • type: "GRID" | "SPOTLIGHT" | "SIDEBAR"
      • priority: "SPEAKER" | "PIN"
      • gridSize: Number max 25

Events associated with startHls():

Example

const config = {
layout: {
type: "SPOTLIGHT",
priority: "PIN",
gridSize: 9,
},
};

const { startHls } = useMeeting();

startHls(config);

stopHls()

  • stopHls() is used to stop the HLS streaming.

Events associated with stopHls():


getMics()

  • getMics() will return all mic devices connected.

Returns

  • Promise<{ deviceId: string; lable: string }[]>

Example

const { getMics } = useMeeting();

const handleGetMics = async () => {
const mics = await getMics();

console.log(mics);
};

handleGetMics();

getWebcams()

  • getWebcams() will return all camera devices connected.

Returns

  • Promise<{ deviceId: string; lable: string }[]>

Example

const { getWebcams } = useMeeting();

const handleGetWebcams = async () => {
const webcams = await getWebcams();

console.log(webcams);
};

handleGetWebcams();

changeMic()

  • It is used to change the mic device.
  • If multiple mic devices are connected, by using changeMic() one can change the mic device.

Parameters

  • deviceId: String

changeWebcam()

  • changeWebcam() is used to change the webcam device.
  • If multiple webcam devices are connected, by using changeWebcam() one can change the camera device.

Parameters

  • deviceId: String

startVideo()

  • startVideo() is used to start playing external video in th meeting.

Parameters

  • link: String

Events associated with startVideo():


stopVideo()

  • stopVideo() stops playing external video in th meeting.

Events associated with stopVideo():


pauseVideo()

  • pauseVideo() pauses playing the video at the provided time in the input parameter currentTime.

Parameters

  • currentTime : Number

Events associated with pauseVideo():


resumeVideo()

  • resumeVideo() resumes playing external video in th meeting.

Events associated with resumeVideo():


seekVideo()

  • seekVideo() seeks playing the video upto the provided time in the input parameter currentTime.

Parameters

  • currentTime : Number

Events associated with seekVideo():


connectTo()

  • connectTo() is used to open a connection to the provided meetingId in the parameters.

Parameters

  • meetingId : String
  • payload : Object

Events associated with connectTo():