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

Override mp3 remux container (#5914)

* Override mp3 remux container

The server generally filters out invalid containers for HLS in most cases. However, MP3 is a special case because, while it is technically possible and allowed as a codec for fMP4 on the server side, most browsers do not support it. Override the remux container to force MPEG-TS for MP3. The server will still direct play MP3 in an MP3 container. This is useful for supporting universal containers like MKA.

* Fix lint

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
This commit is contained in:
gnattu 2024-08-18 07:20:08 +08:00 committed by GitHub
parent 45d72f16cc
commit 6e0ad2ed1b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -715,6 +715,17 @@ export default function (options) {
});
['opus', 'mp3', 'mp2', 'aac', 'flac', 'alac', 'webma', 'wma', 'wav', 'ogg', 'oga'].filter(canPlayAudioFormat).forEach(function (audioFormat) {
// Place container overrides before direct profile for remux container override
if (audioFormat == 'mp3' && !canPlayMp3VideoAudioInHls) {
// mp3 is a special case because it is allowed in hls-fmp4 on the server-side
// but not really supported in most browsers
profile.DirectPlayProfiles.push({
Container: 'ts',
AudioCodec: 'mp3',
Type: 'Audio'
});
}
profile.DirectPlayProfiles.push({
Container: audioFormat,
Type: 'Audio'