abundant-father-33863
06/04/2025, 2:45 PMtall-airline-16756
06/04/2025, 2:46 PMtall-airline-16756
06/04/2025, 2:46 PMRoomDelegate protocol and use the room(_:participantDidDisconnect:) method. For example: func room(_ room: Room, participantDidDisconnect participant: RemoteParticipant) {
// Handle participant disconnection
}
• Flutter SDK: Listen for the ParticipantDisconnectedEvent emitted by the Room class when a RemoteParticipant leaves the room.
• Android SDK: Listen for the ParticipantDisconnected event which is triggered when a RemoteParticipant leaves after the local participant has joined.
Each of these methods provides access to the RemoteParticipant object that has disconnected, allowing you to identify which participant left the room. Let me know if you need further assistance! Sources: room(_:participantDidDisconnect:) | Documentation | ParticipantDisconnectedEvent class - livekit_client library - Dart API | RoomEventabundant-father-33863
06/04/2025, 2:48 PMtall-airline-16756
06/04/2025, 2:48 PMCLIENT_INITIATED - The client initiated the disconnect.
• DUPLICATE_IDENTITY - Another participant with the same identity joined the room.
• SERVER_SHUTDOWN - The server instance is shutting down.
• PARTICIPANT_REMOVED - RoomService.RemoveParticipant was called.
• ROOM_DELETED - RoomService.DeleteRoom was called.
• STATE_MISMATCH - Client attempting to resume a session the server isn’t aware of.
• JOIN_FAILURE - Client was unable to connect fully.
Here’s an example of how you might use this in your code:
# Example to check disconnection reason
if participant.disconnect_reason:
print(f"Participant {participant.identity} disconnected due to: {participant.disconnect_reason}")
Let me know if you need further clarification or additional examples! Sources: livekit.rtc.participant API documentationabundant-father-33863
06/04/2025, 2:49 PMtall-airline-16756
06/04/2025, 2:49 PM