音频播放错误: {"errMsg":"MediaError","errCode":-99} 这个是什么意思
8***@qq.com
- 发布:2020-09-13 18:40
- 更新:2020-12-02 14:11
- 阅读:2919
1 个回复
天神下凡
const innerAudioContext = uni.createInnerAudioContext();
innerAudioContext.autoplay = true;
innerAudioContext.volume = 1;
innerAudioContext.src = '../../static/3.mp3';
innerAudioContext.onPlay(() => {
console.log('开始播放');
});
innerAudioContext.onError((res) => {
console.log(res.errMsg);
console.log(res.errCode);
});
innerAudioContext.onPause(function() {
console.log('end');
innerAudioContext.destroy();//音频播放停止后,就销毁实例
});
借个帖子,单纯记录下原因