useParticipant Hook Event Callbacks - React
onStreamEnabled()​
onStreamEnabled()
is a callback which gets triggered whenever a participant's video, audio or screen share stream is enabled.
Example​
function onStreamEnabled(stream) {
console.log(" onStreamEnabled", stream);
}
const {
displayName
...
} = useParticipant(participantId,{
onStreamEnabled,
...
});
onStreamDisabled()​
onStreamDisabled()
is a callback which gets triggered whenever a participant's video, audio or screen share stream is disabled.
Example​
function onStreamDisabled(stream) {
console.log(" onStreamDisabled", stream);
}
const {
displayName
...
} = useParticipant(participantId,{
onStreamDisabled,
...
});
onMediaStatusChanged()​
onMediaStatusChanged()
is a callback which gets triggered whenever a participant's video or audio is disabled or enabled.
Example​
function onMediaStatusChanged(data) {
const { kind, newStatus} = data;
}
const {
displayName
...
} = useParticipant(participantId,{
onMediaStatusChanged,
...
});
onVideoQualityChanged()​
-
onVideoQualityChanged()
is a callback which gets triggered whenever a participant's video quality changes. -
currentQuality
andprevQuality
can have valuesHIGH
|MEDIUM
|LOW
.
Example​
function onVideoQualityChanged(data) {
const { currentQuality, prevQuality } = data;
}
const {
displayName
...
} = useParticipant(participantId,{
onVideoQualityChanged,
...
});
Got a Question? Ask us on discord