mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
update video quality options
This commit is contained in:
parent
4556c02e47
commit
1299364d00
2 changed files with 8 additions and 6 deletions
|
@ -862,9 +862,10 @@
|
||||||
var videoStream = self.currentMediaSource.MediaStreams.filter(function (stream) {
|
var videoStream = self.currentMediaSource.MediaStreams.filter(function (stream) {
|
||||||
return stream.Type == "Video";
|
return stream.Type == "Video";
|
||||||
})[0];
|
})[0];
|
||||||
|
var videoWidth = videoStream ? videoStream.Width : null;
|
||||||
var videoHeight = videoStream ? videoStream.Height : null;
|
var videoHeight = videoStream ? videoStream.Height : null;
|
||||||
|
|
||||||
var options = self.getVideoQualityOptions(videoHeight);
|
var options = self.getVideoQualityOptions(videoWidth, videoHeight);
|
||||||
|
|
||||||
if (isStatic) {
|
if (isStatic) {
|
||||||
options[0].name = "Direct";
|
options[0].name = "Direct";
|
||||||
|
|
|
@ -38,16 +38,17 @@
|
||||||
|
|
||||||
var canPlayAac = document.createElement('audio').canPlayType('audio/aac').replace(/no/, '');
|
var canPlayAac = document.createElement('audio').canPlayType('audio/aac').replace(/no/, '');
|
||||||
|
|
||||||
self.getVideoQualityOptions = function (videoHeight) {
|
self.getVideoQualityOptions = function (videoWidth, videoHeight) {
|
||||||
|
|
||||||
var bitrateSetting = AppSettings.maxStreamingBitrate();
|
var bitrateSetting = AppSettings.maxStreamingBitrate();
|
||||||
|
|
||||||
|
var maxAllowedWidth = videoWidth || 4096;
|
||||||
var maxAllowedHeight = videoHeight || 2304;
|
var maxAllowedHeight = videoHeight || 2304;
|
||||||
|
|
||||||
var options = [];
|
var options = [];
|
||||||
|
|
||||||
// Some 1080- videos are reported as 1912?
|
// 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 - 30Mbps', maxHeight: 1080, bitrate: 30000000 });
|
||||||
options.push({ name: '1080p - 25Mbps', maxHeight: 1080, bitrate: 25000000 });
|
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 - 6Mbps', maxHeight: 1080, bitrate: 6000000 });
|
||||||
options.push({ name: '1080p - 5Mbps', maxHeight: 1080, bitrate: 5000000 });
|
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 - 10Mbps', maxHeight: 720, bitrate: 10000000 });
|
||||||
options.push({ name: '720p - 8Mbps', maxHeight: 720, bitrate: 8000000 });
|
options.push({ name: '720p - 8Mbps', maxHeight: 720, bitrate: 8000000 });
|
||||||
options.push({ name: '720p - 6Mbps', maxHeight: 720, bitrate: 6000000 });
|
options.push({ name: '720p - 6Mbps', maxHeight: 720, bitrate: 6000000 });
|
||||||
options.push({ name: '720p - 5Mbps', maxHeight: 720, bitrate: 5000000 });
|
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 - 4Mbps', maxHeight: 480, bitrate: 4000000 });
|
||||||
options.push({ name: '480p - 3Mbps', maxHeight: 480, bitrate: 3000000 });
|
options.push({ name: '480p - 3Mbps', maxHeight: 480, bitrate: 3000000 });
|
||||||
options.push({ name: '480p - 2.5Mbps', maxHeight: 480, bitrate: 2500000 });
|
options.push({ name: '480p - 2.5Mbps', maxHeight: 480, bitrate: 2500000 });
|
||||||
|
@ -72,7 +73,7 @@
|
||||||
options.push({ name: '480p - 1.5Mbps', maxHeight: 480, bitrate: 1500000 });
|
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 - 4Mbps', maxHeight: 720, bitrate: 4000000 });
|
||||||
options.push({ name: '720p - 3Mbps', maxHeight: 720, bitrate: 3000000 });
|
options.push({ name: '720p - 3Mbps', maxHeight: 720, bitrate: 3000000 });
|
||||||
options.push({ name: '720p - 2Mbps', maxHeight: 720, bitrate: 2000000 });
|
options.push({ name: '720p - 2Mbps', maxHeight: 720, bitrate: 2000000 });
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue