详细问题描述
同时播放多个音频后暂停音频会偶现崩溃闪退问题
代码
//暂停背景音频
Vue.prototype.pauseBgAudio = () => {
const bgAudio = uni.getBackgroundAudioManager();
bgAudio.pause();
}
错误日志
io.dcloud.HBuilder E/AndroidRuntime: FATAL EXCEPTION: WeexJSBridgeThread
Process: io.dcloud.HBuilder, PID: 2091
java.lang.IllegalStateException
at android.media.MediaPlayer._pause(Native Method)
at android.media.MediaPlayer.pause(MediaPlayer.java:1541)
at io.dcloud.feature.audio.AudioPlayer.pause(AudioPlayer.java:329)
at io.dcloud.feature.audio.AudioPlayer$1.onAudioFocusChange(AudioPlayer.java:74)
at android.media.AudioManager$ServiceEventHandlerDelegate$1.handleMessage(AudioManager.java:2563)
at android.os.Handler.dispatchMessage(Handler.java:112)
at android.os.Looper.loop(Looper.java:216)
at android.os.HandlerThread.run(HandlerThread.java:65)
IDE运行环境说明
HBuilderX 2.2.2.20190816 5+SDK
uni-app运行环境说明
Android端
App运行环境说明
Android 荣耀V10 9.1.0
2 个回复
DCloud_Android_zl
麻烦提供一个可复现的demo
mdf - 四万多
请问你这个问题解决了吗?我现在也是这个问题