设置innerAudioContext.src之后调用play()方法,偶现执行onWating回调方法之后就无下文,不执行onPlay()也不执行onError()
//播放调用方式
this.innerAudioContext.src = e.currentTarget.dataset.url;
this.innerAudioContext.play();
//初始化方式
innerAudioContextInit: function () {
this.innerAudioContext = wx.createInnerAudioContext()//播放音频示例
this.innerAudioContext.autoplay = false
this.innerAudioContext.obeyMuteSwitch = false
//播放音频回调
this.innerAudioContext.onPlay(() => {
console.log("开始播放")
this.onPlay();
})
this.innerAudioContext.onEnded(() => {
console.log("播放结束")
this.onEnded();
})
this.innerAudioContext.onPause(() => {
console.log("播放暂停")
this.onPause();
})
this.innerAudioContext.onError((res) => {
this.toastShow("播放出错")
console.log(res)
this.onMediaError();
})
this.innerAudioContext.onWaiting((res) => {
console.log('onWaiting')
console.log(res)
this.onMediaWaiting();
})}
同问解决了吗
你好,你这个问题解决了吗