From 6bf54a1dd78e144bd887d62b4e9343be956788dc Mon Sep 17 00:00:00 2001 From: Preston Date: Tue, 22 Sep 2020 16:19:21 -0400 Subject: [PATCH] Prevent PiP video from repeating if video is finished. Also prevent it from holding up navigation on rare occasions --- src/renderer/views/Watch/Watch.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/renderer/views/Watch/Watch.js b/src/renderer/views/Watch/Watch.js index ac85aaea..a30ccaca 100644 --- a/src/renderer/views/Watch/Watch.js +++ b/src/renderer/views/Watch/Watch.js @@ -663,14 +663,15 @@ export default Vue.extend({ this.updateWatchProgress(payload) } - if (player.isInPictureInPicture()) { + if (player !== null && !player.paused() && player.isInPictureInPicture()) { + const playerId = this.videoId setTimeout(() => { player.play() player.on('leavepictureinpicture', () => { const watchTime = player.currentTime() if (this.$route.fullPath.includes('/watch')) { const routeId = this.$route.params.id - if (routeId === this.videoId) { + if (routeId === playerId) { const activePlayer = $('.ftVideoPlayer video').get(0) activePlayer.currentTime = watchTime }