From fe05c3acbd48c72ac7e503bebde91830121a0bf1 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 16 Nov 2018 09:16:41 +0100 Subject: [PATCH] Fix player progress bar when changing resolution --- client/src/assets/player/images/{tick.svg => tick-white.svg} | 0 client/src/assets/player/peertube-videojs-plugin.ts | 5 +++++ client/src/sass/player/settings-menu.scss | 4 ++-- 3 files changed, 7 insertions(+), 2 deletions(-) rename client/src/assets/player/images/{tick.svg => tick-white.svg} (100%) diff --git a/client/src/assets/player/images/tick.svg b/client/src/assets/player/images/tick-white.svg similarity index 100% rename from client/src/assets/player/images/tick.svg rename to client/src/assets/player/images/tick-white.svg diff --git a/client/src/assets/player/peertube-videojs-plugin.ts b/client/src/assets/player/peertube-videojs-plugin.ts index 40da5f1f7..4fd5a9be2 100644 --- a/client/src/assets/player/peertube-videojs-plugin.ts +++ b/client/src/assets/player/peertube-videojs-plugin.ts @@ -111,6 +111,8 @@ class PeerTubePlugin extends Plugin { const muted = getStoredMute() if (muted !== undefined) this.player.muted(muted) + this.player.duration(options.videoDuration) + this.initializePlayer() this.runTorrentInfoScheduler() this.runViewAdd() @@ -302,6 +304,9 @@ class PeerTubePlugin extends Plugin { this.flushVideoFile(previousVideoFile) + // Update progress bar (just for the UI), do not wait rendering + if (options.seek) this.player.currentTime(options.seek) + const renderVideoOptions = { autoplay: false, controls: true } renderVideo(torrent.files[ 0 ], this.playerElement, renderVideoOptions, (err, renderer) => { this.renderer = renderer diff --git a/client/src/sass/player/settings-menu.scss b/client/src/sass/player/settings-menu.scss index d065e72fb..61965c85e 100644 --- a/client/src/sass/player/settings-menu.scss +++ b/client/src/sass/player/settings-menu.scss @@ -171,7 +171,7 @@ $setting-transition-easing: ease-out; left: 8px; content: ' '; margin-top: 1px; - background-image: url('#{$assets-path}/player/images/tick.svg'); + background-image: url('#{$assets-path}/player/images/tick-white.svg'); } } } @@ -197,4 +197,4 @@ $setting-transition-easing: ease-out; } } } -} \ No newline at end of file +} -- 2.25.1