caution
Leave or End Meeting
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
- JavaScript
- React
- ReactNative
- Android
- IOS
- Flutter
const onPress = () => {
// Leave Meeting
meeting?.leave();
// Exit Meeting
meeting?.end();
};
const onPress = () => {
// Leave Meeting
meeting?.leave();
// Exit Meeting
meeting?.end();
};
const onPress = () => {
// Leave Meeting
meeting?.leave();
// Exit Meeting
meeting?.end();
};
btnLeave.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
meeting.leave();
}
});
btnEnd.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
meeting.end();
}
});
@IBAction func leaveMeetingButtonTapped(_ sender: Any) {
// leave meeting
self.meeting?.leave()
// end meeting for everyone
self.meeting?.end()
}
/// Events:
// called after user leaves the meeting
func onMeetingLeft() {
// cleanup: remove listeners
meeting?.localParticipant.removeEventListener(self)
meeting?.removeEventListener(self)
// dismiss meeting controller
}
// Leave the meeting
meeting.leave();
Got a Question? Ask us on discord