播放完第一次后出现 微信:音乐文件错误,播放失败
playerbtn(e) {
let path = ‘’
wx.getSystemInfo({
success(res) {
if (res.system.indexOf(‘Android’) > -1) {
path = ‘?t=’ + Date.parse(new Date())
console.log(‘路径pathpath–’, path)
}
}
})
console.log(‘路径pathpath222222----’, path)
wx.playBackgroundAudio({
dataUrl: e.paths + path,
tiitle: e.title,
coverImgUrl: e.litpic
})
console.log(‘路径’, e.paths + path)
console.log(‘titletitletitle’, e.title)
const manage = wx.getBackgroundAudioManager()
manage.onTimeUpdate(() => {
const currentTime = manage.currentTime
const duration = manage.duration
this.curTime = this._formatTime(currentTime)
this.totalTime = this._formatTime(duration)
this.stripe = (currentTime / duration) * 100
this.whetherplay = 1
this.$apply()
})
wx.onBackgroundAudioStop(() => {
this.playerbtn(this.audio)
this.whetherplay = 0
})
manage.onEnded(async (res) => {
console.log('播放结束', res)
const audioData = (await this.$http.get('/api/music/playMusicBySort?paramid=' + this.random)).data
this.playerbtn(audioData.data)
console.log('audioData.data---', audioData.data)
this.whetherplay = 0
this.$apply()
})
}
安卓音乐无法循环 循环第二次有时候播放到8秒卡死
“文章分享”是用于分享大家关于小程序的开发、运营经验的。
如果有问题或者需求反馈,可以发到“问题解答”模块,我们会有对应同学来处理回复的。
我们会将这个帖子隐藏掉,可以将这篇帖子删掉发到“问题解答”里面。