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.
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.
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 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 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 adding or removing the microphone, speaker, or camera.
Occurs when the SDK detects that the device permission has changed.
device type
permission state
Occurs when the encode or decode state of the media SDK changes.
Occurs when the dial-out state changes.
client.on('dialout-state-change', (payload) => {
console.log(payload.code);
});
The state code of the phone 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 the remote control app status changes
Occurs when the controlled user approved or rejected the remote control request
client.on("remote-control-approved-change", (payload) => {
if (payload.state === ApprovedState.Approved) {
stream.startRemoteControl(viewport);
}else{
// prompt a dialog to retry
}
});
Approved status
Occurs when the controlling user copies some text during the remote control period.
copyButtonElement.addEventListener("click", (event) => {
event.preventDefault();
// use copy-to-clipboard
copyToClipboard(copyButtonElement.dataset.dataContent);
});
client.on("remote-control-clipboard-change", (payload) => {
copyButtonElement.style.left = payload.x;
copyButtonElement.style.top = payload.x;
copyButtonElement.dataset.dataContent = payload.content;
});
Clipboard text content.
Error
Position X where the copy action takes place
Position y where the copy action takes place
Occurs when the remote control session status changes
Occurs when the remote sharing user can regain access to control the screen.
client.on("remote-control-in-control-change", (payload) => {
if (payload.isControlling) {
console.log("You are controlling the shared content");
} else {
console.log("You lost the control");
}
});
Whether the user is controlling the screen.
Occurs when the controlled user receives the remote control request
The user's display name.
Whether the user is sharing entire screen.
The user's ID.
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)
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 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', (payload) => {
if (payload.action === 'Start') {
stream.renderVideo(document.querySelector('#participants-canvas'), payload.userId, 960, 540, X_CORD, Y_CORD, 3)
} else if (payload.action === 'Stop') {
stream.stopRenderVideo(document.querySelector('#participants-canvas'), payload.userId)
}
})
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') {
await stream.renderVideo(canvas,userId,1280,720,0,0,3);
} else {
await stream.stopRenderVideo(canvas,userId);
}
} 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, use stream.adjustRenderedVideoPosition()
to resize the video.
client.on("video-aspect-ratio-change", async (payload) => {
const { userId, aspectRatio } = payload;
const height = width / aspectRatio;
// resize the video
await stream.adjustRenderedVideoPosition(
canvasElm,
userId,
width,
height,
x,
y
);
});
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 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.
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.
Occurs when meeting query status changes.
Occurs when smart summary status changes.
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.