Meeting Class Events - Javascript
meeting-joined
- This event will be emitted when a localParticipant successfully joined the meeting.
Example
meeting.on("meeting-joined", () => {
//
});
meeting-left
- This event will be emitted when a localParticipant left the meeting.
Example
meeting.on("meeting-left", () => {
//
});
participant-joined
- This event will be emitted when a new participant joined the meeting.
Event callback parameters
- participant: Participant
Example
meeting.on("participant-joined", (participant) => {
//
});
participant-left
- This event will be emitted when a joined participant left the meeting.
Event callback parameters
- participant: Participant
Example
meeting.on("participant-left", (participant) => {
//
});
speaker-changed
- This event will be emitted when a active speaker changed.
- If you want to know which participant is actively speaking, then this event will be used.
- If no participant is actively speaking, then this event will pass
nullas en event callback parameter.
Event callback parameters
- activeSpeakerId: String?
Example
meeting.on("speaker-changed", (activeSpeakerId) => {
//
});
presenter-changed
- This event will be emitted when any participant starts or stops screen sharing.
- It will pass
participantIdas an event callback parameter. - If a participant stops screensharing, then this event will pass
nullas en event callback parameter.
Event callback parameters
- activePresenterId: String?
Example
meeting.on("presenter-changed", (activePresenterId) => {
//
});
error
- This event will be emitted when any error occured.
- It will pass
codeandmessage, as an event callback parameter. - To see all available error codes from SDK. Meeting Error Codes
Event callback parameters
- data: { code: Number; message: String }
- code: Number
- message: String
Example
meeting.on("error", (data) => {
const { code, message } = data;
});
entry-requested
- This event will be emitted when a new participant who is trying to join the meeting, is having permission
ask_joinin token. - This event will only be emitted to the participants in the meeting, who is having the permission
allow_joinin token. - This event will pass following parameters as an event parameters,
participantIdandnameof the new participant who is trying to join the meeting,allow()anddeny()to take required actions.
Event callback parameters
- data: { allow: Function; deny: Function; name: String; participantId: String }
- allow: Function
- deny: Function
- name: String
- participantId: String
Example
meeting.on("entry-requested", (data) => {
const { participantId, name, allow, deny } = data;
console.log(`${name} requested to join the meeting.`);
// If you want to allow the entry request
allow();
// if you want to deny the entry request
deny();
});
entry-responded
- This event will be emitted when the
join()request is responded. - This event will be emitted to the participants in the meeting, who is having the permission
allow_joinin token. - This event will be also emitted to the participant who requested to join the meeting.
Event callback parameters
- participantId: String
- decision: "allowed" | "denied"
Example
meeting.on("entry-responded", (participantId, decision) => {
// participantId will be id of participant who requested to join meeting
if (decision === "allowed") {
// entry allowed
} else {
// entry denied
}
});
webcam-requested
- This event will be emitted to the participant
Bwhen any other participantArequests to enable webcam of participantB. - On accepting the request, webcam of participant
Bwill be enabled.
Event callback parameters
- data: { accept: Function; participantId: String; reject: Function }
- accept: Function
- participantId: String
- reject: Function
Example
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();
});
mic-requested
- This event will be emitted to the participant
Bwhen any other participantArequests to enable mic of participantB. - On accepting the request, mic of participant
Bwill be enabled.
Event callback parameters
- data: { accept: Function; participantId: String; reject: Function }
- accept: Function
- participantId: String
- reject: Function
Example
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();
});
recording-state-changed
- This event will be emitted when the meeting's recording status changed.
Event callback parameters
-
data: { status: String }
- status: String
status has following values
RECORDING_STARTING- Recording is in starting phase and hasn't started yet.RECORDING_STARTED- Recording has started successfully.RECORDING_STOPPING- Recording is in stopping phase and hasn't stopped yet.RECORDING_STOPPED- Recording has stopped successfully.
Example
import { VideoSDK } from "@videosdk.live/js-sdk";
const Constants = VideoSDK.Constants;
meeting.on("recording-state-changed", (data) => {
const { status } = data;
if (status === Constants.recordingEvents.RECORDING_STARTING) {
console.log("Meeting recording is starting");
} else if (status === Constants.recordingEvents.RECORDING_STARTED) {
console.log("Meeting recording is started");
} else if (status === Constants.recordingEvents.RECORDING_STOPPING) {
console.log("Meeting recording is stopping");
} else if (status === Constants.recordingEvents.RECORDING_STOPPED) {
console.log("Meeting recording is stopped");
} else {
//
}
});
recording-started
This event will be deprecated soon
- This event will be emitted when recording of the meeting is started.
Example
meeting.on("recording-started", () => {
//
});
recording-stopped
This event will be deprecated soon
- This event will be emitted when recording of the meeting is stopped.
Example
meeting.on("recording-stopped", () => {
//
});
livestream-state-changed
- This event will be emitted when the meeting's livestream status changed.
Event callback parameters
-
data: { status: String }
- status: String
status has following values
LIVESTREAM_STARTING- Livestream is in starting phase and hasn't started yet.LIVESTREAM_STARTED- Livestream has started successfully.LIVESTREAM_STOPPING- Livestream is in stopping phase and hasn't stopped yet.LIVESTREAM_STOPPED- Livestream has stopped successfully.
Example
import { VideoSDK } from "@videosdk.live/js-sdk";
const Constants = VideoSDK.Constants;
meeting.on("livestream-state-changed", (data) => {
const { status } = data;
if (status === Constants.livestreamEvents.LIVESTREAM_STARTING) {
console.log("Meeting livestream is starting");
} else if (status === Constants.livestreamEvents.LIVESTREAM_STARTED) {
console.log("Meeting livestream is started");
} else if (status === Constants.livestreamEvents.LIVESTREAM_STOPPING) {
console.log("Meeting livestream is stopping");
} else if (status === Constants.livestreamEvents.LIVESTREAM_STOPPED) {
console.log("Meeting livestream is stopped");
} else {
//
}
});
livestream-started
This event will be deprecated soon
- This event will be emitted when
RTMPlive stream of the meeting is started.
Example
meeting.on("livestream-started", () => {
//
});
livestream-stopped
This event will be deprecated soon
- This event will be emitted when
RTMPlive stream of the meeting is stopped.
Example
meeting.on("livestream-stopped", () => {
//
});
hls-state-changed
- This event will be emitted when the meeting's HLS(Http Livestreaming) status changed.
Event callback parameters
- data: { status: String , playbackHlsUrl: String , livestreamUrl: String }
- status: String
- playbackHlsUrl: String
will receive this property only in HLS_STARTED status - livestreamUrl: String
will receive this property only in HLS_STARTED status
status has following values
HLS_STARTING- Hls is in starting phase and hasn't started yet.HLS_STARTED- Hls has started successfully will returnplaybackHlsUrlandlivestreamUrl.HLS_PLAYABLE- Hls has started and theplaybackHlsUrlandlivestreamUrlis not playable.HLS_STOPPING- Hls is in stopping phase and hasn't stopped yet.HLS_STOPPED- Hls has stopped successfully.
downstreamUrl is now depecated. Use playbackHlsUrl or livestreamUrl in place of downstreamUrl
Example
import { VideoSDK } from "@videosdk.live/js-sdk";
const Constants = VideoSDK.Constants;
meeting.on("hls-state-changed", (data) => {
const { status } = data;
if (status === Constants.hlsEvents.HLS_STARTING) {
console.log("Meeting Hls is starting");
} else if (status === Constants.hlsEvents.HLS_STARTED) {
// when hls is started you will receive playbackHlsUrl
const { playbackHlsUrl } = data;
console.log("Meeting Hls is started");
} else if (status === Constants.hlsEvents.HLS_STOPPING) {
console.log("Meeting Hls is stopping");
} else if (status === Constants.hlsEvents.HLS_STOPPED) {
console.log("Meeting Hls is stopped");
} else {
//
}
});
hls-started
This event will be deprecated soon
- This event will be emitted when
HLSof the meeting is started.
Event callback parameters
- data: { playbackHlsUrl: String; livestreamUrl: String }
- playbackHlsUrl: String
- livestreamUrl: String
downstreamUrl is now depecated. Use playbackHlsUrl or livestreamUrl in place of downstreamUrl
Example
meeting.on("hls-started", ({ playbackHlsUrl, livestreamUrl }) => {
//
});
hls-stopped
This event will be deprecated soon
- This event will be emitted when
HLSof the meeting is stopped.
Example
meeting.on("hls-stopped", () => {
//
});
whiteboard-started
- This event will be triggered when whiteboard is successfully started and it will return the url.
Example
meeting.on("whiteboard-started", (data) => {
const { url } = data;
//
});
whiteboard-stopped
- This event will be triggered when whiteboard session is stopped for all participants.
Example
meeting.on("whiteboard-stopped", () => {
//
});
transcription-state-changed
- This event will be triggered whenever state of realtime transcription is changed.
Event callback parameters
- data: { status: String, id: String }
- status: String
- id: String
status has following values
TRANSCRIPTION_STARTING- Realtime Transcription is in starting phase and hasn't started yet.TRANSCRIPTION_STARTED- Realtime Transcription has started successfully.TRANSCRIPTION_STOPPING- Realtime Transcription is in stopping phase and hasn't stopped yet.TRANSCRIPTION_STOPPED- Realtime Transcription has stopped successfully.
Example
import { VideoSDK } from "@videosdk.live/js-sdk";
const Constants = VideoSDK.Constants;
meeting.on("transcription-state-changed", (data) => {
let { status, id } = data;
if (status === Constants.transcriptionEvents.TRANSCRIPTION_STARTING) {
console.log(`Realtime Transcription with ${id} is starting`);
} else if (status === Constants.transcriptionEvents.TRANSCRIPTION_STARTED) {
console.log(`Realtime Transcription with ${id} is started`);
} else if (status === Constants.transcriptionEvents.TRANSCRIPTION_STOPPING) {
console.log(`Realtime Transcription with ${id} is stopping`);
} else if (status === Constants.transcriptionEvents.TRANSCRIPTION_STOPPED) {
console.log(`Realtime Transcription with ${id} is stopped`);
}
});
transcription-text
- This event will be emitted when text for running realtime transcription received.
Example
meeting.on("transcription-text", (data) => {
let { participantId, participantName, text, timestamp, type } = data;
console.log(`${participantName}: ${text} ${timestamp}`);
});
participant-mode-changed
- This event will be triggered when participant mode changes.
- It will pass
participantIdandmodeas an event callback parameter. - All available modes are
SEND_AND_RECV,SIGNALLING_ONLY,RECV_ONLY.
Important Changes Javascript SDK in Version v0.1.4
- The following modes have been deprecated:
CONFERENCEhas been replaced bySEND_AND_RECVVIEWERhas been replaced bySIGNALLING_ONLY
Please update your implementation to use the new modes.
⚠️ Compatibility Notice:
To ensure a seamless meeting experience, all participants must use the same SDK version.
Do not mix version v0.1.4 + with older versions, as it may cause significant conflicts.
Example
meeting.on("participant-mode-changed", ({ participantId, mode }) => {
console.log(`${participantId} has changed ${mode}`);
});
meeting-state-changed
- This event will be triggered when state of meeting changes.
- It will pass
stateas an event callback parameter which will indicate current state of the meeting. - All available states are
CONNECTING,CONNECTED,RECONNECTING,DISCONNECTED.
Event callback parameters
- data: { state: String }
- state: String
Example
meeting.on("meeting-state-changed", (data) => {
const { state } = data;
switch (state) {
case "CONNECTING":
console.log("Meeting is Connecting");
break;
case "CONNECTED":
console.log("Meeting is Connected");
break;
case "DISCONNECTED":
console.log("Meeting connection disconnected abruptly");
break;
case "RECONNECTING":
console.log("Meeting is Reconnecting");
break;
case 'FAILED':
console.log("Meeting is in Failed State");
break;
default:
console.log("Unknown state:", state);
break;
}
//
});
paused-all-streams
- This callback is triggered when all or specified media streams within the meeting are successfully paused
Parameters
kind: Specifies the type of media stream that was paused.- Type:
String - Possible values:
"audio": Indicates that audio streams have been paused."video": Indicates that video streams have been paused."share": Indicates that screen-sharing video streams have been paused"shareAudio": Indicates that screen-sharing audio streams have been paused
- Type:
Example
meeting.on("paused-all-streams", (data) => {
const { kind } = data;
});
resumed-all-streams
- This callback is triggered when all or specified media streams within the meeting are successfully resumed
Parameters
kind: Specifies the type of media stream that was resumed.- Type:
String - Possible values:
"audio": Indicates that audio streams have been resumed."video": Indicates that video streams have been resumed."share": Indicates that screen-sharing video streams have been resumed"shareAudio": Indicates that screen-sharing audio streams have been paused
- Type:
Example
meeting.on("resumed-all-streams", (data) => {
const { kind } = data;
});
media-relay-request-received
- This callback is triggered when a request is recieved for media relay in the destination meeting.
Parameters
-
participantId - (String): Specifies the participantId who requested the media relay. -
meetingId - (String): Specifies the meeting from where the media relay request was made. -
displayName - (String): Specifies the displayName of the participant who requested the media relay. -
accept - (Function): Specifies the function to accept the media relay request. -
reject - (Function): Specifies the function to reject the media relay request..
Example
meeting.on(
"media-relay-request-received",
({ participantId, meetingId, displayName, accept, reject }) => {
//
}
);
media-relay-request-response
- This callback is triggered when a response is recieved for media relay request in the source meeting.
Parameters
-
participantId - (String): Specifies the participantId who responded the request for the media relay. -
decision - (String): Specifies the decision whether the request for media relay was accepted or not.
Example
meeting.on("media-relay-request-response", (participantId, decision) => {
//
});
media-relay-started
- This callback is triggered when the media relay to the destination meeting succesfully starts.
Parameters
meetingId - (String): Specifies the meeting where the media relay started.
Example
meeting.on("media-relay-started", ({ meetingId }) => {
//
});
media-relay-stopped
- This callback is triggered when the media relay to the destination meeting stops for any reason.
Parameters
-
meetingId - (String): Specifies the meeting where the media relay stopped. -
reason - (String): Specifies the reason why the media relay stopped
Example
meeting.on("media-relay-stopped", ({ meetingId, reason }) => {
//
});
media-relay-error
- This callback is triggered when an error occurs during media relay to the destination meeting.
Parameters
-
meetingId - (String): Specifies the meeting where the media relay stopped. -
error - (String): Specifies the error that occured.
Example
meeting.on("media-relay-error", (meetingId, error) => {
//
});
quality-limitation
- This callback is triggered when a quality limitation is detected or resolved during the meeting.
Parameters
-
type: Specifies the type of limitation.- Type:
String - Possible values:
"congestion": Network congestion detected."bandwidth": Insufficient network bandwidth."cpu": High CPU usage on the device.
- Type:
-
state: Specifies whether the limitation is currently active or resolved.- Type:
String - Possible values:
"detected": Limitation has been detected."resolved": Limitation has been resolved.
- Type:
-
timestamp: The time (in milliseconds since epoch) when the event occurred.- Type:
Number
- Type:
Example
meeting.on("quality-limitation", ({ type, state, timestamp }) => {
//
});
data
- This callback is triggered whenever a message is received over the DataStream.
Parameters
-
payload: The actual data received.- Type:
Uint8Array | string - Details:
- If the sender transmitted a string, the payload will be a
string. - If the sender transmitted binary data (e.g., ArrayBuffer, Blob), the payload will be a
Uint8Array.
- If the sender transmitted a string, the payload will be a
- Type:
-
from: The identity of the participant who sent the message.- Type:
String
- Type:
-
timestamp: The time (in milliseconds since epoch) when the message was sent.- Type:
Number
- Type:
-
reliability: Specifies whether the message was delivered reliably or unreliably.- Type:
String - Possible values:
"reliable": Message delivery is guaranteed."unreliable": Message may be dropped under poor network conditions but has lower latency.
- Type:
Example
meeting.on("data", ({ payload, from, timestamp, reliability }) => {
if (typeof payload === "string") {
console.log(`Text message from ${from}: ${payload}`);
} else {
console.log(`Binary data from ${from}:`, payload);
}
console.log(`Received at: ${new Date(timestamp).toLocaleTimeString()}`);
console.log(`Reliability: ${reliability}`);
});
Got a Question? Ask us on discord

