What are events? #
You can set listeners to certain events within the meeting. A listener gets called when the corresponding event occurs.
xxxxxxxxxx131/** The eventName parameter is a String with the name of the event. 2 * The listener parameter is a Function object that will be notified3 * when the event occurs, with data related to the event.4 **/5
6// Triggers every time an event is emitted7meeting.on(eventName, listener);8
9// Triggers only once even if the event occurs multiple times10meeting.once(eventName, listener);11
12// Remove the listener13meeting.off(eventName, listener);
Example Usage – 1 (Single Event) #
xxxxxxxxxx191const meeting = new ClanMeeting(domain, consumerId, optionalProperties);2
3window.onload = function () {4 meeting.start();5
6 const meetingJoinedLsnr = function meetingJoinedLsnr(eventData) {7 console.log('My participant ID:', eventData.id);8
9 // Example tasks once meeting is joined10 console.log(meeting.get('allParticipants'));11 meeting.set('displayName', 'ChangedName');12 };13
14 meeting.once('meetingJoined', meetingJoinedLsnr);15};16
17window.onunload = function () {18 meeting.end();19};
Example Usage – 2 (Single Event) #
xxxxxxxxxx131const meeting = new ClanMeeting(domain, consumerId, optionalProperties);2
3window.onload = function () {4 meeting.start();5
6 meeting.once('meetingLeft', function (eventData) {7 // route to another page when user leaves the conference8 });9};10
11window.onunload = function () {12 meeting.end();13};
Example Usage – 3 (Multiple Events) #
xxxxxxxxxx321const meeting = new ClanMeeting(domain, consumerId, optionalProperties);2
3window.onload = function() {4 meeting.start();5
6 const meetingJoinedLsnr = function meetingJoinedLsnr(participant) {7 console.log('My participant ID:', participant.id);8
9 const roleChangedLsnr = function roleChangedLsnr(event) {10 if (event.role === 'moderator') {11 meeting.exec('enableLobby', true);12 }13 };14
15 // event 216 meeting.once('roleChanged', roleChangedLsnr);17
18 // event 319 meeting.on('someoneKnocked', function (data) {20 if (data.participant.name === 'Jane Doe') { 21 meeting.exec('answerKnockingParticipant', data.participant.id, true);22 }23 });24 };25
26 // event 127 meeting.once('meetingJoined', meetingJoinedLsnr);28};29
30window.onunload = function() {31 meeting.end();32};
All Events #
meetingJoined #
Joined the conference.
eventData: Object
xxxxxxxxxx61{2 roomName: string, // roomName of the conference joined3 id: string, // the id of local participant4 displayName: string, // display name of the user5 avatarURL: string, // avatar URL of the user6}
meetingLeft #
Left the conference.
eventData: Object
xxxxxxxxxx31{2 roomName: string // roomName of the conference left3}
someoneJoined #
Someone (apart from the local user) joined the conference.
eventData: Object
xxxxxxxxxx41{2 id: string, // the id of the participant3 displayName: string // the display name of the participant4}
someoneLeft #
Someone (apart from the local user) left the conference.
eventData: Object
xxxxxxxxxx31{2 id: string // the id of the participant3}
audioAvailabilityChanged #
Audio availability status changed.
eventData: Object
xxxxxxxxxx31{2 available: boolean // new available status - boolean3}
audioMuteStatusChanged #
Audio mute status changed.
eventData: Object
xxxxxxxxxx31{2 muted: boolean // new muted status - boolean3}
browserSupported #
Current browser support event notification.
eventData: Object
xxxxxxxxxx31{2 supported: boolean3}
cameraError #
Failed to access camera.
eventData: Object
xxxxxxxxxx41{2 type: string, // A constant representing the overall type of the error.3 message: string // Additional information about the error.4}
chatUpdated #
eventData: Object
xxxxxxxxxx41{2 isOpen: boolean, // Whether the chat panel is open or not3 unreadCount: number // The unread messages counter4}
dataChannelOpened #
Indicates whether a channel is opened so that data can be sent to other participants.
dataReceived #
Data received from another participant. This is different from incomingMessage as that is triggered when a chat message is received. See example here.
eventData: Object
xxxxxxxxxx101{2 senderInfo: {3 jid: string, // the jid of the sender4 id: string // the participant id of the sender5 },6 eventData: {7 name: string, // the name of the datachannel event over8 text: string // the received text from the sender9 }10}
deviceListChanged #
List of available audio/video devices changed.
eventData: Object
xxxxxxxxxx31{2 devices: Object // the new list of available devices.3}
emailChanged #
Provides event notifications about email changes.
eventData: Object
xxxxxxxxxx41{2 id: string // the id of the participant that changed his email3 email: string // the new email address4}
errorOccurred #
eventData: Object
xxxxxxxxxx71{2 details: Object?, // additional error details3 message: string?, // the error message4 name: string, // the coded name of the error5 type: string, // error type/source, one of : 'CONFIG', 'CONNECTION', 'CONFERENCE'6 isFatal: boolean // whether this is a fatal error which triggered a reconnect overlay or not7}
faceLandmarkDetected #
Provides event notifications when a face landmark is detected.
eventData: Object
xxxxxxxxxx81{2 faceBox: {3 left: number, // face bounding box distance as percentage from the left video edge4 right: number // face bounding box distance as percentage from the right video edge5 width: number // face bounding box width as percentage of the total video width6 }, // this might be undefined if config.faceLandmarks.faceCenteringThreshold is not passed7 faceExpression: string8}
filmstripDisplayChanged #
Filmstrip state updated.
eventData: Object
xxxxxxxxxx31{2 visible: boolean // Whether or not the filmstrip is displayed or hidden.3}
incomingMessage #
Incoming chat message.
eventData: Object
xxxxxxxxxx61{2 from: string, // The id of the user that sent the message3 nick: string, // the nickname of the user that sent the message4 privateMessage: boolean, // whether this is a private or group message5 message: string // the text of the message6}
micError #
Failed to access microphone.
eventData: Object
xxxxxxxxxx41{2 type: string, // A constant representing the overall type of the error.3 message: string // Additional information about the error.4}
moderationStatusChanged #
Audio/Video moderation status changed.
eventData: Object
xxxxxxxxxx41{2 mediaType: string, // The media type for which moderation changed.3 enabled: boolean // Whether or not moderation changed to enabled.4}
moderationParticipantApproved #
Audio video moderation approved for a participant.
eventData: Object
xxxxxxxxxx41{2 id: string, // The ID of the participant that got approved.3 mediaType: string // The media type for which the participant was approved.4}
moderationParticipantRejected #
Audio video moderation rejected for a participant.
eventData: Object
xxxxxxxxxx41{2 id: string, // The ID of the participant that got rejected.3 mediaType: string // The media type for which the participant was rejected.4}
notificationTriggered #
Provides event notifications when an application notification occurs.
eventData: Object
xxxxxxxxxx41{2 title: string, // The notification title.3 description: string // The notification description.4}
outgoingMessage #
Outgoing chat message.
eventData: Object
xxxxxxxxxx41{2 message: string, // the text of the message3 privateMessage: boolean // whether this is a private or group message4}
overriddenToolbarButtonClicked #
A toolbar button set with overriddenToolbarButtons property was clicked. See example implementation here.
eventData: Object
xxxxxxxxxx41{2 key: string, // the button name as defined in overriddenToolbarButtons property3 preventExecution: boolean // whether the click routine execution was prevented or not.4}
p2pStatusChanged #
Provides event notifications about changes to the connection type.
eventData: Object
xxxxxxxxxx31{2 isP2p: boolean|null // whether the new connection type is P2P3}
participantMenuButtonClicked #
Provides event notifications about a participant context menu button being clicked.
eventData: Object
xxxxxxxxxx51{2 key: string, // the pressed button's key.3 participantId: string, // the id of the participant for which the button was clicked,4 preventExecution: boolean // whether the execution of the button click was prevented or not5}
passwordRequired #
Participant encountered a password prompt.
eventData: null
readyToClose #
Conference is about to close. All hang up operations are completed.
eventData: null
recordingLinkAvailable #
Recording link became available
eventData: Object
xxxxxxxxxx41{2 link: string, // the recording link3 ttl: number // the time to live of the recording link4}
recordingStatusChanged #
Recording status changed.
eventData: Object
xxxxxxxxxx51{2 on: boolean // new recording status - boolean,3 mode: string // recording mode, `stream` or `file`,4 error: string | undefined // error type if recording fails, undefined otherwise5}
roleChanged #
Local user's role has changed (none, moderator, participant)
eventData: Object
xxxxxxxxxx41{2 id: string // the id of the participant3 role: string // the new role of the participant4}
participantsPaneToggled #
Provides event notifications that fire when the participants pane status changes.
eventData: Object
xxxxxxxxxx31{2 open: boolean // whether the pane is open or not3}
subjectChanged #
Meeting subject changed.
eventData: Object
xxxxxxxxxx31{2 subject: string // the new subject3}
screenSharingStatusChanged #
Screen sharing status changed.
eventData: Object
xxxxxxxxxx41{2 on: boolean, //whether screen sharing is on3 details: {} // about the source4}
someoneBecameDominantSpeaker #
Someone became the dominant speaker.
eventData: Object
xxxxxxxxxx31{2 id: string //participantId of the new dominant speaker3}
someoneChangedAvatar #
eventData: Object
xxxxxxxxxx41{2 id: string, // the id of the participant that changed avatar3 avatarURL: string // the new avatar URL4}
someoneChangedContentSharingStatus #
Someone switched on or turned off screen sharing. Listener receives a real-time list of all screen sharing participants.
eventData: Object
xxxxxxxxxx31{2 data: ["particId1", "particId2", ]3}
someoneChangedDisplayName #
eventData: Object
xxxxxxxxxx41{2 id: string, // the id of the participant3 displayname: string // the new display name4}
someoneKnocked #
Someone is waiting in the lobby.
eventData: Object
xxxxxxxxxx71{2 // participant that is currently knocking in the lobby3 participant: {4 id: string,5 name: string6 }7}
someoneRaisedHand #
eventData: Object
xxxxxxxxxx41{2 id: string, // participantId of the user who raises/lowers the hand3 handRaised: number // 0 when hand is lowered and the hand raised timestamp when raised.4}
someoneTookStage #
Someone took the stage view (large video).
eventData: Object
xxxxxxxxxx31{2 id: string // participant id now on the large video in the stage view.3}
someoneWasKickedOut #
eventData: Object
xxxxxxxxxx91{2 kicked: {3 id: string, // the id of the participant removed from the room4 local: boolean // whether or not the participant is the local participant5 },6 kicker: {7 id: string // the id of the participant who kicked out the other participant8 }9}
suspendDetected #
Detected suspended events in the user's computer.
eventData: null
tileViewChanged #
Tile view entered or exited
eventData: Object
xxxxxxxxxx31{2 enabled: boolean, // whether tile view is not displayed or not3}
transcribingStatusChanged #
Provides event notifications about status changes in the transcribing process.
eventData: Object
xxxxxxxxxx31{2 on: boolean,3}
transcriptionChunkReceived #
Provides event notifications about new transcription chunks being available.
eventData: Object
xxxxxxxxxx231{2 // Transcription language3 language: string,4
5 // ID for this chunk.6 messageID: string,7
8 // participant info9 participant: {10 avatarUrl: string,11 id: string12 name: string,13 },14
15 // If the transcription is final, the text will be here.16 final: string,17
18 // If the transcription is not final but has high accuracy the text will be here.19 stable: string,20
21 // If the transcription is not final but has low accuracy the text will be here.22 unstable: string,23}
videoAvailabilityChanged #
Video availability status changed.
eventData: Object
xxxxxxxxxx31{2 available: boolean // new available status - boolean3}
videoMuteStatusChanged #
Video (camera) mute status changed.
eventData: Object
xxxxxxxxxx31{2 muted: boolean // new muted status - boolean3}
videoQualityChanged #
Meeting video quality changed.
eventData: Object
xxxxxxxxxx31{2 videoQuality: number // the height of the new changed (new) resolution3}
whiteboardStatusChanged #
Provides event notifications about changes to the whiteboard.
eventData: Object
xxxxxxxxxx31{2 status: string // new whiteboard status3}
