From 3eb4a8ac0c605ecf979e9c213e45f83422d11c08 Mon Sep 17 00:00:00 2001 From: Preston Date: Tue, 22 Sep 2020 18:27:53 -0400 Subject: [PATCH] Resume watch progress when switching formats --- src/renderer/views/Watch/Watch.js | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/src/renderer/views/Watch/Watch.js b/src/renderer/views/Watch/Watch.js index a30ccaca..7a247b6c 100644 --- a/src/renderer/views/Watch/Watch.js +++ b/src/renderer/views/Watch/Watch.js @@ -560,12 +560,18 @@ export default Vue.extend({ }) return } - + const watchedProgress = this.getWatchedProgress() this.activeFormat = 'dash' this.hidePlayer = true setTimeout(() => { this.hidePlayer = false + setTimeout(() => { + const player = this.$refs.videoPlayer.player + if (player !== null) { + player.currentTime(watchedProgress) + } + }, 500) }, 100) }, @@ -574,12 +580,19 @@ export default Vue.extend({ return } + const watchedProgress = this.getWatchedProgress() this.activeFormat = 'legacy' this.activeSourceList = this.videoSourceList this.hidePlayer = true setTimeout(() => { this.hidePlayer = false + setTimeout(() => { + const player = this.$refs.videoPlayer.player + if (player !== null) { + player.currentTime(watchedProgress) + } + }, 500) }, 100) }, @@ -595,12 +608,19 @@ export default Vue.extend({ return } + const watchedProgress = this.getWatchedProgress() this.activeFormat = 'audio' this.activeSourceList = this.audioSourceList this.hidePlayer = true setTimeout(() => { this.hidePlayer = false + setTimeout(() => { + const player = this.$refs.videoPlayer.player + if (player !== null) { + player.currentTime(watchedProgress) + } + }, 500) }, 100) },