1***@qq.com
1***@qq.com
  • 发布:2022-01-15 21:18
  • 更新:2022-01-17 23:41
  • 阅读:360

h5页面 安卓微信浏览器 创建InnerAudioContext实例 进入页面有时候会自动播放 有时候不会播放 有时候刷新几遍才会播放

分类:uni-app
                   let innerAudioContext = null  
                   innerAudioContext = uni.createInnerAudioContext();  
                    innerAudioContext.autoplay = true;  
                    innerAudioContext.src = encodeURI(sessionStorage.getItem("audioUrl")) ;  
                    jweixin.config({});// 不做任何签名验证都可以  
                    jweixin.ready(function(){  
                        WeixinJSBridge.invoke('getNetworkType', {}, function(e){    

                            innerAudioContext.play()  
                            innerAudioContext.onPlay(() => {  

                            });  
                            innerAudioContext.onEnded(() => {  
                                // alert("!11")  
                                that.hiddenLoading()  
                                innerAudioContext.destroy()  
                            })  
                            innerAudioContext.onError((res) => {  
                                alert(res)  
                                console.log(res.errMsg);  
                                console.log(res.errCode);  
                            });  
                        })  
                    })
2022-01-15 21:18 负责人:无 分享
已邀请:
小枫叶

小枫叶 - 外包接单加v:wlmk1234567 注明来意

代码不全啊,提供个完整可以复现的demo

该问题目前已经被锁定, 无法添加新回复