Leave or End Meeting - Javascript
Whenever participant wishes to end their communication in the meeting, they can simply leave the meeting.
This guide will provide an overview of how to implement leave or end feature in VideoSDK meetings.
- Leave - By using
leave()
function, only a participant will leave/exit the meeting, the rest of the meeting will continue with other participants. - 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 = () => {
// Leave Meeting
meeting?.leave();
// Exit Meeting
meeting?.end();
};
Events
Events associated with leave()
:
- Local participant will receive a
meeting-left
event. - All remote participants will receive a
participant-left
event withparticipantId
.
Event associated with end()
:
- All participants and localParticipant, will be emitted with
meeting-left
event.
meeting.on("meeting-left", () => {
//Meeting Left
});
meeting.on("participant-left", (participant) => {
//Participant Left the meeting
});
Got a Question? Ask us on discord