ID of the participant who sent the message.
The received message payload.
string for text messagesUint8Array for binary dataIndicates whether the message delivery was reliable or unreliable.
Timestamp (in milliseconds since epoch) when the message was sent.
ask_join permission.allow_join permission.Event payload containing participant details and actions.
Call this function to allow the participant to join the meeting.
Call this function to deny the participant’s request.
Display name of the participant requesting to join.
Unique ID of the participant requesting to join the meeting.
join() request is responded to with an allow or deny decision.This event is emitted to:
allow_join permission.ID of the participant who requested to join the meeting.
The final decision for the join request.
Possible values:
"allowed" – The participant was allowed to join."denied" – The participant was denied entry.Numeric error code representing the type of error.
Human-readable description of the error.
Live HLS without playback support
Live HLS with playback support
Possible values:
HLS_STARTING - Hls is in starting phase and hasn't started yet.HLS_STARTED- Hls has started successfully will return playbackHlsUrl and livestreamUrl.HLS_PLAYABLE - Hls has started and the playbackHlsUrl and livestreamUrl is now playable.HLS_STOPPING - Hls is in stopping phase and hasn't stopped yet.HLS_STOPPED- Hls has stopped successfully.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 {
//
}
});
Possible 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.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 {
//
}
});
The Participant instance who is now the main participant.
ID of the meeting where the error occurred.
Description of the error.
Call this function to accept the media relay request.
Display name of the participant requesting the media relay.
ID of the meeting from which the media relay request originated.
ID of the participant who initiated the media relay request.
Call this function to reject the media relay request.
ID of the participant who responded to the media relay request.
Decision taken for the request.
ID of the participant who decided the decision.
ID of the meeting where the media relay has started.
ID of the meeting where the media relay stopped.
Reason why the media relay stopped.
reason object is also provided that explains why the participant left the meeting.The table below lists the possible reason codes:
| Reason | Code | Description |
|---|---|---|
| WEBSOCKET_DISCONNECTED | 1001 | Socket disconnected |
| REMOVE_PEER | 1002 | Participant was removed from the meeting |
| REMOVE_PEER_VIEWER_MODE_CHANGED | 1003 | Participant removed due to viewer mode change |
| REMOVE_PEER_MEDIA_RELAY_STOP | 1004 | Participant removed because media relay was stopped |
| SWITCH_ROOM | 1005 | Participant switched to another room |
| ROOM_CLOSE | 1006 | The meeting was closed |
| UNKNOWN | 1007 | Participant disconnected due to an unknown reason |
| REMOVE_ALL | 1008 | All participants were removed |
| MEETING_END_API | 1009 | Meeting ended programmatically |
| REMOVE_PEER_API | 1010 | Participant removed via API |
| DUPLICATE_PARTICIPANT | 1011 | Participant joined from another device |
| MANUAL_LEAVE_CALLED | 1101 | Participant manually left the meeting |
| WEBSOCKET_CONNECTION_ATTEMPTS_EXHAUSTED | 1102 | WebSocket connection retries exhausted |
| JOIN_ROOM_FAILED | 1103 | Failed to join the meeting |
| SWITCH_ROOM_FAILED | 1104 | Failed to switch rooms |
Object containing the reason and corresponding code.
The current meeting state. Possible values:
CONNECTINGCONNECTEDRECONNECTINGDISCONNECTEDFAILEDmeeting.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 disconnected");
break;
case "RECONNECTING":
console.log("Reconnecting to meeting");
break;
case "FAILED":
console.log("Meeting failed");
break;
default:
console.log("Unknown state:", state);
}
});
B when any other participant A requests to enable mic of participant B.B will be enabled.Call this function to accept the request and enable your microphone.
ID of the participant who requested to enable your microphone.
Call this function to reject the request.
The Participant instance representing the newly joined participant.
reason object is provided that describes why the participant left.Possible reason codes:
| Reason | Code | Description |
|---|---|---|
| WEBSOCKET_DISCONNECTED | 1001 | Socket disconnected |
| REMOVE_PEER | 1002 | Participant was removed from the meeting |
| REMOVE_PEER_VIEWER_MODE_CHANGED | 1003 | Participant removed because viewer mode was changed |
| REMOVE_PEER_MEDIA_RELAY_STOP | 1004 | Participant removed because media relay was stopped |
| SWITCH_ROOM | 1005 | Participant switched to a different room |
| ROOM_CLOSE | 1006 | The meeting has been closed |
| UNKNOWN | 1007 | Participant disconnected due to an unknown reason |
| REMOVE_ALL | 1008 | Remove All from the meeting |
| MEETING_END_API | 1009 | Meeting Ended. |
| REMOVE_PEER_API | 1010 | Participant removed from the meeting |
| DUPLICATE_PARTICIPANT | 1011 | Leaving meeting, since this participantId joined from another device. |
| MANUAL_LEAVE_CALLED | 1101 | Participant manually called the leave() method to exit the meeting |
| WEBSOCKET_CONNECTION_ATTEMPTS_EXHAUSTED | 1102 | Meeting left after multiple failed websocket connection attempts. |
| JOIN_ROOM_FAILED | 1103 | Meeting left due to an error while joining the room. |
| SWITCH_ROOM_FAILED | 1104 | Meeting left due to an error while switching rooms. |
The Participant instance who left the meeting.
An object describing the reason and corresponding code.
The new mode of the participant. Possible values are defined in modes.
ID of the participant whose mode has changed.
Indicates which media type was paused:
"audio" – Audio streams"video" – Video streams"share" – Screen-share video streams"shareAudio" – Screen-share audio streamsnull.ID of the participant currently presenting, or null if no one is presenting.
Indicates whether the limitation is currently active or resolved.
Time (in milliseconds since epoch) when the event occurred.
Specifies the type of limitation.
The current recording state:
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.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 {
//
}
});
Indicates which media type was resumed:
"audio" – Audio streams"video" – Video streams"share" – Screen-share video streams"shareAudio" – Screen-share audio streamsnull is returned.ID of the currently active speaker, or null if no one is speaking.
ID of the transcription session.
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.
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`);
}
});
ID of the participant whose speech was transcribed.
Name of the participant whose speech was transcribed.
Transcribed text content.
Timestamp (in milliseconds since epoch) when the transcription was generated.
Type of transcription event.
B when any other participant A requests to enable webcam of participant B.B will be enabled.Call this function to accept the request and enable your webcam.
ID of the participant who requested to enable your webcam.
Call this function to reject the request.
URL of the whiteboard session.