Skip to content

Commit 6456d5b

Browse files
author
Taois
committed
feat:画质切换
1 parent 0730783 commit 6456d5b

File tree

1 file changed

+1
-18
lines changed

1 file changed

+1
-18
lines changed

dashboard/src/components/players/ArtVideoPlayer.vue

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -698,25 +698,8 @@ const handleQualityChange = (qualityName) => {
698698
currentPlayingUrl.value = quality.url
699699
700700
// 触发画质切换事件,让父组件更新videoUrl
701+
// 父组件更新videoUrl后会触发watch监听器重新初始化播放器
701702
emit('quality-change', quality)
702-
703-
// 等待父组件更新videoUrl后重新初始化播放器
704-
nextTick(() => {
705-
if (quality.url && artPlayerInstance.value) {
706-
// 更新播放器URL
707-
artPlayerInstance.value.switchUrl(quality.url)
708-
709-
// 恢复播放位置和状态
710-
setTimeout(() => {
711-
if (artPlayerInstance.value) {
712-
artPlayerInstance.value.currentTime = currentTime
713-
if (!isPaused) {
714-
artPlayerInstance.value.play()
715-
}
716-
}
717-
}, 100)
718-
}
719-
})
720703
}
721704
722705

0 commit comments

Comments
 (0)