@@ -23,28 +23,35 @@ import Foundation
23
23
/// All delegate methods are optional.
24
24
///
25
25
/// To ensure each participant's delegate is registered, you can look through ``Room/localParticipant`` and ``Room/remoteParticipants`` on connect
26
- /// and register it on new participants inside ``RoomDelegate/room(_:participantDidJoin:)-9bkm4 ``
26
+ /// and register it on new participants inside ``RoomDelegate/room(_:participantDidJoin:)``
27
27
@objc
28
28
public protocol ParticipantDelegate : AnyObject {
29
+ // MARK: - Participant
30
+
29
31
/// A ``Participant``'s metadata has updated.
30
32
/// `participant` Can be a ``LocalParticipant`` or a ``RemoteParticipant``.
31
33
@objc ( participant: didUpdateMetadata: ) optional
32
- func participant( _ participant: Participant , didUpdate metadata: String ? )
34
+ func participant( _ participant: Participant , didUpdateMetadata metadata: String ? )
33
35
34
36
/// A ``Participant``'s name has updated.
35
37
/// `participant` Can be a ``LocalParticipant`` or a ``RemoteParticipant``.
36
38
@objc ( participant: didUpdateName: ) optional
37
- func participant( _ participant: Participant , didUpdateName: String ? )
39
+ func participant( _ participant: Participant , didUpdateName name : String ? )
38
40
39
41
/// The isSpeaking status of a ``Participant`` has changed.
40
42
/// `participant` Can be a ``LocalParticipant`` or a ``RemoteParticipant``.
41
43
@objc ( participant: didUpdateSpeaking: ) optional
42
- func participant( _ participant: Participant , didUpdate speaking : Bool )
44
+ func participant( _ participant: Participant , didUpdateIsSpeaking isSpeaking : Bool )
43
45
44
46
/// The connection quality of a ``Participant`` has updated.
45
47
/// `participant` Can be a ``LocalParticipant`` or a ``RemoteParticipant``.
46
48
@objc ( participant: didUpdateConnectionQuality: ) optional
47
- func participant( _ participant: Participant , didUpdate connectionQuality: ConnectionQuality )
49
+ func participant( _ participant: Participant , didUpdateConnectionQuality connectionQuality: ConnectionQuality )
50
+
51
+ @objc ( participant: didUpdatePermissions: ) optional
52
+ func participant( _ participant: Participant , didUpdatePermissions permissions: ParticipantPermissions )
53
+
54
+ // MARK: - TrackPublication
48
55
49
56
/// `muted` state has updated for the ``Participant``'s ``TrackPublication``.
50
57
///
@@ -53,54 +60,57 @@ public protocol ParticipantDelegate: AnyObject {
53
60
///
54
61
/// `participant` Can be a ``LocalParticipant`` or a ``RemoteParticipant``.
55
62
@objc ( participant: publication: didUpdateMuted: ) optional
56
- func participant( _ participant: Participant , didUpdate publication: TrackPublication , muted : Bool )
63
+ func participant( _ participant: Participant , didUpdatePublication publication: TrackPublication , isMuted : Bool )
57
64
58
- @objc ( participant: didUpdatePermissions: ) optional
59
- func participant( _ participant: Participant , didUpdate permissions: ParticipantPermissions )
65
+ // MARK: - LocalTrackPublication
60
66
61
- /// ``RemoteTrackPublication/streamState `` has updated for the ``RemoteParticipant ``.
62
- @objc ( participant : publication : didUpdateStreamState : ) optional
63
- func participant ( _ participant: RemoteParticipant , didUpdate publication: RemoteTrackPublication , streamState : StreamState )
67
+ /// The ``LocalParticipant `` has published a ``LocalTrackPublication ``.
68
+ @objc ( localParticipant : didPublish : ) optional
69
+ func localParticipant ( _ participant: LocalParticipant , didPublishPublication publication: LocalTrackPublication )
64
70
65
- /// ``RemoteTrackPublication/subscriptionAllowed`` has updated for the ``RemoteParticipant``.
66
- @objc ( participant: publication: didUpdateCanSubscribe: ) optional
67
- func participant( _ participant: RemoteParticipant , didUpdate publication: RemoteTrackPublication , permission allowed: Bool )
71
+ /// The ``LocalParticipant`` has unpublished a ``LocalTrackPublication``.
72
+ @objc ( localParticipant: didUnpublish: ) optional
73
+ func localParticipant( _ participant: LocalParticipant , didUnpublishPublication publication: LocalTrackPublication )
74
+
75
+ // MARK: - RemoteTrackPublication
68
76
69
77
/// When a new ``RemoteTrackPublication`` is published to ``Room`` after the ``LocalParticipant`` has joined.
70
78
///
71
79
/// This delegate method will not be called for tracks that are already published.
72
80
@objc ( remoteParticipant: didPublish: ) optional
73
- func participant( _ participant: RemoteParticipant , didPublish publication: RemoteTrackPublication )
81
+ func participant( _ participant: RemoteParticipant , didPublishPublication publication: RemoteTrackPublication )
74
82
75
83
/// The ``RemoteParticipant`` has unpublished a ``RemoteTrackPublication``.
76
84
@objc ( remoteParticipant: didUnpublish: ) optional
77
- func participant( _ participant: RemoteParticipant , didUnpublish publication: RemoteTrackPublication )
78
-
79
- /// The ``LocalParticipant`` has published a ``LocalTrackPublication``.
80
- @objc ( localParticipant: didPublish: ) optional
81
- func localParticipant( _ participant: LocalParticipant , didPublish publication: LocalTrackPublication )
82
-
83
- /// The ``LocalParticipant`` has unpublished a ``LocalTrackPublication``.
84
- @objc ( localParticipant: didUnpublish: ) optional
85
- func localParticipant( _ participant: LocalParticipant , didUnpublish publication: LocalTrackPublication )
85
+ func participant( _ participant: RemoteParticipant , didUnpublishPublication publication: RemoteTrackPublication )
86
86
87
87
/// The ``LocalParticipant`` has subscribed to a new ``RemoteTrackPublication``.
88
88
///
89
89
/// This event will always fire as long as new tracks are ready for use.
90
- @objc ( participant: didSubscribe: track: ) optional
91
- func participant( _ participant: RemoteParticipant , didSubscribe publication: RemoteTrackPublication , track: Track )
90
+ @objc ( participant: didSubscribe: ) optional
91
+ func participant( _ participant: RemoteParticipant , didSubscribePublication publication: RemoteTrackPublication )
92
+
93
+ /// Unsubscribed from a ``RemoteTrackPublication`` and is no longer available.
94
+ ///
95
+ /// Clients should listen to this event and handle cleanup.
96
+ @objc ( participant: didUnsubscribePublication: ) optional
97
+ func participant( _ participant: RemoteParticipant , didUnsubscribePublication publication: RemoteTrackPublication )
92
98
93
99
/// Could not subscribe to a track.
94
100
///
95
101
/// This is an error state, the subscription can be retried.
96
102
@objc ( participant: didFailToSubscribeTrackWithSid: error: ) optional
97
- func participant( _ participant: RemoteParticipant , didFailToSubscribe trackSid: String , error: Error )
103
+ func participant( _ participant: RemoteParticipant , didFailToSubscribe trackSid: String , error: LiveKitError )
98
104
99
- /// Unsubscribed from a ``RemoteTrackPublication`` and is no longer available.
100
- ///
101
- /// Clients should listen to this event and handle cleanup.
102
- @objc ( participant: didUnsubscribePublication: track: ) optional
103
- func participant( _ participant: RemoteParticipant , didUnsubscribe publication: RemoteTrackPublication , track: Track )
105
+ /// ``TrackPublication/streamState`` has updated for the ``RemoteTrackPublication``.
106
+ @objc ( participant: publication: didUpdateStreamState: ) optional
107
+ func participant( _ participant: RemoteParticipant , didUpdatePublication publication: RemoteTrackPublication , streamState: StreamState )
108
+
109
+ /// ``RemoteTrackPublication/subscriptionAllowed`` has updated for the ``RemoteTrackPublication``.
110
+ @objc ( participant: publication: didUpdateCanSubscribe: ) optional
111
+ func participant( _ participant: RemoteParticipant , didUpdatePublication publication: RemoteTrackPublication , isSubscriptionAllowed: Bool )
112
+
113
+ // MARK: - Data
104
114
105
115
/// Data was received from a ``RemoteParticipant``.
106
116
@objc ( participant: didReceiveData: topic: ) optional
0 commit comments