Skip to main content

useMeeting Hook

useMeeting hook abtracts meeting class and takes all the events as parameters and returns all the properties and methods to work meeting instance.

useMeeting example#

useMeeting react hook
import {  useMeeting,} from "@videosdk.live/react-sdk";
function onParticipantJoined(participant) {  setParticipant(participant)}
const {  meetingId,  ...} = useMeeting({  onParticipantJoined,  ...});

Parameters#

  • __namedParametersrequiredobject

      Parameters
    • onParticipantJoinedoptionalevent

    • onParticipantLeftoptionalevent

    • onSpeakerChangedoptionalevent

    • onPresenterChangedoptionalevent

    • onMainParticipantChangedoptionalevent

    • onEntryRequestedoptionalevent

    • onEntryRespondedoptionalevent

    • onRecordingStartedoptionalevent

    • onRecordingStoppedoptionalevent

    • onChatMessageoptionalevent

    • onMeetingJoinedoptionalevent

    • onMeetingLeftoptionalevent

    • onLiveStreamStartedoptionalevent

    • onLiveStreamStoppedoptionalevent

    • onVideoStateChangedoptionalevent

    • onVideoSeekedoptionalevent

Returns#

  • __returnsrequiredobject

      Returns
    • meetingIdstring

    • meetingMeeting

    • localParticipantParticipant

    • mainParticipantParticipant

    • onMainParticipantChangedevent

    • activeSpeakerIdstring

    • participantsMap<Participant>

    • presenterIdstring

    • localMicOnboolean

    • localWebcamOnboolean

    • localScreenShareOnboolean

    • messagesMap<string>

    • join()function

    • leave()function

    • end()function

    • startRecording(webhookUrl: string)function

    • stopRecording()function

    • sendChatMessage()function

    • respondEntry()function

    • muteMic()function

    • unmuteMic()function

    • toggleMic()function

    • disableWebcam()function

    • enableWebcam()function

    • toggleWebcam()function

    • disableScreenShare()function

    • enableScreenShare()function

    • toggleScreenShare()function

    • getMics()function

    • getWebcams()function

    • changeWebcam(deviceId: string)function

    • changeMic(deviceId: string)function

    • startVideo({ link: string })function

    • stopVideo()function

    • resumeVideo()function

    • pauseVideo({ currentTime: number })function

    • seekVideo({ currentTime: number })function

    • startLivestream(Array<{ url: string, streamKey: string }>)function

    • stopLivestream()function