how do i check if participant is discounted
# ask-ai
e
how do i check if participant is discounted
t
Thanks for reaching out, Shehryar. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
To check if a participant is disconnected in LiveKit, you can use event handling specific to the SDK you are using: • Android SDK: Listen for the
ParticipantDisconnected
event. For example:
Copy code
// This event is fired when a RemoteParticipant leaves after the local participant has joined
class ParticipantDisconnected(val room: Room, val participant: RemoteParticipant) : RoomEvent
Swift SDK: Implement the
RoomDelegate
method:
func room(_ room: Room, participantDidDisconnect participant: RemoteParticipant)
Unity SDK: Use the `ParticipantDisconnectedDelegate`:
public delegate void ParticipantDisconnectedDelegate(RemoteParticipant participant);
These events or delegates will automatically trigger when a participant disconnects, allowing your application to handle the situation accordingly. Sources: RoomEvent | ParticipantDisconnected | room(_:participantDidDisconnect:) | Documentation | Delegate Room.ParticipantDisconnectedDelegate | LiveKit Unity SDK