diff --git a/dashboard-ui/scripts/mediaplayer-video.js b/dashboard-ui/scripts/mediaplayer-video.js index 10f9167e6e..fc3c7da2a2 100644 --- a/dashboard-ui/scripts/mediaplayer-video.js +++ b/dashboard-ui/scripts/mediaplayer-video.js @@ -862,9 +862,10 @@ var videoStream = self.currentMediaSource.MediaStreams.filter(function (stream) { return stream.Type == "Video"; })[0]; + var videoWidth = videoStream ? videoStream.Width : null; var videoHeight = videoStream ? videoStream.Height : null; - var options = self.getVideoQualityOptions(videoHeight); + var options = self.getVideoQualityOptions(videoWidth, videoHeight); if (isStatic) { options[0].name = "Direct"; diff --git a/dashboard-ui/scripts/mediaplayer.js b/dashboard-ui/scripts/mediaplayer.js index 08d5d65787..bcf7b21cd8 100644 --- a/dashboard-ui/scripts/mediaplayer.js +++ b/dashboard-ui/scripts/mediaplayer.js @@ -38,16 +38,17 @@ var canPlayAac = document.createElement('audio').canPlayType('audio/aac').replace(/no/, ''); - self.getVideoQualityOptions = function (videoHeight) { + self.getVideoQualityOptions = function (videoWidth, videoHeight) { var bitrateSetting = AppSettings.maxStreamingBitrate(); + var maxAllowedWidth = videoWidth || 4096; var maxAllowedHeight = videoHeight || 2304; var options = []; // Some 1080- videos are reported as 1912? - if (maxAllowedHeight >= 1060) { + if (maxAllowedWidth >= 1900) { options.push({ name: '1080p - 30Mbps', maxHeight: 1080, bitrate: 30000000 }); options.push({ name: '1080p - 25Mbps', maxHeight: 1080, bitrate: 25000000 }); @@ -58,13 +59,13 @@ options.push({ name: '1080p - 6Mbps', maxHeight: 1080, bitrate: 6000000 }); options.push({ name: '1080p - 5Mbps', maxHeight: 1080, bitrate: 5000000 }); - } else if (maxAllowedHeight >= 700) { + } else if (maxAllowedWidth >= 1260) { options.push({ name: '720p - 10Mbps', maxHeight: 720, bitrate: 10000000 }); options.push({ name: '720p - 8Mbps', maxHeight: 720, bitrate: 8000000 }); options.push({ name: '720p - 6Mbps', maxHeight: 720, bitrate: 6000000 }); options.push({ name: '720p - 5Mbps', maxHeight: 720, bitrate: 5000000 }); - } else if (maxAllowedHeight >= 460) { + } else if (maxAllowedWidth >= 700) { options.push({ name: '480p - 4Mbps', maxHeight: 480, bitrate: 4000000 }); options.push({ name: '480p - 3Mbps', maxHeight: 480, bitrate: 3000000 }); options.push({ name: '480p - 2.5Mbps', maxHeight: 480, bitrate: 2500000 }); @@ -72,7 +73,7 @@ options.push({ name: '480p - 1.5Mbps', maxHeight: 480, bitrate: 1500000 }); } - if (maxAllowedHeight >= 700) { + if (maxAllowedWidth >= 1260) { options.push({ name: '720p - 4Mbps', maxHeight: 720, bitrate: 4000000 }); options.push({ name: '720p - 3Mbps', maxHeight: 720, bitrate: 3000000 }); options.push({ name: '720p - 2Mbps', maxHeight: 720, bitrate: 2000000 });