修复快速切换歌曲时, 会出现播放的歌曲和界面展示的歌曲不一致的问题

This commit is contained in:
lyswhut
2021-01-23 16:33:12 +08:00
parent c4ae0dddb0
commit f2fb37df4c
3 changed files with 12 additions and 6 deletions
+3 -2
View File
@@ -581,8 +581,9 @@ export default {
this.musicInfo.url = targetSong.typeUrl[type]
this.status = this.statusText = this.$t('core.player.geting_url')
return this.getUrl({ musicInfo: targetSong, originMusic, type, isRefresh }).then(() => {
audio.src = this.musicInfo.url = targetSong.typeUrl[type]
return this.getUrl({ musicInfo: targetSong, originMusic, type, isRefresh }).then(url => {
if ((targetSong !== this.targetSong && originMusic !== this.targetSong) || this.isPlay) return
audio.src = this.musicInfo.url = url
}).catch(err => {
// console.log('err', err.message)
if (err.message == requestMsg.cancelRequest) return