innerAudioContext 安卓很长时间后才会播放,或者根本就没有声音
发布于 6 年前 作者 juanwei 14856 次浏览 来自 问答
initReadPlugin: function () {//初始化,播放插件
 
innerAudioContext.onWaiting(() => {
 
debugger
 
});
 
 
 
innerAudioContext.onCanplay(() => {
 
debugger
 
});
 
 
 
innerAudioContext.onPlay(() => {
 
debugger
 
});
 
 
 
innerAudioContext.onPause(() => {
 
 
 
});
 
 
 
innerAudioContext.onEnded(() => {
 
// debugger
 
// console.log("播放自然结束");});
 
 
 
innerAudioContext.onError((res) => {
 
})
 
},
 
 
//filename 为 语音合成插件了返回的地址,经测试是正常的
 innerAudioContext.autoplay = true
 innerAudioContext.src = res.filename;

预期:

        当下面两行代码执行后,应该有语音播放出来,

innerAudioContext.autoplay = true
 innerAudioContext.src = res.filename;

bug:

    苹果机正常播放,安卓机要很长时间才会播放,或者是根本没有声音(安卓机时,很慢才会到play等的监听事件,有时候到了stop事件,也没有声音)

3 回复

兄弟  这个问题解决了么  我也遇到了

机型:拿大概5部安卓机进行测试,oppo、华为、coolpad等,都有这个问题,ios没有。

代码片段:

https://developers.weixin.qq.com/s/YV6bSYm37V3r

提供一下出现问题的机型和微信版本,以及能复现问题的简单代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html)。

回到顶部