Skip to content

ActivityPub-federated video streaming platform using P2P directly in your web browser

Fix player progress bar when changing resolution

Chocobozzzfe05c3acbd48
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 40da5f1f7c..4fd5a9be22 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 d065e72fb1..61965c85ee 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
+}