3***@qq.com
3***@qq.com
  • 发布:2019-12-04 09:18
  • 更新:2022-08-05 18:34
  • 阅读:1510

uni.createInnerAudioContext()组件在H5端报错

分类:uni-app

HBuilder是2.4.2.20191115版
在app和小程序正常,H5端报错如下:
index.umd.min.js:1 Uncaught (in promise) DOMException: The play() request was interrupted by a new load request. https://goo.gl/LdLk22

代码如下:```javascript
lianduplay:function(e,f){
this.hiddenfy();
if(this.sfliandu==true){
innerAudioContext.offEnded(); //取消监听事件
f=parseInt(f);
var ranum=Math.random()*1000;
var bfsrc='/static/diandu/'+e[f]+'.mp3';
console.log(bfsrc);
//console.log(f);
innerAudioContext.src = bfsrc;
innerAudioContext.play();
if(f<e.length){
this.showfy(this.ufanyi[f]);
}

			innerAudioContext.onEnded(()=>{  
				this.hiddenfy();  
				if(this.sfliandu==true){  
					f=f+1;  
					//console.log(f);  
					if(e.length<f+1){  //如果播放结束  
						this.sfliandu==false;  
						innerAudioContext.offEnded();  
					}  
					else{    //播放尚未结束  
					  
						this.lianduplay(e,f);  
							//innerAudioContext.offEnded();  
							  
					}  
				}  
				  
				  
				  
			});  
			}  
		}
2019-12-04 09:18 负责人:无 分享
已邀请:
2***@qq.com

2***@qq.com

请问解决了吗?我也遇到了

要回复问题请先登录注册