LiveKit Swift Client SDK Documentation

Class Observable​Room

open class ObservableRoom: ObservableObject, RoomDelegate, Loggable  
%401 ObservableRoom ObservableRoom Loggable Loggable ObservableRoom->Loggable RoomDelegate RoomDelegate ObservableRoom->RoomDelegate ObservableObject ObservableObject ObservableRoom->ObservableObject

Conforms To

Loggable

Allows to extend with custom log method which automatically captures current type (class name).

RoomDelegate

RoomDelegate receives room events as well as Participant events.

ObservableObject

Initializers

init(_:​)

public init(_ room: Room = Room())  

Properties

room

public let room: Room

remote​Participants

public var remoteParticipants: OrderedDictionary<Sid, ObservableParticipant>  

all​Participants

public var allParticipants: OrderedDictionary<Sid, ObservableParticipant>  

camera​Track​State

@Published public var cameraTrackState: TrackPublishState  

microphone​Track​State

@Published public var microphoneTrackState: TrackPublishState  

screen​Share​Track​State

@Published public var screenShareTrackState: TrackPublishState  

Methods

switch​Camera​Position()

@discardableResult
    public func switchCameraPosition() -> Promise<Bool>  

toggle​Camera​Enabled()

public func toggleCameraEnabled()  

toggle​Screen​Share​Enabled()

public func toggleScreenShareEnabled()  

toggle​Microphone​Enabled()

public func toggleMicrophoneEnabled()  

room(_:​did​Update:​old​Value:​)

open func room(_ room: Room, didUpdate connectionState: ConnectionState, oldValue: ConnectionState)  

room(_:​participant​Did​Join:​)

open func room(_ room: Room,
                   participantDidJoin participant: RemoteParticipant)  

room(_:​participant​Did​Leave:​)

open func room(_ room: Room,
                   participantDidLeave participant: RemoteParticipant)  

room(_:​did​Connect:​)

open func room(_ room: Room, didConnect isReconnect: Bool)  

room(_:​did​Fail​ToConnect:​)

open func room(_ room: Room, didFailToConnect error: Error)  

room(_:​did​Disconnect:​)

open func room(_ room: Room, didDisconnect error: Error?)  

room(_:​did​Update:​)

open func room(_ room: Room, didUpdate speakers: [Participant])  

room(_:​participant:​did​Update:​)

open func room(_ room: Room, participant: Participant, didUpdate metadata: String?)  

room(_:​participant:​did​Update:​muted:​)

open func room(_ room: Room, participant: Participant, didUpdate publication: TrackPublication, muted: Bool)  

room(_:​participant:​did​Update:​stream​State:​)

open func room(_ room: Room, participant: RemoteParticipant, didUpdate publication: RemoteTrackPublication, streamState: StreamState)  

room(_:​participant:​did​Update:​)

open func room(_ room: Room, participant: Participant, didUpdate connectionQuality: ConnectionQuality)  

room(_:​participant:​did​Publish:​)

open func room(_ room: Room, participant: RemoteParticipant, didPublish publication: RemoteTrackPublication)  

room(_:​participant:​did​Unpublish:​)

open func room(_ room: Room, participant: RemoteParticipant, didUnpublish publication: RemoteTrackPublication)  

room(_:​participant:​did​Subscribe:​track:​)

open func room(_ room: Room, participant: RemoteParticipant, didSubscribe publication: RemoteTrackPublication, track: Track)  

room(_:​participant:​did​Fail​ToSubscribe:​error:​)

open func room(_ room: Room, participant: RemoteParticipant, didFailToSubscribe trackSid: String, error: Error)  

room(_:​participant:​did​Unsubscribe:​)

open func room(_ room: Room, participant: RemoteParticipant, didUnsubscribe publication: RemoteTrackPublication)  

room(_:​participant:​did​Receive:​)

open func room(_ room: Room, participant: RemoteParticipant?, didReceive data: Data)  

room(_:​local​Participant:​did​Publish:​)

open func room(_ room: Room, localParticipant: LocalParticipant, didPublish publication: LocalTrackPublication)  

room(_:​local​Participant:​did​Unpublish:​)

open func room(_ room: Room, localParticipant: LocalParticipant, didUnpublish publication: LocalTrackPublication)  

room(_:​participant:​did​Update:​permission:​)

open func room(_ room: Room, participant: RemoteParticipant, didUpdate publication: RemoteTrackPublication, permission allowed: Bool)