ReadonlyagentThis represents the current state of the agentParticipant (for example, LISTENING, SPEAKING).
Possible values: AgentState
This represents display name of the agentParticipant.
This represents unique ID of the agentParticipant who joined the meeting.
This represents whether the participant is an agent.
This indicates whether this participant is the local user.
true → Local participant (you)false → Remote participantThis represents agentParticipant’s metadata provided while initializing the meeting
This indicates whether the agentParticipant’s microphone is currently enabled.
This represents the agentParticipant’s current mode.
This represents the current pin state of the agentParticipant.
This represents the current quality level of the participant’s video stream.
This indicates whether the participant’s screenshare audio is currently enabled.
This indicates whether the participant’s screenShare is currently enabled.
This represents the quality level of the participant’s screen-sharing stream.
This represents all media streams associated with the agentParticipant. Streams could be audio or video.
This indicates whether the agentParticipant’s webcam is currently enabled.
Optionaloptions: { height?: number; width?: number }
Optionalheight?: numberDesired height of the captured image.
Optionalwidth?: numberDesired width of the captured image.
A Base64-encoded string representing the captured image, or null if
the image could not be captured.
let meeting;
// Initialize Meeting
meeting = VideoSDK.initMeeting({
// ...
});
const participant = Array.from(meeting.participants.values())[0];
try {
// captureImage returns a Base64 string
const base64Data = await participant.captureImage();
console.log("base64", base64Data);
} catch (err) {
console.log("Error in captureImage", err);
}
autoConsume was set to false in initMeeting().autoConsume was set to false in initMeeting().Events associated with disableMic():
stream object.Events associated with disableWebcam():
stream object.Events associated with enableMic():
stream object.Events associated with enableWebcam():
The participant first receives a webcam-requested event. Once the request is accepted, the webcam is enabled.
All participants receive a stream-enabled event containing the corresponding stream object.
An array of objects containing the following metrics:
jitter – Represents variation in packet arrival time (stream instability).bitrate – The bitrate at which the audio stream is being transmitted.totalPackets – Total number of packets transmitted for the stream.packetsLost – Total number of packets lost during transmission.rtt – Round-trip time (in milliseconds) between the client and server.codec – Codec used for encoding the audio stream.network – Network type used for transmitting the stream.Info
If the
rttvalue exceeds 300ms, consider switching to a region closer to the user for improved performance. Learn more visit here.
An array of objects containing the following metrics:
jitter – Represents variation in packet arrival time (stream instability).bitrate – The bitrate at which the audio stream is being transmitted.totalPackets – Total number of packets transmitted for the stream.packetsLost – Total number of packets lost during transmission.rtt – Round-trip time (in milliseconds) between the client and server.codec – Codec used for encoding the audio stream.network – Network type used for transmitting the stream.Info
If the
rttvalue exceeds 300ms, consider switching to a region closer to the user for improved performance. Learn more visit here.
An array of objects containing the following metrics:
jitter – Represents variation in packet arrival time (stream instability).bitrate – The bitrate at which the video stream is being transmitted.totalPackets – Total number of packets transmitted for the stream.packetsLost – Total number of packets lost during transmission.rtt – Round-trip time (in milliseconds) between the client and server.codec – Codec used for encoding the video stream.network – Network type used for transmitting the stream.limitation – Indicates any limitations affecting stream quality.size – Resolution or size information related to the stream.Info
If the
rttvalue exceeds 300ms, consider switching to a region closer to the user for improved performance. Learn more visit here.
An object with two nested objects, or null:
send.outgoingBitrate – The total outgoing bitrate (in kbps) across all media streams sent by this participant. Returns 0 or null when the value is unavailable.send.totalSentBytes – The total number of bytes sent by this participant across all media streams. Returns 0 or null when the value is unavailable.receive.incomingBitrate – The total incoming bitrate (in kbps) across all media streams received by this participant. Returns 0 or null when the value is unavailable.receive.totalReceivedBytes – The total number of bytes received by this participant across all media streams. Returns 0 or null when the value is unavailable.let meeting;
// Initialize Meeting
meeting = VideoSDK.initMeeting({
// ...
});
try {
const transportStats = await meeting.localParticipant.getTransportStats();
if (transportStats) {
console.log("Outgoing bitrate:", transportStats.send.outgoingBitrate, "kbps");
console.log("Total sent bytes:", transportStats.send.totalSentBytes);
console.log("Incoming bitrate:", transportStats.receive.incomingBitrate, "kbps");
console.log("Total received bytes:", transportStats.receive.totalReceivedBytes);
}
} catch (err) {
console.log("Error in getTransportStats", err);
}
An array of objects containing the following metrics:
jitter – Represents variation in packet arrival time (stream instability).bitrate – The bitrate at which the video stream is being transmitted.totalPackets – Total number of packets transmitted for the stream.packetsLost – Total number of packets lost during transmission.rtt – Round-trip time (in milliseconds) between the client and server.codec – Codec used for encoding the video stream.network – Network type used for transmitting the stream.limitation – Indicates any limitations affecting stream quality.size – Resolution or size information related to the stream.Info
If the
rttvalue exceeds 300ms, consider switching to a region closer to the user for improved performance. Learn more visit here.
Removes an event listener that was previously registered.
Event name to which you want to unsubscribe.
Callback function which was passed while subscribing to the event.
To view the complete list of available events and their details, refer to AgentParticipantEvent.
Registers an event listener.
Event name to which you want to subscribe.
A callback function that is executed when the specified event is emitted.
To view the complete list of available events and their details, refer to AgentParticipantEvent.
This method can be used to pin the agentParticipant’s camera, screen share, or both.
Every participant receives a pin-state-changed event when the pin state is updated.
Specifies which stream to pin.
Allowed values:
"SHARE_AND_CAM" – Pins both screen share and camera streams."CAM" – Pins only the camera stream."SHARE" – Pins only the screen-share stream.typeHTMLAudioElement that can be used to play incoming audio streams in the DOM.Optionaloptions: { type?: "audio" }
Optionaltype?: "audio"Type: `"audio"
"audio" – Renders the agentParticipant's microphone audio stream.An HTMLAudioElement that plays the requested audio stream.
<div> element that internally manages the rendering of the agentParticipant’s video stream.Optionaloptions: {Optional configuration for rendering the stream.
OptionalcontainerStyle?: Partial<CSSStyleDeclaration>CSS styles applied to the outer container <div>.
OptionalmaxQuality?: "low" | "med" | "high" | "auto"Sets the preferred maximum quality for the rendered stream.
Allowed value:
"auto" – Automatically adapts quality based on network conditions (default)"high" – Highest available quality"med" – Medium quality"low" – Low quality for bandwidth-constrained scenariosOptionaltype?: "video"Specifies which stream to render.
Allowed value:
"video" – Camera video streamOptionalvideostyle?: Partial<CSSStyleDeclaration>CSS styles applied directly to the internal <video> element.
An HTMLDivElement containing the rendered video or screen-share stream.
The width of the viewport used to determine the video quality.
The height of the viewport used to determine the video quality.
let meeting;
// Initialize Meeting
meeting = VideoSDK.initMeeting({
// ...
});
const agentParticipant = Array.from(meeting.participants.values()).find(
(p) => p.isAgent
);
try {
await agentParticipant.stopConsumingWebcamStreams();
} catch (err) {
console.log("Error in stopConsumingWebcamStreams", err);
}
This method can be used to unpin the agentParticipant’s camera, screen share, or both.
Every participant receives a pin-state-changed event when the pin state is updated.
Specifies which stream to unpin.
Allowed values:
"SHARE_AND_CAM" – Unpins both screen share and camera streams."CAM" – Unpins only the camera stream."SHARE" – Unpins only the screen-share stream.type
This represents the agent ID of the agentParticipant.