正在显示
1 个修改的文件
包含
7 行增加
和
3 行删除
| @@ -67,8 +67,7 @@ constructor( | @@ -67,8 +67,7 @@ constructor( | ||
| 67 | 67 | ||
| 68 | fun disconnect() { | 68 | fun disconnect() { |
| 69 | engine.close() | 69 | engine.close() |
| 70 | - state = State.DISCONNECTED | ||
| 71 | - listener?.onDisconnect(this, null) | 70 | + handleDisconnect() |
| 72 | } | 71 | } |
| 73 | 72 | ||
| 74 | private fun handleParticipantDisconnect(sid: String, participant: RemoteParticipant) { | 73 | private fun handleParticipantDisconnect(sid: String, participant: RemoteParticipant) { |
| @@ -138,6 +137,11 @@ constructor( | @@ -138,6 +137,11 @@ constructor( | ||
| 138 | listener?.onActiveSpeakersChanged(speakers, this) | 137 | listener?.onActiveSpeakersChanged(speakers, this) |
| 139 | } | 138 | } |
| 140 | 139 | ||
| 140 | + private fun handleDisconnect() { | ||
| 141 | + state = State.DISCONNECTED | ||
| 142 | + listener?.onDisconnect(this, null) | ||
| 143 | + } | ||
| 144 | + | ||
| 141 | /** | 145 | /** |
| 142 | * @suppress | 146 | * @suppress |
| 143 | */ | 147 | */ |
| @@ -240,7 +244,7 @@ constructor( | @@ -240,7 +244,7 @@ constructor( | ||
| 240 | */ | 244 | */ |
| 241 | override fun onDisconnect(reason: String) { | 245 | override fun onDisconnect(reason: String) { |
| 242 | Timber.v { "engine did disconnect: $reason" } | 246 | Timber.v { "engine did disconnect: $reason" } |
| 243 | - listener?.onDisconnect(this, null) | 247 | + handleDisconnect() |
| 244 | } | 248 | } |
| 245 | 249 | ||
| 246 | /** | 250 | /** |
-
请 注册 或 登录 后发表评论