Toggle navigation
Toggle navigation
此项目
正在载入...
Sign in
xuning
/
livekitAndroidXuningTest
转到一个项目
Toggle navigation
项目
群组
代码片段
帮助
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
davidliu
2022-01-27 16:56:17 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
150b0c8910e533b5078a04b3c46cc22f1d39f9a0
150b0c89
1 parent
18d77b04
clean up reconnect function in sample callview model
隐藏空白字符变更
内嵌
并排对比
正在显示
1 个修改的文件
包含
8 行增加
和
4 行删除
sample-app-common/src/main/java/io/livekit/android/sample/CallViewModel.kt
sample-app-common/src/main/java/io/livekit/android/sample/CallViewModel.kt
查看文件 @
150b0c8
...
...
@@ -100,7 +100,7 @@ class CallViewModel(
mutableCameraEnabled.postValue(localParticipant.isCameraEnabled())
mutableRoom.value = room
mutablePrimarySpeaker.value = room.remoteParticipants.values.firstOrNull() ?: localParticipant
handlePrimarySpeaker(emptyList(), emptyList(), room)
launch {
combine(participants, activeSpeakers) { participants, speakers -> participants to speakers }
...
...
@@ -257,13 +257,17 @@ class CallViewModel(
}
fun reconnect() {
room.value?.disconnect()
Timber.e { "Reconnecting." }
val room = mutableRoom.value ?: return
mutableRoom.value = null
mutablePrimarySpeaker.value = null
room.disconnect()
viewModelScope.launch {
room.
value?.
connect(
room.connect(
url,
token
)
mutableRoom.value = room
}
}
}
...
...
请
注册
或
登录
后发表评论