Protocol
RoomDelegateObjC
@objc
public protocol RoomDelegateObjC: AnyObject
RoomDelegate
receives room events as well as Participant
events.
Important: The thread which the delegate will be called on, is not guranteed to be the
main
thread. If you will perform any UI update from the delegate, ensure the execution is from themain
thread.
Example usage
func room(_ room: Room, localParticipant: LocalParticipant, didPublish publication: LocalTrackPublication) {
DispatchQueue.main.async {
// update UI here
self.localVideoView.isHidden = false
}
}
See the source code of Swift Example App for more examples.
Relationships
Conforms To
AnyObject
Types Conforming to RoomDelegateObjC
RoomDelegate
Optional Requirements
room(_:didUpdate:oldValue:)
@objc(room:didUpdateConnectionState:oldConnectionState:) optional
func room(_ room: Room, didUpdate connectionState: ConnectionStateObjC, oldValue oldConnectionState: ConnectionStateObjC)
room(_:didConnect:)
@objc(room:didConnectIsReconnect:) optional
func room(_ room: Room, didConnect isReconnect: Bool)
Successfully connected to the room.
room(_:didFailToConnect:)
@objc(room:didFailToConnectWithError:) optional
func room(_ room: Room, didFailToConnect error: Error)
Could not connect to the room.
room(_:didDisconnect:)
@objc(room:didDisconnectWithError:) optional
func room(_ room: Room, didDisconnect error: Error?)
Client disconnected from the room unexpectedly.
room(_:participantDidJoin:)
@objc(room:participantDidJoin:) optional
func room(_ room: Room, participantDidJoin participant: RemoteParticipant)
When a RemoteParticipant
joins after the LocalParticipant
.
It will not emit events for participants that are already in the room.
room(_:participantDidLeave:)
@objc(room:participantDidLeave:) optional
func room(_ room: Room, participantDidLeave participant: RemoteParticipant)
When a RemoteParticipant
leaves after the LocalParticipant
has joined.
room(_:didUpdate:)
@objc(room:didUpdateSpeakers:) optional
func room(_ room: Room, didUpdate speakers: [Participant])
Active speakers changed.
List of speakers are ordered by their Participant/audioLevel
, loudest speakers first.
This will include the LocalParticipant
too.
room(_:didUpdate:)
@objc(room:didUpdateMetadata:) optional
func room(_ room: Room, didUpdate metadata: String?)
Room
's metadata has been updated.
room(_:didUpdate:)
@objc(room:didUpdateIsRecording:) optional
func room(_ room: Room, didUpdate isRecording: Bool)
Room
's recording state has been updated.
room(_:participant:didUpdate:)
@objc(room:participant:didUpdateMetadata:) optional
func room(_ room: Room, participant: Participant, didUpdate metadata: String?)
Same with ParticipantDelegate/participant(_:didUpdate:)-46iut
.
room(_:participant:didUpdate:)
@objc(room:participant:didUpdateConnectionQuality:) optional
func room(_ room: Room, participant: Participant, didUpdate connectionQuality: ConnectionQuality)
Same with ParticipantDelegate/participant(_:didUpdate:)-7zxk1
.
room(_:participant:didUpdate:muted:)
@objc(room:participant:publication:didUpdateMuted:) optional
func room(_ room: Room, participant: Participant, didUpdate publication: TrackPublication, muted: Bool)
Same with ParticipantDelegate/participant(_:didUpdate:)-84m89
.
room(_:participant:didUpdate:)
@objc(room:participant:didUpdatePermissions:) optional
func room(_ room: Room, participant: Participant, didUpdate permissions: ParticipantPermissions)
room(_:participant:didUpdate:streamState:)
@objc(room:participant:publication:didUpdateStreamState:) optional
func room(_ room: Room, participant: RemoteParticipant, didUpdate publication: RemoteTrackPublication, streamState: StreamState)
Same with ParticipantDelegate/participant(_:didUpdate:streamState:)-1lu8t
.
room(_:participant:didPublish:)
@objc(room:participant:didPublishPublication:) optional
func room(_ room: Room, participant: RemoteParticipant, didPublish publication: RemoteTrackPublication)
Same with ParticipantDelegate/participant(_:didPublish:)-60en3
.
room(_:participant:didUnpublish:)
@objc(room:participant:didUnpublishPublication:) optional
func room(_ room: Room, participant: RemoteParticipant, didUnpublish publication: RemoteTrackPublication)
Same with ParticipantDelegate/participant(_:didUnpublish:)-3bkga
.
room(_:participant:didSubscribe:track:)
@objc(room:participant:didSubscribePublication:track:) optional
func room(_ room: Room, participant: RemoteParticipant, didSubscribe publication: RemoteTrackPublication, track: Track)
Same with ParticipantDelegate/participant(_:didSubscribe:track:)-7mngl
.
room(_:participant:didFailToSubscribe:error:)
@objc optional
func room(_ room: Room, participant: RemoteParticipant, didFailToSubscribe trackSid: String, error: Error)
Same with ParticipantDelegate/participant(_:didFailToSubscribe:error:)-10pn4
.
room(_:participant:didUnsubscribe:track:)
@objc(room:publication:didUnsubscribePublication:track:) optional
func room(_ room: Room, participant: RemoteParticipant, didUnsubscribe publication: RemoteTrackPublication, track: Track)
Same with ParticipantDelegate/participant(_:didUnsubscribe:track:)-3ksvp
.
room(_:participant:didReceive:)
@objc(room:participant:didReceiveData:) optional
func room(_ room: Room, participant: RemoteParticipant?, didReceive data: Data)
Same with ParticipantDelegate/participant(_:didReceive:)-2t55a
participant could be nil if data was sent by server api.
room(_:localParticipant:didPublish:)
@objc(room:localParticipant:didPublishPublication:) optional
func room(_ room: Room, localParticipant: LocalParticipant, didPublish publication: LocalTrackPublication)
Same with ParticipantDelegate/localParticipant(_:didPublish:)-90j2m
.
room(_:localParticipant:didUnpublish:)
@objc(room:localParticipant:didUnpublishPublication:) optional
func room(_ room: Room, localParticipant: LocalParticipant, didUnpublish publication: LocalTrackPublication)
Same with ParticipantDelegate/participant(_:didUnpublish:)-3bkga
.
room(_:participant:didUpdate:permission:)
@objc optional
func room(_ room: Room, participant: RemoteParticipant, didUpdate publication: RemoteTrackPublication, permission allowed: Bool)
Same with ParticipantDelegate/participant(_:didUpdate:permission:)
.