Skip to main content
Version: 2.x.x

Leave or End Room - Flutter

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

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

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

Leave And End Room​

// Leave the room
room.leave();

// End Room Session
room.end();

Events​

Events associated with leave():

  • Local participant will receive a roomLeft event.
  • All remote participants will receive a participantLeft event with participantId.

Event associated with end():

room.on(Events.roomLeft, () => {
//room Left
});

room.on(Events.participantLeft, (participant) => {
//Participant Left the room
});

Got a Question? Ask us on discord


Was this helpful?