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
__namedParametersrequired
object
onParticipantJoinedoptional
event
onParticipantLeftoptional
event
onSpeakerChangedoptional
event
onPresenterChangedoptional
event
onMainParticipantChangedoptional
event
onEntryRequestedoptional
event
onEntryRespondedoptional
event
onRecordingStartedoptional
event
onRecordingStoppedoptional
event
onChatMessageoptional
event
onMeetingJoinedoptional
event
onMeetingLeftoptional
event
onLiveStreamStartedoptional
event
onLiveStreamStoppedoptional
event
onVideoStateChangedoptional
event
onVideoSeekedoptional
event
onPinStateChangedoptional
event
Parameters
Returns
__returnsrequired
object
meetingId
string
meeting
Meeting
localParticipant
Participant
mainParticipant
Participant
onMainParticipantChanged
event
activeSpeakerId
string
participants
Map<Participant>
pinnedParticipants
Map<string, { cam: bool, share: bool }}>
presenterId
string
localMicOn
boolean
localWebcamOn
boolean
localScreenShareOn
boolean
messages
Map<string>
join()
function
leave()
function
end()
function
startRecording(webhookUrl: string, awsDirPath: 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
Returns
Got a Question? Ask us on discord