[8.2.0][fix] 修复TTS播报时 广告视频静音失败问题

This commit is contained in:
xinfengkun
2025-08-25 15:09:31 +08:00
parent a5038fbe70
commit c1b6b9e967

View File

@@ -100,15 +100,14 @@ class AdVideoPlayer : StandardGSYVideoPlayer {
isFocusableInTouchMode = false
}
override fun updateStartImage() {
super.updateStartImage()
when (mCurrentState) {
GSYVideoView.CURRENT_STATE_PLAYING ->{
MediaManager.setVideoFocusChange(true)
}
else -> {
MediaManager.setVideoFocusChange(false)
}
private var oldPlaying = false
override fun setStateAndUi(state: Int) {
super.setStateAndUi(state)
Logger.d("AdVideoPlayer", "播放状态 $state")
val playing = state == GSYVideoView.CURRENT_STATE_PLAYING
if (oldPlaying != playing) {
oldPlaying = playing
MediaManager.setVideoFocusChange(playing)
}
}