[m1]
[线程错误]
This commit is contained in:
@@ -3,29 +3,38 @@ package com.mogo.och.bus.passenger.utils
|
||||
import android.os.Build
|
||||
import androidx.annotation.RequiresApi
|
||||
import com.mogo.commons.voice.IMogoVoiceCmdCallBack
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
|
||||
import com.shuyu.gsyvideoplayer.GSYVideoManager
|
||||
|
||||
object VoiceFocusManager {
|
||||
@RequiresApi(Build.VERSION_CODES.O)
|
||||
fun getVoiceCmdCallBack():IMogoVoiceCmdCallBack{
|
||||
GSYVideoManager.onPause()
|
||||
GSYVideoManager.instance().curPlayerManager?.setNeedMute(true)
|
||||
UiThreadHandler.post {
|
||||
GSYVideoManager.onPause()
|
||||
GSYVideoManager.instance().curPlayerManager?.setNeedMute(true)
|
||||
}
|
||||
|
||||
return object : IMogoVoiceCmdCallBack{
|
||||
|
||||
override fun onSpeakEnd(speakText: String?) {
|
||||
GSYVideoManager.instance().curPlayerManager?.setNeedMute(false)
|
||||
GSYVideoManager.onResume()
|
||||
UiThreadHandler.post {
|
||||
GSYVideoManager.instance().curPlayerManager?.setNeedMute(false)
|
||||
GSYVideoManager.onResume()
|
||||
}
|
||||
}
|
||||
|
||||
override fun onSpeakError(speakText: String?, errorMsg: String?) {
|
||||
GSYVideoManager.instance().curPlayerManager?.setNeedMute(false)
|
||||
GSYVideoManager.onResume()
|
||||
UiThreadHandler.post {
|
||||
GSYVideoManager.instance().curPlayerManager?.setNeedMute(false)
|
||||
GSYVideoManager.onResume()
|
||||
}
|
||||
}
|
||||
|
||||
override fun onSpeakSelectTimeOut(speakText: String?) {
|
||||
GSYVideoManager.instance().curPlayerManager?.setNeedMute(false)
|
||||
GSYVideoManager.onResume()
|
||||
UiThreadHandler.post {
|
||||
GSYVideoManager.instance().curPlayerManager?.setNeedMute(false)
|
||||
GSYVideoManager.onResume()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user