Skip to content

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

filter to Cap the maximum resolution to the screen resolution

Nitesh Sawant06aa2726d72c
diff --git a/client/src/assets/player/peertube-videojs-plugin.ts b/client/src/assets/player/peertube-videojs-plugin.ts
index e268510fa0..32cc4cd8f1 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