mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
fix filtering of supported audio tracks
This commit is contained in:
parent
ea79d2651a
commit
a7bd7e30c6
3 changed files with 57 additions and 26 deletions
|
@ -11,6 +11,7 @@ import { appHost } from '../apphost';
|
|||
import Screenfull from 'screenfull';
|
||||
import ServerConnections from '../ServerConnections';
|
||||
import alert from '../alert';
|
||||
import { includesAny } from '../../utils/container.ts';
|
||||
|
||||
const UNLIMITED_ITEMS = -1;
|
||||
|
||||
|
@ -1306,6 +1307,7 @@ class PlaybackManager {
|
|||
return false;
|
||||
}
|
||||
|
||||
const container = mediaSource.Container.toLowerCase();
|
||||
const codec = (mediaStream.Codec || '').toLowerCase();
|
||||
|
||||
if (!codec) {
|
||||
|
@ -1315,20 +1317,9 @@ class PlaybackManager {
|
|||
const profiles = deviceProfile.DirectPlayProfiles || [];
|
||||
|
||||
return profiles.filter(function (p) {
|
||||
if (p.Type === 'Video') {
|
||||
if (!p.AudioCodec) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// This is an exclusion filter
|
||||
if (p.AudioCodec.indexOf('-') === 0) {
|
||||
return p.AudioCodec.toLowerCase().indexOf(codec) === -1;
|
||||
}
|
||||
|
||||
return p.AudioCodec.toLowerCase().indexOf(codec) !== -1;
|
||||
}
|
||||
|
||||
return false;
|
||||
return p.Type === 'Video'
|
||||
&& includesAny((p.Container || '').toLowerCase(), container)
|
||||
&& includesAny((p.AudioCodec || '').toLowerCase(), codec);
|
||||
}).length > 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue