关于backgroundAudioManager.play()出错的问题?
if (isPause) { //在暂停状态
console.log('在暂停状态')
if (previousSrc == src) {
console.log('一样')
audioCtx.play()
} else {
console.log('不一样')
audioCtx.src = src
audioCtx.title = title //
audioCtx.singer = singer //
previousSrc = src
audioCtx.play()
}
} else { //不在暂停状态
console.log('不在暂停状态')
if (previousSrc == src) {
console.log('一样')
if (isIOS) {
console.log('ios')
// audioCtx.pause()
audioCtx.src = src
audioCtx.title = title //
audioCtx.singer = singer //
}
audioCtx.play()
} else {
console.log('不一样')
audioCtx.src = src
audioCtx.title = title //
audioCtx.singer = singer //
previousSrc = src
audioCtx.play()
}
}
播放暂停按钮绑定事件,在开发工具上运行正常。在手机上切换别的音频文件paly事件不生效 开发工具和真机调试是正常的,发布体验版部分机型异常 需要点击两次才能播放