InnerAudioContext.destroy()
createAudio(src, loop = false) {
const innerAudioContext = wx.createInnerAudioContext()
innerAudioContext.autoplay = false
innerAudioContext.loop = loop
innerAudioContext.src = src
innerAudioContext.onPlay(() => {
console.log('开始播放')
})
innerAudioContext.onError((res) => {
console.log(res.errMsg)
console.log(res.errCode)
})
return innerAudioContext
},
playAudio(context) {
context.play()
},
stopAudio(context) {
context.stop()
},
destroyAudio(context) {
context.destroy()
}
destoryAudios() {
for (const key in this.audio) {
Audio.destroyAudio(this.audio[key])
}
this.audio = null
},
onUnload() {
console.log('页面卸载了')
this.stopAudio()
this.destoryAudios()
clearInterval(this.timer)
},
同样问题 有解决吗?
麻烦提供能复现问题的代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html)