diff options
author | Nitesh Sawant <ns23@github.com> | 2018-06-30 15:14:50 +0530 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-06-30 12:44:10 +0200 |
commit | 06aa2726d72cccbd7045b5c687b2357b096de4b9 (patch) | |
tree | 14e73dbb504bfb7b704e56b7726c546ca78f4492 /client/src | |
parent | b5c4bfd6acfa6b3430b81e3915658d0129b2cd5f (diff) | |
download | PeerTube-06aa2726d72cccbd7045b5c687b2357b096de4b9.tar.gz PeerTube-06aa2726d72cccbd7045b5c687b2357b096de4b9.tar.zst PeerTube-06aa2726d72cccbd7045b5c687b2357b096de4b9.zip |
filter to Cap the maximum resolution to the screen resolution
Diffstat (limited to 'client/src')
-rw-r--r-- | client/src/assets/player/peertube-videojs-plugin.ts | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/client/src/assets/player/peertube-videojs-plugin.ts b/client/src/assets/player/peertube-videojs-plugin.ts index e268510fa..32cc4cd8f 100644 --- a/client/src/assets/player/peertube-videojs-plugin.ts +++ b/client/src/assets/player/peertube-videojs-plugin.ts | |||
@@ -365,8 +365,9 @@ class PeerTubePlugin extends Plugin { | |||
365 | 365 | ||
366 | if (!averageDownloadSpeed) averageDownloadSpeed = this.getAndSaveActualDownloadSpeed() | 366 | if (!averageDownloadSpeed) averageDownloadSpeed = this.getAndSaveActualDownloadSpeed() |
367 | 367 | ||
368 | // Filter videos we can play according to our bandwidth | 368 | // Filter videos we can play according to our screen resolution and bandwidth |
369 | const filteredFiles = this.videoFiles.filter(f => { | 369 | const filteredFiles = this.videoFiles.filter(f => f.resolution.id <= this.playerElement.width) |
370 | .filter(f => { | ||
370 | const fileBitrate = (f.size / this.videoDuration) | 371 | const fileBitrate = (f.size / this.videoDuration) |
371 | let threshold = fileBitrate | 372 | let threshold = fileBitrate |
372 | 373 | ||