Skip to main content
Version: 1.x.x

Leave or End Meeting - Javascript

Whenever participant wishes to end their communication in the meeting, they can simply leave the meeting.

note

This page uses the following asynchronous methods. Refer to their API reference for the errors each Promise may reject with, and handle these rejections appropriately based on your use case.

This guide will provide an overview of how to implement leave or end feature in VideoSDK meetings.

  1. Leave - By using leave() function, only a participant will leave/exit the meeting, the rest of the meeting will continue with other participants.
  2. End - By using end() function, meeting will end for each and every participant. So, use this function according to your use cases.

Leave And End Meeting

const onPress = async () => {
// Leave Meeting
try {
await meeting?.leave();
} catch (err) {
console.error("leave failed:", err);
}

// Exit Meeting
try {
await meeting?.end();
} catch (err) {
console.error("end failed:", err);
}
};

Events

Events associated with leave():

Event associated with end():

meeting.on("meeting-left", () => {
//Meeting Left
});

meeting.on("participant-left", (participant) => {
//Participant Left the meeting
});

Got a Question? Ask us on discord