flaky-fireman-59783
07/31/2025, 12:42 PMtall-airline-16756
07/31/2025, 12:42 PMtall-airline-16756
07/31/2025, 12:43 PMparticipant_disconnected event on the room object.
Here is an example of how you can use this event:
def _on_participant_disconnected(_: rtc.Participant, fut=room_empty_future):
if len(ctx.room.remote_participants) == 0 and not fut.done():
fut.set_result(None)
ctx.room.on("participant_disconnected", _on_participant_disconnected)
This event is triggered when a participant disconnects from the room, which can happen for various reasons such as calling Room.disconnect(), server-initiated actions like room deletion, or participant removal.
Let me know if you need further clarification or assistance with implementing this!
Sources: Pipeline nodes and hooks | LiveKit Docs | examples/voice_agents/realtime_joke_teller.py | Connecting to LiveKit | LiveKit Docs