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
David Zhao
2021-03-25 14:26:18 -0700
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
d49de11830e83adcf91fda9d6a9e7ec446487cc2
d49de118
1 parent
6cb172f1
fixed sample app to publish audio
显示空白字符变更
内嵌
并排对比
正在显示
1 个修改的文件
包含
1 行增加
和
15 行删除
sample-app/src/main/java/io/livekit/android/sample/CallViewModel.kt
sample-app/src/main/java/io/livekit/android/sample/CallViewModel.kt
查看文件 @
d49de11
...
...
@@ -23,7 +23,6 @@ class CallViewModel(
val room: LiveData<Room> = mutableRoom
private val mutableRemoteParticipants = MutableLiveData<List<RemoteParticipant>>()
val remoteParticipants: LiveData<List<RemoteParticipant>> = mutableRemoteParticipants
private val participants = HashMap<String, LiveData<RemoteParticipant>>()
init {
viewModelScope.launch {
...
...
@@ -31,16 +30,10 @@ class CallViewModel(
application,
url,
token,
ConnectOptions(
fals
e),
ConnectOptions(
tru
e),
this@CallViewModel
)
updateParticipants(room)
for (p in room.remoteParticipants.values) {
if (p.identity == null) {
continue
}
participants[p.identity!!] = MutableLiveData(p)
}
mutableRoom.value = room
}
}
...
...
@@ -54,10 +47,6 @@ class CallViewModel(
)
}
fun getParticipantObservable(identity: String): LiveData<RemoteParticipant>? {
return participants[identity]
}
override fun onCleared() {
super.onCleared()
mutableRoom.value?.disconnect()
...
...
@@ -72,8 +61,6 @@ class CallViewModel(
participant: RemoteParticipant
) {
updateParticipants(room)
participants[participant.identity!!] = MutableLiveData(participant)
}
override fun onParticipantDisconnected(
...
...
@@ -81,7 +68,6 @@ class CallViewModel(
participant: RemoteParticipant
) {
updateParticipants(room)
participants.remove(participant.identity!!)
}
override fun onFailedToConnect(room: Room, error: Exception) {
...
...
请
注册
或
登录
后发表评论