From 06aa2726d72cccbd7045b5c687b2357b096de4b9 Mon Sep 17 00:00:00 2001 From: Nitesh Sawant Date: Sat, 30 Jun 2018 15:14:50 +0530 Subject: filter to Cap the maximum resolution to the screen resolution --- client/src/assets/player/peertube-videojs-plugin.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'client/src') 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 { if (!averageDownloadSpeed) averageDownloadSpeed = this.getAndSaveActualDownloadSpeed() - // Filter videos we can play according to our bandwidth - const filteredFiles = this.videoFiles.filter(f => { + // Filter videos we can play according to our screen resolution and bandwidth + const filteredFiles = this.videoFiles.filter(f => f.resolution.id <= this.playerElement.width) + .filter(f => { const fileBitrate = (f.size / this.videoDuration) let threshold = fileBitrate -- cgit v1.2.3