Committed by
GitHub
Room update (#18)
* update protocol submodule commit * Handle room metadata updates
正在显示
4 个修改的文件
包含
19 行增加
和
2 行删除
| @@ -377,6 +377,7 @@ internal constructor( | @@ -377,6 +377,7 @@ internal constructor( | ||
| 377 | fun onUpdateParticipants(updates: List<LivekitModels.ParticipantInfo>) | 377 | fun onUpdateParticipants(updates: List<LivekitModels.ParticipantInfo>) |
| 378 | fun onActiveSpeakersUpdate(speakers: List<LivekitModels.SpeakerInfo>) | 378 | fun onActiveSpeakersUpdate(speakers: List<LivekitModels.SpeakerInfo>) |
| 379 | fun onRemoteMuteChanged(trackSid: String, muted: Boolean) | 379 | fun onRemoteMuteChanged(trackSid: String, muted: Boolean) |
| 380 | + fun onRoomUpdate(update: LivekitModels.Room) | ||
| 380 | fun onSpeakersChanged(speakers: List<LivekitModels.SpeakerInfo>) | 381 | fun onSpeakersChanged(speakers: List<LivekitModels.SpeakerInfo>) |
| 381 | fun onDisconnect(reason: String) | 382 | fun onDisconnect(reason: String) |
| 382 | fun onFailToConnect(error: Exception) | 383 | fun onFailToConnect(error: Exception) |
| @@ -501,6 +502,10 @@ internal constructor( | @@ -501,6 +502,10 @@ internal constructor( | ||
| 501 | listener?.onRemoteMuteChanged(trackSid, muted) | 502 | listener?.onRemoteMuteChanged(trackSid, muted) |
| 502 | } | 503 | } |
| 503 | 504 | ||
| 505 | + override fun onRoomUpdate(update: LivekitModels.Room) { | ||
| 506 | + listener?.onRoomUpdate(update) | ||
| 507 | + } | ||
| 508 | + | ||
| 504 | override fun onLeave() { | 509 | override fun onLeave() { |
| 505 | close() | 510 | close() |
| 506 | listener?.onDisconnect("") | 511 | listener?.onDisconnect("") |
| @@ -54,6 +54,9 @@ constructor( | @@ -54,6 +54,9 @@ constructor( | ||
| 54 | private set | 54 | private set |
| 55 | var state: State = State.DISCONNECTED | 55 | var state: State = State.DISCONNECTED |
| 56 | private set | 56 | private set |
| 57 | + var metadata: String? = null | ||
| 58 | + private set | ||
| 59 | + | ||
| 57 | lateinit var localParticipant: LocalParticipant | 60 | lateinit var localParticipant: LocalParticipant |
| 58 | private set | 61 | private set |
| 59 | private val mutableRemoteParticipants = mutableMapOf<String, RemoteParticipant>() | 62 | private val mutableRemoteParticipants = mutableMapOf<String, RemoteParticipant>() |
| @@ -318,6 +321,10 @@ constructor( | @@ -318,6 +321,10 @@ constructor( | ||
| 318 | localParticipant.onRemoteMuteChanged(trackSid, muted) | 321 | localParticipant.onRemoteMuteChanged(trackSid, muted) |
| 319 | } | 322 | } |
| 320 | 323 | ||
| 324 | + override fun onRoomUpdate(update: LivekitModels.Room) { | ||
| 325 | + metadata = update.metadata | ||
| 326 | + } | ||
| 327 | + | ||
| 321 | /** | 328 | /** |
| 322 | * @suppress | 329 | * @suppress |
| 323 | */ | 330 | */ |
| @@ -395,7 +395,10 @@ constructor( | @@ -395,7 +395,10 @@ constructor( | ||
| 395 | listener?.onRemoteMuteChanged(response.mute.sid, response.mute.muted) | 395 | listener?.onRemoteMuteChanged(response.mute.sid, response.mute.muted) |
| 396 | } | 396 | } |
| 397 | LivekitRtc.SignalResponse.MessageCase.ROOM_UPDATE -> { | 397 | LivekitRtc.SignalResponse.MessageCase.ROOM_UPDATE -> { |
| 398 | - //TODO | 398 | + listener?.onRoomUpdate(response.roomUpdate.room) |
| 399 | + } | ||
| 400 | + LivekitRtc.SignalResponse.MessageCase.CONNECTION_QUALITY -> { | ||
| 401 | + // TODO: listener?.onConnectionQuality(response.connectionQuality.updatesList) | ||
| 399 | } | 402 | } |
| 400 | LivekitRtc.SignalResponse.MessageCase.MESSAGE_NOT_SET, | 403 | LivekitRtc.SignalResponse.MessageCase.MESSAGE_NOT_SET, |
| 401 | null -> { | 404 | null -> { |
| @@ -419,6 +422,8 @@ constructor( | @@ -419,6 +422,8 @@ constructor( | ||
| 419 | fun onSpeakersChanged(speakers: List<LivekitModels.SpeakerInfo>) | 422 | fun onSpeakersChanged(speakers: List<LivekitModels.SpeakerInfo>) |
| 420 | fun onClose(reason: String, code: Int) | 423 | fun onClose(reason: String, code: Int) |
| 421 | fun onRemoteMuteChanged(trackSid: String, muted: Boolean) | 424 | fun onRemoteMuteChanged(trackSid: String, muted: Boolean) |
| 425 | + fun onRoomUpdate(update: LivekitModels.Room) | ||
| 426 | + // TODO: fun onConnectionQuality(updates: List<LivekitRtc.ConnectionQualityInfo>) | ||
| 422 | fun onLeave() | 427 | fun onLeave() |
| 423 | fun onError(error: Exception) | 428 | fun onError(error: Exception) |
| 424 | } | 429 | } |
-
请 注册 或 登录 后发表评论