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 1/3] 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 b89631f63a..dd67b667e6 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 5ad69cb790..03bb9dacf7 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; From 632cb5bd8d5a5315422efd51c850e316414f4ee6 Mon Sep 17 00:00:00 2001 From: adavier <30839200+adavier@users.noreply.github.com> Date: Sun, 17 May 2020 17:19:40 +0100 Subject: [PATCH 2/3] Update src/components/qualityOptions.js Co-authored-by: Julien Machiels --- src/components/qualityOptions.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/qualityOptions.js b/src/components/qualityOptions.js index 03bb9dacf7..898a1ac626 100644 --- a/src/components/qualityOptions.js +++ b/src/components/qualityOptions.js @@ -9,8 +9,8 @@ define(['globalize'], function (globalize) { //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); + if (videoWidth / videoHeight < 16 / 9) { + videoWidth = videoHeight * (16 / 9); } var maxAllowedWidth = videoWidth || 4096; From 3ecd8e45c78fd862207bd4ffbe6988af306d1d2c Mon Sep 17 00:00:00 2001 From: adavier <30839200+adavier@users.noreply.github.com> Date: Mon, 18 May 2020 11:20:34 +0100 Subject: [PATCH 3/3] Update src/components/qualityOptions.js Co-authored-by: Julien Machiels --- src/components/qualityOptions.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/qualityOptions.js b/src/components/qualityOptions.js index 898a1ac626..221e13d4ef 100644 --- a/src/components/qualityOptions.js +++ b/src/components/qualityOptions.js @@ -7,7 +7,7 @@ define(['globalize'], function (globalize) { 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. + // If the aspect ratio is less than 16/9 (1.77), set the width as if it were pillarboxed. // 4:3 1440x1080 -> 1920x1080 if (videoWidth / videoHeight < 16 / 9) { videoWidth = videoHeight * (16 / 9);