Fix player progress bar when changing resolution

This commit is contained in:
Chocobozzz 2018-11-16 09:16:41 +01:00
parent 8cf9987334
commit fe05c3acbd
No known key found for this signature in database
GPG Key ID: 583A612D890159BE
3 changed files with 7 additions and 2 deletions

View File

Before

Width:  |  Height:  |  Size: 738 B

After

Width:  |  Height:  |  Size: 738 B

View File

@ -111,6 +111,8 @@ class PeerTubePlugin extends Plugin {
const muted = getStoredMute() const muted = getStoredMute()
if (muted !== undefined) this.player.muted(muted) if (muted !== undefined) this.player.muted(muted)
this.player.duration(options.videoDuration)
this.initializePlayer() this.initializePlayer()
this.runTorrentInfoScheduler() this.runTorrentInfoScheduler()
this.runViewAdd() this.runViewAdd()
@ -302,6 +304,9 @@ class PeerTubePlugin extends Plugin {
this.flushVideoFile(previousVideoFile) 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 } const renderVideoOptions = { autoplay: false, controls: true }
renderVideo(torrent.files[ 0 ], this.playerElement, renderVideoOptions, (err, renderer) => { renderVideo(torrent.files[ 0 ], this.playerElement, renderVideoOptions, (err, renderer) => {
this.renderer = renderer this.renderer = renderer

View File

@ -171,7 +171,7 @@ $setting-transition-easing: ease-out;
left: 8px; left: 8px;
content: ' '; content: ' ';
margin-top: 1px; margin-top: 1px;
background-image: url('#{$assets-path}/player/images/tick.svg'); background-image: url('#{$assets-path}/player/images/tick-white.svg');
} }
} }
} }