您好请问有解决方法吗?
扫描后调用声音,苹果没有声音?安卓有声音。scanBtn() { wx.scanCode({ success: (res) => { this.voice() }, fail: (res) => { } }) //wx.scanCode }, voice: function () { let _this=this const innerAudioContext = wx.createInnerAudioContext() innerAudioContext.autoplay = true innerAudioContext.obeyMuteSwitch = false innerAudioContext.src = "https://xcx.yearconsports.com/s.mp3" innerAudioContext.play() innerAudioContext.onPlay(() => { console.log('开始播放') }) // innerAudioContext.play(); innerAudioContext.onError((e) => { console.log(e.errMsg) console.log(e.errCode) _this.voice() }) }, 上面这段代码苹果手机在【真机调试】下有声音,在【预览或发布体验版或上线】的时候没声音。为什么? 代码片段:https://developers.weixin.qq.com/s/qlXLXKmK75it
2021-01-27