From fe05c3acbd48c72ac7e503bebde91830121a0bf1 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 16 Nov 2018 09:16:41 +0100 Subject: Fix player progress bar when changing resolution --- client/src/assets/player/images/tick-white.svg | 12 ++++++++++++ client/src/assets/player/images/tick.svg | 12 ------------ client/src/assets/player/peertube-videojs-plugin.ts | 5 +++++ 3 files changed, 17 insertions(+), 12 deletions(-) create mode 100644 client/src/assets/player/images/tick-white.svg delete mode 100644 client/src/assets/player/images/tick.svg (limited to 'client/src/assets/player') 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 -- cgit v1.2.3