const innerAudioContext = wx.createInnerAudioContext()
innerAudioContext.autoplay = trueinnerAudioContext.src = 'http://ws.stream.qqmusic.qq.com/M500001VfvsJ21xFqb.mp3?guid=ffffffff82def4af4b12b3cd9337d5e7&uin=346897220&vkey=6292F51E1E384E061FF02C31F716658E5C81F5594D561F2E88B854E81CAAB7806D5E4F103E55D33C16F3FAC506D1AB172DE8600B37E43FAD&fromtag=46'innerAudioContext.onPlay(() => { console.log('开始播放')
})
innerAudioContext.onError((res) => { console.log(res.errMsg) console.log(res.errCode)
})在模拟器上可以正常播放aac|mp3格式的语音但是在iOS 11上播放报错
errCode: 10001 // 系统错误
errMsg: "INNERERRORCODE: -11800, ERRORMSG: 这项操作无法完成10001"
微信小程序开发问题解答
微信小程序开发者回答:
别用自动播放.手动点击播放试试,保证播放地址正确哦
本文网址:http://www.91bianli.com/weixinxiaochengxu/21603.html