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.
This commit is contained in:
@@ -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
|
||||
});
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user