Define error types of operations.
closed
: The meeting is not joined.on hold
: You are on hold.reconnecting
: The meeting is reconnecting.The result of asynchronous operation. It is a promise object.
.catch(error=>{})
or try{ *your code* }catch(error){}
to handle the errors.Reason of the meeting reconnecting
on hold
: From on hold to into meeting.failover
: Remote server disconnect unexpectedly.promote
|depromote
: From attendee to panelist and vice versa.Occurs when some participant is start sharing screen
client.on('active-share-change',payload=>{
if(payload.state==='Active'){
stream.startRenderScreenShare(payload.userId,canvas);
}else if(payload.state==='Inactive'){
stream.stopRenderScreenShare();
}
})
Occurs when some participants in meeting are talking
client.on('active-speaker', (payload) => {
console.log(`Active user:`,payload);
});
active user
Occurs when host ask you to unmute audio.
the event detail
Spotlight
: Host spotlighted you, and if you are muted, you will receive the consent.Unmute
: Host ask you to unmute audio.Allow to talk
: You are an attendee of a webinar, the host allowed you to talk.client.on('unmute-audio-consent', (payload) => {
console.log(payload.reason);
});
Occurs when the host change the privilege of chat
the event detail
client.on('chat-privilege-change',payload=>{
console.log(payload.chatPrivilege);
})
Occurs when receive a chat
the event detail
client.on('chat-on-message',payload=>{
console.log('from %s, message:%s',payload.sender.name,payload.message);
})
Occurs when the connection is changed.
The event detail.
Occurs when current audio is changed
the event detail
join
: Join the audio. refer to the type
attribute get the detail.leave
: Leave the audio.muted
: Audio muted, refer to the source
attribute get the detail.unmuted
: Audio unmuted,refer to the source
attribute get the detail.phone
: Join by the phone.active
: User active action.passive(mute all)
: Muted due to the host muted all.passive(mute one)
: Muted due to the host muted you.passive
: Umnuted due to the host unmuted you.client.on('current-audio-change', (payload) => {
if(payload.action==='join'){
console.log('Joined by ',payload.type);
}
});
Occurs when add or remove the microphone/speaker/camera
Occurs when the encode or decode state of media sdk changes
Occurs when current sharing is passively stopped.
Occurs when some participant starts or stops screen share.
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`);
}
})
Occurs when other participants start/stop video
Occurs when received shared content automatically changed
Occurs when shared content dimension change
client.on('share-content-dimension-change',payload=>{
viewportElement.style.width = `${payload.width}px`;
viewportElement.style.height = `${payload.height}px`;
})
Occurs when the host change the share privilege
Occurs when new participant join the meeting
client.on('user-added',(payload)=>{
// You can refresh the participants when
const participants = client.getParticipantsList();
})
The event detail
Occurs when the participants leave the meeting
The event detail
Occurs when the properties of the participants updated.
The event detail
Occurs when remote video stream changes.
client.on('video-active-change', async(payload) => {
try {
if (payload.state === 'Active') {
await stream.startRenderVideo(canvas, quality, payload.id, '');
} else {
await astream.stopRenderVideo();
}
} catch (error) {
console.log(error);
}
});
The event detail
Occurs when 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
Occurs when received video content dimension change
client.on('video-dimension-change', payload=>{
viewportElement.style.width = `${payload.width}px`;
viewportElement.style.height = `${payload.height}px`;
})
Occurs when the SDK try to auto play audio failed. It may occur invoke stream.joinComputerAudio() immediately after join the meeting.
client.on('auto-play-audio-failed',()=>{
console.log('auto play audio failed, waiting user's interaction');
})
Generated using TypeDoc
Reason of the meeting closed
kicked by host
: Been kicked by the host.ended by host
: The meeting is ended by the hose.expeled by host
: Been expeled by the host.