1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

Fix appHost.supports

This commit is contained in:
MrTimscampi 2020-07-19 17:38:42 +02:00
parent 9675bd57b8
commit a7df7ad720
20 changed files with 48 additions and 66 deletions

View file

@ -1,7 +1,6 @@
import globalize from 'globalize';
export function getVideoQualityOptions(options) {
var maxStreamingBitrate = options.currentMaxBitrate;
var videoWidth = options.videoWidth;
var videoHeight = options.videoHeight;
@ -25,7 +24,6 @@ export function getVideoQualityOptions(options) {
// Some 1080- videos are reported as 1912?
if (maxAllowedWidth >= 1900) {
qualityOptions.push({ name: '1080p - 60 Mbps', maxHeight: 1080, bitrate: 60000000 });
qualityOptions.push({ name: '1080p - 50 Mbps', maxHeight: 1080, bitrate: 50000000 });
qualityOptions.push({ name: '1080p - 40 Mbps', maxHeight: 1080, bitrate: 40000000 });
@ -38,13 +36,11 @@ export function getVideoQualityOptions(options) {
qualityOptions.push({ name: '1080p - 6 Mbps', maxHeight: 1080, bitrate: 6000001 });
qualityOptions.push({ name: '1080p - 5 Mbps', maxHeight: 1080, bitrate: 5000001 });
qualityOptions.push({ name: '1080p - 4 Mbps', maxHeight: 1080, bitrate: 4000002 });
} else if (maxAllowedWidth >= 1260) {
qualityOptions.push({ name: '720p - 10 Mbps', maxHeight: 720, bitrate: 10000000 });
qualityOptions.push({ name: '720p - 8 Mbps', maxHeight: 720, bitrate: 8000000 });
qualityOptions.push({ name: '720p - 6 Mbps', maxHeight: 720, bitrate: 6000000 });
qualityOptions.push({ name: '720p - 5 Mbps', maxHeight: 720, bitrate: 5000000 });
} else if (maxAllowedWidth >= 620) {
qualityOptions.push({ name: '480p - 4 Mbps', maxHeight: 480, bitrate: 4000001 });
qualityOptions.push({ name: '480p - 3 Mbps', maxHeight: 480, bitrate: 3000001 });
@ -83,7 +79,6 @@ export function getVideoQualityOptions(options) {
if (maxStreamingBitrate) {
var selectedIndex = -1;
for (var i = 0, length = qualityOptions.length; i < length; i++) {
var option = qualityOptions[i];
if (selectedIndex === -1 && option.bitrate <= maxStreamingBitrate) {
@ -143,7 +138,6 @@ export function getAudioQualityOptions(options) {
}
if (selectedIndex === -1) {
selectedIndex = qualityOptions.length - 1;
}