Committed by
GitHub
Receive remote participant disconnected updates while reconnecting (#224)
正在显示
3 个修改的文件
包含
9 行增加
和
6 行删除
| @@ -33,7 +33,7 @@ data class ConnectOptions( | @@ -33,7 +33,7 @@ data class ConnectOptions( | ||
| 33 | /** | 33 | /** |
| 34 | * the protocol version to use with the server. | 34 | * the protocol version to use with the server. |
| 35 | */ | 35 | */ |
| 36 | - val protocolVersion: ProtocolVersion = ProtocolVersion.v8 | 36 | + val protocolVersion: ProtocolVersion = ProtocolVersion.v9 |
| 37 | ) { | 37 | ) { |
| 38 | internal var reconnect: Boolean = false | 38 | internal var reconnect: Boolean = false |
| 39 | internal var participantSid: String? = null | 39 | internal var participantSid: String? = null |
| @@ -668,15 +668,17 @@ constructor( | @@ -668,15 +668,17 @@ constructor( | ||
| 668 | } | 668 | } |
| 669 | 669 | ||
| 670 | val isNewParticipant = !remoteParticipants.contains(participantSid) | 670 | val isNewParticipant = !remoteParticipants.contains(participantSid) |
| 671 | - val participant = getOrCreateRemoteParticipant(participantSid, info) | ||
| 672 | 671 | ||
| 673 | if (info.state == LivekitModels.ParticipantInfo.State.DISCONNECTED) { | 672 | if (info.state == LivekitModels.ParticipantInfo.State.DISCONNECTED) { |
| 674 | handleParticipantDisconnect(participantSid) | 673 | handleParticipantDisconnect(participantSid) |
| 675 | - } else if (isNewParticipant) { | ||
| 676 | - listener?.onParticipantConnected(this, participant) | ||
| 677 | - eventBus.postEvent(RoomEvent.ParticipantConnected(this, participant), coroutineScope) | ||
| 678 | } else { | 674 | } else { |
| 679 | - participant.updateFromInfo(info) | 675 | + val participant = getOrCreateRemoteParticipant(participantSid, info) |
| 676 | + if (isNewParticipant) { | ||
| 677 | + listener?.onParticipantConnected(this, participant) | ||
| 678 | + eventBus.postEvent(RoomEvent.ParticipantConnected(this, participant), coroutineScope) | ||
| 679 | + } else { | ||
| 680 | + participant.updateFromInfo(info) | ||
| 681 | + } | ||
| 680 | } | 682 | } |
| 681 | } | 683 | } |
| 682 | } | 684 | } |
-
请 注册 或 登录 后发表评论