Remove Participant - Android
This feature in a meeting allows the meeting host or organizer to remove a participant from the meeting. This can be helpful in situations where a participant is causing a disturbance, is behaving inappropriately, or is not following meeting guidelines.
VideoSDK provide three ways to remove participant from meeting.
1. Using SDK​
remove()
​
Remove participant allows removing participant while session is on-going. This can be helpful when moderation in particular meeting is required.
- Kotlin
- Java
btnRemoveParticipant!!.setOnClickListener { _: View? ->
val remoteParticipantId = "<participant-id>"
// Get specific participant instance
val participant = meeting!!.participants[remoteParticipantId]
// Remove participant from active session
// This will emit an event called "onParticipantLeft" for that particular participant
participant!!.remove()
}
btnRemoveParticipant.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
String remoteParticipantId = "<participant-id>";
// Get specific participant instance
Participant participant = meeting.getParticipants().get(remoteParticipantId);
// Remove participant from active session
// This will emit an event called "onParticipantLeft" for that particular participant
participant.remove();
}
});
Events associated with remove​
Following callbacks are received when a participant is removed from the meeting.
- Participant who was removed from the meeting will receive a callback on
onMeetingLeft
. - All other remote participants will receive a callback
onParticipantLeft
with Participant object.
2. Using VideoSDK Dashboard​
- You can go the session page on VideoSDK Dashboard and select the meeting you can to remove a participant from.
- And then from the participants list you can remove any participant you want.
3. Using Rest API​
- You can also remove the particular participant from the meeting using the REST API.
- To use this method, you should have the
sessionId
of the meeting andparticipantId
of the participant who is supposed to be removed.
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