I want to detect when the user in the current client leaves the meeting by clicking on the red button. I’ve tried these two handlers, but onUserLeave never fires and onMeetingStatus fires only on initing, not closing:
ZoomMtg.inMeetingServiceListener('onUserLeave', function (data) {
console.log(data);
});
ZoomMtg.inMeetingServiceListener('onMeetingStatus', function (data) {
// {status: 1(connecting), 2(connected), 3(disconnected), 4(reconnecting)}
console.log(data);
});
Which version?
WebSDK 1.90
Device (please complete the following information):
Thank you for reaching out to the Zoom Developer Forum. Good question! The onUserLeave event will only fire for users that are not the host as when the host ends the meeting, the page redirects before it has a chance to fire.
The same is true when it comes to onMeetingStatus. For participants of the meeting, you’ll see this event fire. However, the host won’t see this event fire before the page redirects at the end of the meeting.
You can use these methods to detect when a user leaves it just may not work for the host. When it comes to the host, you may want to look into the meeting.started or meeting.participant_joined webhooks.
I’m glad to hear you found a solution that works for you! If you would like this feature to be considered for a future release, I recommend posting in the #feature-requests category.