From: Chocobozzz Date: Fri, 16 Nov 2018 08:16:41 +0000 (+0100) Subject: Fix player progress bar when changing resolution X-Git-Tag: v1.1.0-rc.1~34 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=fe05c3acbd48c72ac7e503bebde91830121a0bf1;p=oweals%2Fpeertube.git Fix player progress bar when changing resolution --- diff --git a/client/src/assets/player/images/tick-white.svg b/client/src/assets/player/images/tick-white.svg new file mode 100644 index 000000000..d329e6bfb --- /dev/null +++ b/client/src/assets/player/images/tick-white.svg @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/client/src/assets/player/images/tick.svg b/client/src/assets/player/images/tick.svg deleted file mode 100644 index d329e6bfb..000000000 --- a/client/src/assets/player/images/tick.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - 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 +}