Definition of error types for operations.
closed
: The meeting is not joined.on hold
: The user is on hold.reconnecting
: The meeting is reconnecting.The result of an asynchronous operation. It is a promise object.
.catch(error=>{})
or try{ *your code* }catch(error){}
to handle the errors.File transfer cancel function
Local camera control command.
Log level object
debug
error
info
log
warn
Log level
Mask clip.
Mask shape.
Processor type
Occurs when some participants in the session are talking.
client.on('active-speaker', (payload) => {
console.log(`Active user:`,payload);
});
Active user.
Occurs when the audio statistics data is changed; decode (received).
The event detail.
data
encoding
: If encoding is true, the following metrics stand for the Send data statistics, otherwise, it stands for the Receive data statistics.avg_loss
: Audio's average package loss.jitter
: Audio's jitter.max_loss
: Audio's maximum package loss.rtt
: Audio's round trip time.sample_rate
: Audio's sample rate.type
: String AUDIO_QOS_DATA
client.on('audio-statistic-data-change', (payload) => {
console.log('emit', payload);
});
Data
Audio's Average package loss.
Bandwidth, measured in bits per second (bps)
Bit rate, measured in bits per second (bps)
If encoding is true, the following metrics stand for the Send data statistics, otherwise, it stands for the Receive data statistics.
Audio's jitter.
Audio's maximum package loss.
Audio's round trip time.
Audio's sample rate.
Type.
Occurs when the SDK tried and failed to auto play audio. This may occur when invoking stream.startAudio()
immediately after joining the session.
client.on('auto-play-audio-failed',()=>{
console.log('auto play audio failed, waiting user's interaction');
})
Occurs when current audio is changed.
The event detail.
join
: Join audio. Refer to the type
attribute for details.leave
: Leave audio.muted
: Audio muted, refer to the source
attribute for details.unmuted
: Audio unmuted, refer to the source
attribute for details.phone
: Join by phone.active
: User active action.passive(mute all)
: Muted due to the host muting all.passive(mute one)
: Muted due to the host muting you.passive
: Umnuted due to the host unmuting you.client.on('current-audio-change', (payload) => {
if(payload.action==='join'){
console.log('Joined by ',payload.type);
}
});
The current audio change action.
If the action is muted, an extra field to show the muted source.
Type of audio.
Occurs when the current audio volume changes.
Volume level,range from 0 to 9.
Occurs when the host asks you to unmute audio.
The event detail.
Spotlight
: Host spotlighted you. If you are muted, you will receive the consent message.Unmute
: Host asks you to unmute audio.Allow to talk
: You are an attendee of a webinar, the host allowed you to talk.client.on('host-ask-unmute-audio', (payload) => {
console.log(payload.reason);
});
The unmute consent reason.
Occurs when the share audio state changes. Usually used to cooperatively change the state of computer audio.
The state of the Chrome browser shared tab audio.
Occurs when the CRC (Cloud Room Connector) device call state changes.
client.on('crc-call-out-state-change', (payload) => {
console.log(payload.code);
});
CRC call return code
IP address
Protocol
Unique ID for the call
Occurs when camera capability changes.
Capabilities of Pan-Tilt-Zoom (PTZ) camera.
User ID.
Occurs when the camera in control status changes.
The event detail.
Is controlled by other user.
User ID.
Occurs when the SDK received the far end camera request.
the event detail
The display name who is controlling the camera.
The user ID who is controlling the camera.
The display name who requested control.
The user ID who requested control.
Occurs when the SDK received the far end camera response.
The event detail.
Display name.
Is approved.
Reason for refusal.
User ID.
Occurs when the download file progress changes
File Blob, only available when the blob
is set to true
in the downloadFile
method.
File name
File size
File URL
Message ID
Upload progress
Sender user unified ID.
Sender user ID
Upload status
Occurs when the upload file progress has changed
File name
File size
Upload progress
Receiver user unified ID.
Receiver user ID
Retry token, can be used for re-sending file.
Upload status
Occurs when the host changes the chat privileges.
The event detail.
client.on('chat-privilege-change',payload=>{
console.log(payload.chatPrivilege);
})
Chat privilege.
Occurs when receiving a chat.
The event details.
client.on('chat-on-message',payload=>{
console.log('from %s, message:%s',payload.sender.name,payload.message);
})
Occurs when command channel receives a message.
The event details.
client.on('command-channel-message',payload=>{
console.log('from %s, message:%s',payload.senderId, payload.text, payload.timestamp);
})
Message ID.
Sender's user ID.
Sender's display name.
Message content.
Timestamp.
Occurs when the command channel status changes.
client.on('command-channel-status',payload=>{
console.log('from %s, message:%s',payload);
})
Occurs when live stream status changes.
Occurs if the automatic live transcription enable status changes.
Occurs when the host disables caption.
boolean
Occurs when the SDK receives the live transcription, live translation, or manual captions message.
the event detail
client.on('caption-message',payload=>{
console.log(payload);
})
Occurs when the live transcription status changes.
the event detail
client.on('caption-status',payload=>{
console.log(payload);
})
Is auto caption enabled.
Language code.
Occurs when there is a media internal error, such as an unexpected interruption in media capture or insufficient memory. When receiving this event, we recommend refreshing the page or restarting the browser to resolve the issue. Since the user must do this, we recommend that you provide a popup to guide the user, such as 'We detected an issue with the media stream that we cannot resolve. Please refresh the page to try to fix it.' With two buttons: 'Refresh' and 'Cancel'.
Code
Message
Type
Occurs when adding or removing the microphone, speaker, or camera.
Chrome browser on Android devices does not trigger the device-change
event when the headset is plugged in or unplugged. See browser compatibility: https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/devicechange_event#browser_compatibility.
Occurs when the SDK detects that the device permission has changed.
device type
permission state
Occurs when the dial-out state changes.
client.on('dialout-state-change', (payload) => {
console.log(payload.code);
});
The state code of the phone call.
Phone number
Phone user ID
Unique ID for the call
Occurs when the individual cloud recording status changes.
The individual recording status.
state
The user ID being recorded.
Occurs when the cloud recording status changes.
The recording status.
Recording status.
Occurs when some participant starts screen sharing.
client.on('active-share-change',payload=>{
if(payload.state==='Active'){
stream.startShareView(canvas,payload.userId);
}else if(payload.state==='Inactive'){
stream.stopShareView();
}
})
Sharing state.
User ID of active share.
Occurs when current sharing is passively stopped.
Occurs when some participant starts or stops screen sharing.
client.on('peer-share-state-change',payload=>{
if(payload.action==='Start'){
console.log(`user:${payload.userId} starts share`);
}else if(payload.action==='Stop'){
console.log(`user:${payload.userId} stops share`);
}
})
Peer share action.
User ID.
Occurs when the requestReadReceipt
option is true in the startShareScreen
method. The sharer can receive the event if someone can see the shared screen.
Occurs when received shared content automatically changes.
User ID currently receiving sharing.
Occurs when shared content dimensions change.
client.on('share-content-dimension-change',payload=>{
viewportElement.style.width = `${payload.width}px`;
viewportElement.style.height = `${payload.height}px`;
})
Height.
Values: sended: current share; received: others' share.
Width.
Occurs when the host changes the share privileges.
Share privilege.
Occurs when the share statistics data is changed during decoding (received) or encoding (sent)
the event detail
data
encoding
: If encoding is true, the following metrics stand for the Send data statistics, otherwise, it stands for the Receive data statistics.avg_loss
: average package loss for videojitter
: jitter for videomax_loss
: max package loss for videortt
: round trip time for videosample_rate
: sample rate videowidth
: width for videoheight
: height for videofps
: Frames per second (FPS) for videotype
: string "VIDEOSHARE_QOS_DATA"client.on('share-statistic-data-change', (payload) => {
console.log('emit', payload);
});
Quality of Service (QoS) data.
Share's average package loss. (On Safari or Firefox, this value is always 0)
Bandwidth, measured in bits per second (bps)
Bit rate, measured in bits per second (bps)
If encoding is true, the following metrics stand for the Send data statistics, otherwise, it stands for the Receive data statistics.
Share's frame rate in frames per second (FPS).
Share's resolution height.
Share's jitter. (On Safari or Firefox, this value is always 0)
Share's maximum package loss. (On Safari or Firefox, this value is always 0)
Share's round trip time. (On Safari or Firefox, this value is always 0)
Share's sample rate. (On Safari or Firefox, this value is always 0)
Share's resolution width.
Occurs when the connection is changed.
The event detail.
Occurs when a new participant joins the session.
client.on('user-added',(payload)=>{
// You can refresh the participants when
const participants = client.getParticipantsList();
})
The event detail.
Occurs when the participant leaves the session.
The event detail
Occurs when the properties of the participant are updated.
The event detail
Occurs when the host receives a request for help from a user in a subsession.
User's display name.
Subsession ID.
Subsession name.
User ID of the user who requested help.
Occurs when the attendee received the response for the request for help.
The response for the request for help.
Occurs when the host broadcasts content to all in the subsession.
Broadcast message.
Occurs when there is a buffer countdown when the subsession is about to be closed. This event will be triggered every second until the countdown is over.
Countdown for closing the subsession.
Occurs when the host assigns you to a subsession. You can decide whether to join the subsession or not.
Use SubsessionClient.joinSubsession(subsessionId)
to join the subsession.
Subsession ID.
Subsession name.
Occurs when the host is in the subsession and the main session user changed.
Occurs when the subsession has a countdown. This event will be triggered every second until time is up.
Countdown for subsession.
Occurs when the status of the subsession changes.
Subsession's status.
Occurs when the countdown is over.
Occurs when the broadcasted voice's status changes.
Whether the user is receiving the broadcasted voice.
Occurs when the user is invited to back to the main session.
Inviter user GUID
Inviter user ID
Inviter name
Occurs when there is a change in the status of users in the subsession.
User's audio state.
Whether the sharer is also sharing the tab audio.
Whether the user started video.
Whether the user is talking.
Whether audio is muted.
Whether the user started sharing.
Subsession ID
Subsession name
User GUID
User ID
Occurs when network quality changes. The network quality reflects the video quality, so only when the user starts video, the data will broadcast to all users.
the network quality
Level 0,1: bad 2: normal 3,4,5: good
Uplink or downlink.
User ID.
Occurs when other participants start or stop video.
client.on("peer-video-state-change", async (payload) => {
if (payload.action === "Start") {
const element = await stream.attachVideo(userId, VideoQuality.Video_720P);
container.appendChild(element);
} else if (payload.action === "Stop") {
const elements = await stream.detachVideo(userId);
if (Array.isArray(elements)) {
elements.forEach((e) => e.remove());
} else {
elements.remove();
}
}
});
Action of the peer video, Start
or Stop
.
User ID.
Occurs when the remote video stream changes.
client.on("video-active-change", async (payload) => {
try {
if (payload.state === "Active") {
const element = await stream.attachVideo(userId, VideoQuality.Video_720P);
container.appendChild(element);
} else {
const elements = await stream.detachVideo(userId);
if (Array.isArray(elements)) {
elements.forEach((e) => e.remove());
} else {
elements.remove();
}
}
} catch (error) {
console.log(error);
}
});
The event detail.
Active video state.
User ID.
Occurs when the SDK detects that the rendered video aspect ratio is not the same as the actual video aspect ratio.
To correct the aspect ratio, update aspect-ratio
CSS style to correct the ratio.
client.on("video-aspect-ratio-change", (payload) => {
const { userId, aspectRatio } = payload;
const videoPlayerElement = // look up the video-player element by userId
videoPlayerElement.style.aspectRatio = aspectRatio;
});
Aspect ratio.
User ID.
Occurs when the local video capture stream changes.
client.on('video-capturing-change', (payload) => {
try {
if (payload.state === 'Started') {
console.log('Capture started');
} else if (payload.state === 'Stopped') {
console.log('Capture stopped');
} else {
console.log('Stop capturing Failed');
}
} catch (error) {
console.log(error);
}
});
The event detail.
Video capture state.
Occurs on video cell statistic data changes.
Video frame rate in frames per second.
Video resolution height.
Video quality.
User ID.
Video resolution width.
Occurs when the received video content dimension changes.
client.on('video-dimension-change', payload=>{
viewportElement.style.width = `${payload.width}px`;
viewportElement.style.height = `${payload.height}px`;
})
Height.
Type: Received video.
Width.
Occurs when the host or manager spotlights a user.
client.on('video-spotlight-change', (payload) => {
console.log(payload.spotlightList);
});
spotlighted user list
Occurs when the video statistics data is changed; decode (received).
The event detail
data
encoding
: If encoding is true, the following metrics stand for the Send data statistics, otherwise, it stands for the Receive data statistics.avg_loss
: Video's average package loss.jitter
: Video's jitter.max_loss
: Video's maximum package loss.rtt
: Video's round trip time.sample_rate
: Video's sample rate.width
: Video's width.height
: Video's height.fps
: Video's frame rate in frames per second (FPS).type
: String VIDEO_QOS_DATA
client.on('video-statistic-data-change', (payload) => {
console.log('emit', payload);
});
Data.
Video's average package loss.
Bandwidth, measured in bits per second (bps)
Bit rate, measured in bits per second (bps)
If encoding is true, the following metrics stand for the Send data statistics, otherwise, it stands for the Receive data statistics.
Video's frame rate in frames per second (FPS).
Video's resolution height.
Video's jitter.
Video's maximum package loss.
Video's round trip time.
Video's sample rate.
Video's resolution width.
Type.
Occurs when the virtual background (VB) is enabled and the VB model is loaded.
Is ready to apply the virtual background.
Registers a custom video processor class.
Note: Only available in the processor worker.
The name of the processor
The processor class
Occurs when someone in the meeting takes a screenshot of the screen share
The display name of the user who took the screenshot
The user ID of the user who took the screenshot
Occurs when someone in the meeting takes a screenshot of the video
The display name of the user who took the screenshot
The user ID of the user who took the screenshot
Reason for closing the meeting.
kicked by host
: User kicked off by the host.ended by host
: Meeting ended by the host.expeled by host
: User expeled by the host.