const innerAudioContext = wx.createInnerAudioContext()
innerAudioContext.autoplay = true
innerAudioContext.src = '../demo.mp3'
innerAudioContext.onPlay(() => {
console.log('开始播放')
})
innerAudioContext.onCanplay(() => {
console.log('can play...')
})
innerAudioContext.play();
innerAudioContext.onError((res) => {
console.log(res)
})
innerAudioContext.onPlay((res) => {
console.log('play...')
})
平台:微信开发者工具 / ios调试
基础库:2.2.1
改成这样就可以了,或者你可以用http://music.163.com/song/media/outer/url?id=1473782328.mp3这个测试