Participant Events - React Native
VideoSDK provides multiple types of events which can be listened to know the about the participants in the meeting.
Here are the events which specifically relate to the participants.
onParticipantJoined
- This event is triggered when someone joins the meeting and return the 
Participantobject as parameter. - This event can be subscribed from the 
useMeetinghook. 
onParticipantLeft
- This event is triggered when the someone leaves the meeting.
 - This event can be subscribed from the 
useMeetinghook. 
onWebcamRequested
- This event will be triggered to the participant 
Bwhen any other participantArequests to enable webcam of participantB. - On accepting the request, webcam of participant 
Bwill be enabled. - This event can be subscribed from the 
useMeetinghook. 
onMicRequested
- This event will be triggered to the participant 
Bwhen any other participantArequests to enable mic of participantB. - On accepting the request, mic of participant 
Bwill be enabled. - This event can be subscribed from the 
useMeetinghook. 
Example
Here is the usage of all the events mentioned in this page.
function onMicRequested(data) {
  const { participantId, accept, reject } = data;
  // participantId, will be the id of participant who requested to enable mic
  // if accept request
  accept();
  // if reject request
  reject();
}
function onWebcamRequested(data) {
  const { participantId, accept, reject } = data;
  // participantId, will be the id of participant who requested to enable webcam
  // if accept request
  accept();
  // if reject request
  reject();
}
function onParticipantJoined(participant) {
  console.log(" onParticipantJoined", participant);
}
function onParticipantLeft(participant) {
  console.log(" onParticipantLeft", participant);
}
const {
  meetingId
  ...
} = useMeeting({
  onParticipantJoined,
  onParticipantLeft,
  onMicRequested,
  onWebcamRequested,
  ...
});
API Reference
The API references for all the methods and events utilised in this guide are provided below.
Got a Question? Ask us on discord

