Skip to main content
Delegate methods for participant events. Since Participant inherits from MulticastDelegate, you can call add(delegate:) on any Participant to register multiple delegates.
To ensure each participant’s delegate is registered, look through room.localParticipant and room.remoteParticipants on connect and register delegates on new participants inside RoomDelegate.room(_:participantDidConnect:).

Usage

class MyViewController: UIViewController, ParticipantDelegate {
    func setupParticipant(_ participant: Participant) {
        participant.add(delegate: self)
    }
    
    func participant(_ participant: Participant, didUpdateIsSpeaking isSpeaking: Bool) {
        print("\(participant.name) is \(isSpeaking ? "speaking" : "silent")")
    }
}

Participant Events

participant(_:didUpdateMetadata:)
optional
Participant metadata has updated.Works for both LocalParticipant and RemoteParticipant.
func participant(_ participant: Participant, didUpdateMetadata metadata: String?)
participant(_:didUpdateName:)
optional
Participant name has updated.Works for both LocalParticipant and RemoteParticipant.
func participant(_ participant: Participant, didUpdateName name: String)
participant(_:didUpdateIsSpeaking:)
optional
The speaking status of a participant has changed.Works for both LocalParticipant and RemoteParticipant.
func participant(_ participant: Participant, didUpdateIsSpeaking isSpeaking: Bool)
participant(_:didUpdateState:)
optional
Participant state has updated.Works for both LocalParticipant and RemoteParticipant.
func participant(_ participant: Participant, didUpdateState state: ParticipantState)
participant(_:didUpdateConnectionQuality:)
optional
Connection quality of a participant has updated.Works for both LocalParticipant and RemoteParticipant.
func participant(_ participant: Participant, didUpdateConnectionQuality connectionQuality: ConnectionQuality)
participant(_:didUpdatePermissions:)
optional
Participant permissions have updated.
func participant(_ participant: Participant, didUpdatePermissions permissions: ParticipantPermissions)
participant(_:didUpdateAttributes:)
optional
Participant attributes have updated.
func participant(_ participant: Participant, didUpdateAttributes attributes: [String: String])

Track Publication Events

participant(_:trackPublication:didUpdateIsMuted:)
optional
Muted state has updated for a track publication.For LocalParticipant, this is called when setMute is called on LocalTrackPublication, or if the server has requested the participant to be muted.
func participant(_ participant: Participant, trackPublication: TrackPublication, didUpdateIsMuted isMuted: Bool)
participant(_:trackPublication:didReceiveTranscriptionSegments:)
optional
Received transcription segments for a track.
func participant(_ participant: Participant, trackPublication: TrackPublication, didReceiveTranscriptionSegments segments: [TranscriptionSegment])

Local Participant Events

participant(_:didPublishTrack:)
optional
The local participant has published a track.
func participant(_ participant: LocalParticipant, didPublishTrack publication: LocalTrackPublication)
participant(_:didUnpublishTrack:)
optional
The local participant has unpublished a track.
func participant(_ participant: LocalParticipant, didUnpublishTrack publication: LocalTrackPublication)
participant(_:remoteDidSubscribeTrack:)
optional
Fired when the first remote participant has subscribed to the local participant’s track.
func participant(_ participant: LocalParticipant, remoteDidSubscribeTrack publication: LocalTrackPublication)
participant(_:didMoveToRoomNamed:)
optional
The local participant was moved to a different room.
func participant(_ participant: LocalParticipant, didMoveToRoomNamed roomName: String)

Remote Participant Events

participant(_:didPublishTrack:)
optional
A new remote track publication was published to the room after the local participant has joined.
This delegate method will not be called for tracks that are already published when you join.
func participant(_ participant: RemoteParticipant, didPublishTrack publication: RemoteTrackPublication)
participant(_:didUnpublishTrack:)
optional
The remote participant has unpublished a track.
func participant(_ participant: RemoteParticipant, didUnpublishTrack publication: RemoteTrackPublication)
participant(_:didSubscribeTrack:)
optional
The local participant has subscribed to a new remote track.This event will always fire as long as new tracks are ready for use.
func participant(_ participant: RemoteParticipant, didSubscribeTrack publication: RemoteTrackPublication)
participant(_:didUnsubscribeTrack:)
optional
Unsubscribed from a remote track publication and it is no longer available.Clients should listen to this event and handle cleanup.
func participant(_ participant: RemoteParticipant, didUnsubscribeTrack publication: RemoteTrackPublication)
participant(_:didFailToSubscribeTrackWithSid:error:)
optional
Could not subscribe to a track.This is an error state; the subscription can be retried.
func participant(_ participant: RemoteParticipant, didFailToSubscribeTrackWithSid trackSid: Track.Sid, error: LiveKitError)
participant(_:trackPublication:didUpdateStreamState:)
optional
Stream state has updated for a remote track publication.
func participant(_ participant: RemoteParticipant, trackPublication: RemoteTrackPublication, didUpdateStreamState streamState: StreamState)
participant(_:trackPublication:didUpdateIsSubscriptionAllowed:)
optional
Subscription permission has updated for a remote track publication.
func participant(_ participant: RemoteParticipant, trackPublication: RemoteTrackPublication, didUpdateIsSubscriptionAllowed isSubscriptionAllowed: Bool)

Data Events

participant(_:didReceiveData:forTopic:encryptionType:)
optional
Data was received from a remote participant.
func participant(_ participant: RemoteParticipant, didReceiveData data: Data, forTopic topic: String, encryptionType: EncryptionType)

Build docs developers (and LLMs) love