Skip to main content
Version: 0.0.x

Participant Events - Javascript

VideoSDK provides various events that can be utilized to gather information about the participants in the meeting.

Here are the events specifically related to the participant:

participant-joined

  • This event is triggered when someone joins the meeting, returning the Participant object as parameter.
  • It can be subscribed to using the meeting object.

participant-left

  • This event is triggered someone leaves the meeting.
  • It can be subscribed to using the meeting object.

webcam-requested

  • This event is triggered for participant B, when another participant, A requests to enable their webcam.
  • Upon accepting the request, participant B's webcam will be enabled.
  • It can be subscribed to using the meeting object.

mic-requested

  • This event is triggered for participant B, when another participant, A requests to enable their mic.
  • Upon accepting the request, participant B's mic will be enabled.
  • It can be subscribed to using the meeting object.

Example

Here is an example demonstrating the usage of the event mentioned on this page.

let meeting;

// Initialize Meeting
meeting = VideoSDK.initMeeting({
// ...
});

meeting.on("participant-joined", (participant) => {
//
});

meeting.on("participant-left", (participant) => {
//
});

meeting.on("webcam-requested", (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();
});

meeting.on("mic-requested", (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();
});

API Reference

The API references for all the methods and events utilized in this guide are provided below.

Got a Question? Ask us on discord