participantLeft
When a participant exits the meeting this event is emitted
This event is emitted to all other participants in the meeting when the participant exits the meeting.
JavaScript
meeting.on("participantLeft", function(participantInfo) {
console.log("participant has left the room", participantInfo);
});
Properties
participantInfo
is an object that contains the following properties:
Properties | Description | Type |
---|---|---|
isAdmin | indicates whether the user is admin or not | boolean |
meetingSessionId | id of the current meeting session | string |
name | username of the user who has left the meeting | string |
roomId | id of the current meeting room | string |
_id | participant session id of the user who has left the meeting | string |
email of the participant if specified | string | |
externalUserId | externalUserId of the participant if specified | string |
meta | meta of the participant if specified | string |
Example
JavaScript
meeting.on("participantLeft", function(participantInfo) {
console.log("participant has left the room", participantInfo);
// Just interating over all the video tags associate with the participant
// and remove them
Array.from(document.getElementsByClassName(participantInfo._id)).forEach(
function(element) {
element.remove();
});
});