- RevueSDK
- ParticipantDelegate
Protocol
ParticipantDelegate
參與者事件代理 — 細粒度訂閱單一 Participant 的事件
protocol ParticipantDelegate : AnyObjectOverview
participant.delegates(本協定)與 Room.shared.delegates(RoomDelegate 的對應方法)。 例外:說話狀態在本協定是 didUpdateIsSpeaking,RoomDelegate 改收整份名單 didUpdateSpeakingParticipants。
⚠️ 會跳出提示的事件(例如收到靜音請求就彈窗、收到訊息就推通知)只監聽其中一層, 兩層都接會提示兩次。
使用方式:
let alice = Room.shared.remoteParticipants["alice"]
alice?.delegates.add(delegate: self) // 只關心 alice 的變化
所有方法都有預設空實作,可選擇性實作需要的事件。
Topics
Instance Methods
func participant(RemoteParticipant, didDisconnectWithReason: DisconnectReason)func participant(LocalParticipant, didPublishTrack: LocalTrackPublication)func participant(RemoteParticipant, didReceiveMessage: String)func participant(RemoteParticipant, didReceiveMuteRequest: Bool)func participant(RemoteParticipant, didSubscribeTrack: RemoteTrackPublication)func participant(LocalParticipant, didUnpublishTrack: LocalTrackPublication)func participant(RemoteParticipant, didUnsubscribeTrack: RemoteTrackPublication)func participant(Participant, didUpdateConnectionQuality: ConnectionQuality)連線品質變更(5 級:excellent / good / fair / poor / bad)
func participant(Participant, didUpdateIsSpeaking: Bool)說話狀態變更(僅在
isSpeaking真正翻轉時觸發,不會每 tick 重複通知)func participant(Participant, didUpdateName: String?)參與者名稱已更新;對方清空名字時
name為 nilfunc participant(Participant, didUpdatePaths: FriendConnectionPaths)參與者連線路徑變更(FriendConnectionPaths bitmap,v0.13.0-rc1)
func participant(Participant, didUpdateStatus: UserStatus)參與者使用者狀態已更新(none/away/busy)
func participant(Participant, didUpdateStatusMessage: String?)參與者狀態訊息已更新;對方清空時
message為 nilfunc participant(Participant, trackPublication: TrackPublication, didUpdateIsMuted: Bool)func participant(Participant, trackPublication: TrackPublication, didUpdateStatistics: TrackStatistics)Track 統計更新(每秒一次,僅
Room.shared.reportStatistics == true時 fire、且有變化才 fire)。