millions-eye-11809
05/12/2025, 10:10 PMtall-airline-16756
05/12/2025, 10:10 PMtall-airline-16756
05/12/2025, 10:10 PMon
method with the "participant_connected" event type. Here's an example implementation:
@ctx.room.on("participant_connected")
def on_participant_connected(participant: rtc.RemoteParticipant):
<http://logger.info|logger.info>(f"new participant joined {participant.identity}")
# Add your custom logic here to handle the new participant
This registers a callback function that will be executed whenever a new participant connects to the room. The callback receives the participant
object as an argument, which is an instance of RemoteParticipant
containing information about the connected participant.
Sources: Building an Automated IVR Menu Caller | LiveKit Docs | livekit.rtc API documentationmillions-eye-11809
05/12/2025, 10:13 PMtall-airline-16756
05/12/2025, 10:13 PM@ctx.room.on("participant_connected")
async def on_participant_connected(participant: rtc.RemoteParticipant):
<http://logger.info|logger.info>(f"new participant joined {participant.identity}")
# Your async handler code here
This registers an async function as an event handler for the "participant_connected" event. When a new participant connects to the room, this function will be called with the RemoteParticipant
object as an argument, allowing you to perform asynchronous operations within the handler.
Sources: Building an Automated IVR Menu Caller | LiveKit Docs | livekit.rtc.room API documentation