Skip to main content

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:

PropertiesDescriptionType
isAdminindicates whether the user is admin or notboolean
meetingSessionIdid of the current meeting sessionstring
nameusername of the user who has left the meetingstring
roomIdid of the current meeting roomstring
_idparticipant session id of the user who has left the meetingstring
emailemail of the participant if specifiedstring
externalUserIdexternalUserId of the participant if specifiedstring
metameta of the participant if specifiedstring

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();
});
});