iOS真机InnerAudioContext更换src后不触发onCanplay事件?
init(options) {
this.InnerAudioContext.stop();
let {
elem
} = options;
this.InnerAudioContext.offEnded();
this.InnerAudioContext.offCanplay();
this.InnerAudioContext.offTimeUpdate();
this.InnerAudioContext.src = elem.src;
if (elem.currentTime != '00:00') {
let splitArr = elem.currentTime.split(':');
let seekCount = Number(splitArr[0]) * 60 + Number(splitArr[1]);
this.seek(seekCount);
}
this.InnerAudioContext.onCanplay(() => {
//二次执行init方法,改变src, onCanplay事件不触发, ios真机 iPhoneX 14.4.2
console.log(this.InnerAudioContext.paused);
// typeof options.success === 'function' && options.success();
EventBus.emit('onSuccess', elem);
});
}
1 回复
你好,麻烦提供出现问题的具体机型、微信版本号、系统版本号,以及能复现问题的代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html)