Skip to main content
Version: 0.0.x

Media Events - Javascript

VideoSDK offers various events that can be monitored to obtain information about the media status of participants in the meeting.

Here are the events specifically related to the stream:

stream-enabled

  • This event is triggered whenever a participant's video, audio or screen share stream is enabled.
  • This event can be subscribed from the Participant object.

stream-disabled

  • This event is triggered whenever a participant's video, audio or screen share stream is disabled.
  • This event can be subscribed from the Participant object.

media-status-changed

  • This event will be triggered whenever a participant's video or audio is disabled or enabled.
  • This event can be subscribed from the Participant object.

Example

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

const participants = meeting.participants;
const participant = participants.get("<participant-id>");

participant.on("stream-enabled", (stream) => {
//
});

participant.on("stream-disabled", (stream) => {
//
});

participant.on("media-status-changed", (data) => {
const { kind, newStatus } = data;
//
});

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