更改URL重试刷新次数
parent
31e8b466cf
commit
59091a5ea9
|
@ -211,7 +211,7 @@ export default {
|
||||||
if (!this.musicInfo.songmid) return
|
if (!this.musicInfo.songmid) return
|
||||||
console.log('出错')
|
console.log('出错')
|
||||||
this.stopPlay()
|
this.stopPlay()
|
||||||
if (this.listId != 'download' && this.audio.error.code !== 1 && this.retryNum < 3) { // 若音频URL无效则尝试刷新3次URL
|
if (this.listId != 'download' && this.audio.error.code !== 1 && this.retryNum < 2) { // 若音频URL无效则尝试刷新2次URL
|
||||||
// console.log(this.retryNum)
|
// console.log(this.retryNum)
|
||||||
this.audioErrorTime = this.audio.currentTime // 记录出错的播放时间
|
this.audioErrorTime = this.audio.currentTime // 记录出错的播放时间
|
||||||
this.retryNum++
|
this.retryNum++
|
||||||
|
|
|
@ -195,7 +195,7 @@ const actions = {
|
||||||
// console.log(err.code, err.message)
|
// console.log(err.code, err.message)
|
||||||
commit('onError', downloadInfo)
|
commit('onError', downloadInfo)
|
||||||
// console.log(tryNum[downloadInfo.key])
|
// console.log(tryNum[downloadInfo.key])
|
||||||
if (++tryNum[downloadInfo.key] > 5) {
|
if (++tryNum[downloadInfo.key] > 2) {
|
||||||
_this.dispatch('download/startTask')
|
_this.dispatch('download/startTask')
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue