diff options
author | Chocobozzz <me@florianbigard.com> | 2018-04-20 10:21:28 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-04-20 10:21:28 +0200 |
commit | 3c40590d7467cfb187952993c4c7a5c4eaefb37a (patch) | |
tree | a7a23ee7cffe7008aba8c24e989078027987a5a9 /client/src | |
parent | 6cf57b443d559f54c80a36004670e38afadffee5 (diff) | |
download | PeerTube-3c40590d7467cfb187952993c4c7a5c4eaefb37a.tar.gz PeerTube-3c40590d7467cfb187952993c4c7a5c4eaefb37a.tar.zst PeerTube-3c40590d7467cfb187952993c4c7a5c4eaefb37a.zip |
Fix auto quality
Diffstat (limited to 'client/src')
-rw-r--r-- | client/src/assets/player/peertube-videojs-plugin.ts | 8 | ||||
-rw-r--r-- | client/src/sass/video-js-custom.scss | 6 |
2 files changed, 6 insertions, 8 deletions
diff --git a/client/src/assets/player/peertube-videojs-plugin.ts b/client/src/assets/player/peertube-videojs-plugin.ts index 290d88724..a4f99559c 100644 --- a/client/src/assets/player/peertube-videojs-plugin.ts +++ b/client/src/assets/player/peertube-videojs-plugin.ts | |||
@@ -284,9 +284,11 @@ class PeerTubePlugin extends Plugin { | |||
284 | private getAppropriateFile (averageDownloadSpeed?: number): VideoFile { | 284 | private getAppropriateFile (averageDownloadSpeed?: number): VideoFile { |
285 | if (this.videoFiles === undefined || this.videoFiles.length === 0) return undefined | 285 | if (this.videoFiles === undefined || this.videoFiles.length === 0) return undefined |
286 | if (this.videoFiles.length === 1) return this.videoFiles[0] | 286 | if (this.videoFiles.length === 1) return this.videoFiles[0] |
287 | if (this.torrent && this.torrent.progress === 1) return this.currentVideoFile | ||
288 | 287 | ||
289 | if (!averageDownloadSpeed) averageDownloadSpeed = this.getActualDownloadSpeed() | 288 | // Don't change the torrent is the play was ended |
289 | if (this.torrent && this.torrent.progress === 1 && this.player.ended()) return this.currentVideoFile | ||
290 | |||
291 | if (!averageDownloadSpeed) averageDownloadSpeed = this.getAndSaveActualDownloadSpeed() | ||
290 | 292 | ||
291 | // Filter videos we can play according to our bandwidth | 293 | // Filter videos we can play according to our bandwidth |
292 | const filteredFiles = this.videoFiles.filter(f => { | 294 | const filteredFiles = this.videoFiles.filter(f => { |
@@ -307,7 +309,7 @@ class PeerTubePlugin extends Plugin { | |||
307 | return maxBy(filteredFiles, 'resolution.id') | 309 | return maxBy(filteredFiles, 'resolution.id') |
308 | } | 310 | } |
309 | 311 | ||
310 | private getActualDownloadSpeed () { | 312 | private getAndSaveActualDownloadSpeed () { |
311 | const start = Math.max(this.downloadSpeeds.length - this.CONSTANTS.BANDWIDTH_AVERAGE_NUMBER_OF_VALUES, 0) | 313 | const start = Math.max(this.downloadSpeeds.length - this.CONSTANTS.BANDWIDTH_AVERAGE_NUMBER_OF_VALUES, 0) |
312 | const lastDownloadSpeeds = this.downloadSpeeds.slice(start, this.downloadSpeeds.length) | 314 | const lastDownloadSpeeds = this.downloadSpeeds.slice(start, this.downloadSpeeds.length) |
313 | if (lastDownloadSpeeds.length === 0) return -1 | 315 | if (lastDownloadSpeeds.length === 0) return -1 |
diff --git a/client/src/sass/video-js-custom.scss b/client/src/sass/video-js-custom.scss index 88bc0cfdf..680958a9f 100644 --- a/client/src/sass/video-js-custom.scss +++ b/client/src/sass/video-js-custom.scss | |||
@@ -447,7 +447,7 @@ $setting-transition-easing: ease-out; | |||
447 | } | 447 | } |
448 | 448 | ||
449 | .vjs-dock-description { | 449 | .vjs-dock-description { |
450 | font-size: 10px; | 450 | font-size: 9px; |
451 | } | 451 | } |
452 | 452 | ||
453 | .vjs-big-play-button { | 453 | .vjs-big-play-button { |
@@ -465,10 +465,6 @@ $setting-transition-easing: ease-out; | |||
465 | font-size: 14px; | 465 | font-size: 14px; |
466 | } | 466 | } |
467 | 467 | ||
468 | .vjs-dock-description { | ||
469 | font-size: 9px; | ||
470 | } | ||
471 | |||
472 | .vjs-big-play-button { | 468 | .vjs-big-play-button { |
473 | font-size: 4.5em; | 469 | font-size: 4.5em; |
474 | border-width: 4.5px; | 470 | border-width: 4.5px; |