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-08-02 02:50:14 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
d1180366df228d4b411a3764b2177a7d7dd255f5
d1180366
1 parent
e6c9d9b7
Main thread call for audioSwitch selectDevice
隐藏空白字符变更
内嵌
并排对比
正在显示
1 个修改的文件
包含
9 行增加
和
3 行删除
livekit-android-sdk/src/main/java/io/livekit/android/audio/AudioSwitchHandler.kt
livekit-android-sdk/src/main/java/io/livekit/android/audio/AudioSwitchHandler.kt
查看文件 @
d118036
...
...
@@ -57,7 +57,7 @@ constructor(private val context: Context) : AudioHandler {
override fun start() {
if (audioSwitch == null) {
handler.removeCallbacksAndMessages(null)
handler.post {
handler.post
AtFrontOfQueue
{
val switch = AudioSwitch(
context = context,
loggingEnabled = loggingEnabled,
...
...
@@ -73,7 +73,7 @@ constructor(private val context: Context) : AudioHandler {
override fun stop() {
handler.removeCallbacksAndMessages(null)
handler.post {
handler.post
AtFrontOfQueue
{
audioSwitch?.stop()
audioSwitch = null
}
...
...
@@ -86,7 +86,13 @@ constructor(private val context: Context) : AudioHandler {
get() = audioSwitch?.availableAudioDevices ?: listOf()
fun selectDevice(audioDevice: AudioDevice?) {
audioSwitch?.selectDevice(audioDevice)
if (Looper.myLooper() == Looper.getMainLooper()) {
audioSwitch?.selectDevice(audioDevice)
} else {
handler.post {
audioSwitch?.selectDevice(audioDevice)
}
}
}
companion object {
...
...
请
注册
或
登录
后发表评论