mirror of
https://github.com/jellyfin/jellyfin-web.git
synced 2024-11-16 02:18:16 -07:00
Merge pull request #2171 from nyanmisaka/fix-auto
Fix the issue where the bitrate option is always Auto
This commit is contained in:
commit
49d6d0432e
@ -52,19 +52,16 @@ export function getVideoQualityOptions(options) {
|
||||
qualityOptions.push({ name: '360p - 420 kbps', maxHeight: 360, bitrate: 420000 });
|
||||
|
||||
if (maxStreamingBitrate) {
|
||||
let selectedIndex = -1;
|
||||
let selectedIndex = qualityOptions.length - 1;
|
||||
for (let i = 0, length = qualityOptions.length; i < length; i++) {
|
||||
const option = qualityOptions[i];
|
||||
|
||||
if (selectedIndex === -1 && option.bitrate <= maxStreamingBitrate) {
|
||||
if (option.bitrate > 0 && option.bitrate <= maxStreamingBitrate) {
|
||||
selectedIndex = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (selectedIndex === -1) {
|
||||
selectedIndex = qualityOptions.length - 1;
|
||||
}
|
||||
|
||||
const currentQualityOption = qualityOptions[selectedIndex];
|
||||
|
||||
if (!options.isAutomaticBitrateEnabled) {
|
||||
@ -103,19 +100,16 @@ export function getAudioQualityOptions(options) {
|
||||
qualityOptions.push({ name: '64 kbps', bitrate: 64000 });
|
||||
|
||||
if (maxStreamingBitrate) {
|
||||
let selectedIndex = -1;
|
||||
let selectedIndex = qualityOptions.length - 1;
|
||||
for (let i = 0, length = qualityOptions.length; i < length; i++) {
|
||||
const option = qualityOptions[i];
|
||||
|
||||
if (selectedIndex === -1 && option.bitrate <= maxStreamingBitrate) {
|
||||
if (option.bitrate > 0 && option.bitrate <= maxStreamingBitrate) {
|
||||
selectedIndex = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (selectedIndex === -1) {
|
||||
selectedIndex = qualityOptions.length - 1;
|
||||
}
|
||||
|
||||
const currentQualityOption = qualityOptions[selectedIndex];
|
||||
|
||||
if (!options.isAutomaticBitrateEnabled) {
|
||||
|
Loading…
Reference in New Issue
Block a user