useParticipant Hook
useParticipant
abstracts participant class. It takes participantId, events as partameters and returns participant properties and methods.
useParticipant hook
useParticipant react hook
import {
useParticipant,
} from "@videosdk.live/react-sdk";
const onStreamEnabled = (stream) => {
setStream(stream);
};
const {
displayName,
...
} = useParticipant(participantId, {
onStreamEnabled,
...
});
Parameters
__namedParametersrequired
object
participantIdoptional
string
triggersoptional
object
onStreamEnabledoptional
callback
onStreamDisabledoptional
callback
Parameters
Returns
__returnsrequired
object
displayNameoptional
string
participantoptional
Participant
webcamStreamoptional
MediaTrackStream
micStreamoptional
MediaTrackStream
screenShareStreamoptional
MediaTrackStream
webcamOnoptional
boolean
micOnoptional
boolean
screenShareOnoptional
boolean
isLocaloptional
boolean
isActiveSpeakeroptional
boolean
pinStateoptional
{ cam: bool, share: bool }
setQuality()optional
callback
enableMic()optional
callback
disableMic()optional
callback
enableWebcam()optional
callback
disableWebcam()optional
callback
Returns
Got a Question? Ask us on discord