From 146e592a6d4510b31eeb834f69572c32e83bf3ed Mon Sep 17 00:00:00 2001 From: Adavier <30839200+adavier@users.noreply.github.com> Date: Sun, 17 May 2020 15:17:14 +0100 Subject: [PATCH] qualityoptions.js now shows correct options for aspect ratios below 16:9 (1.77) (such as 4:3 (1.33)) qualityoptions.js assumes that all videos are wider than 16:9 (1.77). So a video with resolution 1440x1080 (4:3 1080p) only exposes options of 720p as the width is not considered for 1080p. This fixes that by checking if the aspect ratio is less than 1.77, and if so padding the width to 16:9. --- src/components/playback/playersettingsmenu.js | 4 ++++ src/components/qualityOptions.js | 7 +++++++ 2 files changed, 11 insertions(+) diff --git a/src/components/playback/playersettingsmenu.js b/src/components/playback/playersettingsmenu.js index b89631f63..dd67b667e 100644 --- a/src/components/playback/playersettingsmenu.js +++ b/src/components/playback/playersettingsmenu.js @@ -7,11 +7,13 @@ define(['connectionManager', 'actionsheet', 'datetime', 'playbackManager', 'glob return stream.Type === 'Video'; })[0]; var videoWidth = videoStream ? videoStream.Width : null; + var videoHeight = videoStream ? videoStream.Height : null; var options = qualityoptions.getVideoQualityOptions({ currentMaxBitrate: playbackManager.getMaxStreamingBitrate(player), isAutomaticBitrateEnabled: playbackManager.enableAutomaticBitrateDetection(player), videoWidth: videoWidth, + videoHeight: videoHeight, enableAuto: true }); @@ -91,11 +93,13 @@ define(['connectionManager', 'actionsheet', 'datetime', 'playbackManager', 'glob })[0]; var videoWidth = videoStream ? videoStream.Width : null; + var videoHeight = videoStream ? videoStream.Height : null; var options = qualityoptions.getVideoQualityOptions({ currentMaxBitrate: playbackManager.getMaxStreamingBitrate(player), isAutomaticBitrateEnabled: playbackManager.enableAutomaticBitrateDetection(player), videoWidth: videoWidth, + videoHeight: videoHeight, enableAuto: true }); diff --git a/src/components/qualityOptions.js b/src/components/qualityOptions.js index 5ad69cb79..03bb9dacf 100644 --- a/src/components/qualityOptions.js +++ b/src/components/qualityOptions.js @@ -5,6 +5,13 @@ define(['globalize'], function (globalize) { var maxStreamingBitrate = options.currentMaxBitrate; var videoWidth = options.videoWidth; + var videoHeight = options.videoHeight; + + //If the aspect ratio is less than 16/9 (1.77), set the height as if it were pillerboxed. + // 4:3 1440x1080 -> 1920x1080 + if (videoWidth/videoHeight < 16/9) { + videoWidth=videoHeight*(16/9); + } var maxAllowedWidth = videoWidth || 4096; //var maxAllowedHeight = videoHeight || 2304;