Leave or End Meeting - Android
Participant can choose to leave the meeting without removing all the other participants. This is typically done by Leave Meeting
.
Alternatively, if the participant is the host and the last person remaining in the session, they can choose End Meeting
by removing all other participants, which will end the session for everyone.
leave()
To leave the meeting without removing all the participant you need to call leave()
method of Meeting
class.
end()
To leave the meeting by removing all the participant you need to call end()
method of Meeting
class.
This methods can be called after the meeting is joined successfully.
Example
- Kotlin
- Java
btnLeave!!.setOnClickListener { _: View? ->
meeting!!.leave() // Leaving Meeting
}
btnEnd!!.setOnClickListener { _: View? ->
meeting!!.end() // Ending Meeting
}
btnLeave.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
meeting.leave(); // Leaving Meeting
}
});
btnEnd.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
meeting.end(); // Ending Meeting
}
});
Events associated with Leave
Following callbacks are received when a participant leaves the meeting.
- Local Participant will receive a callback
onMeetingLeft
. - All remote participants will receive a callback
onParticipantLeft
with Participant object.
Events associated with End
Following callbacks are received when a participant ends the meeting.
- All remote participants and local participant will receive a callback on
onMeetingLeft
ofMeetingEventListener
class.
- Kotlin
- Java
private final MeetingEventListener meetingEventListener = new MeetingEventListener() {
//Event to know meeting is left
override fun onMeetingLeft() {
Log.d("#VideoSDK", "onMeetingleft()")
}
//Event to know some other participant left
override fun onParticipantLeft(participant: Participant) {
Log.d("#VideoSDK", participant.displayName + " left");
}
}
private final MeetingEventListener meetingEventListener = new MeetingEventListener() {
//Event to know meeting is left
@Override
public void onMeetingLeft() {
Log.d("#VideoSDK", "onMeetingleft()")
}
//Event to know some other participant left
@Override
public void onParticipantLeft(Participant participant) {
Log.d("#VideoSDK", participant.getDisplayName() + " left");
}
}
API Reference
The API references for all the methods and events utilised in this guide are provided below.
Got a Question? Ask us on discord