Skip to content

Commit

Permalink
fix: Fix detection of flac support on Safari (#6250)
Browse files Browse the repository at this point in the history
When constructing the MediaDecodingConfigurations to query media capabilities in `stream_utils.js`, the spelling of "fLaC" should not change to "flac" on Safari. This is because on Safari the query will return `supported: false` for "flac" but `supported: true` for "fLaC".

This change allows manifests with "fLaC" codecs to work properly on Safari when using MSE / Managed Media Source.

Fixes #6249
  • Loading branch information
jmswaney authored and joeyparrish committed Feb 20, 2024
1 parent 0e37f4a commit 070ff8e
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions AUTHORS
Expand Up @@ -54,6 +54,7 @@ Jonas Birmé <jonas.birme@eyevinn.se>
Jozef Chúťka <jozefchutka@gmail.com>
Jun Hong Chong <chongjunhong@gmail.com>
Jürgen Kartnaller <kartnaller@lovelysystems.com>
Justin Swaney <justin.mark.swaney@gmail.com>
JW Player <*@jwplayer.com>
Konstantin Grushetsky <github@grushetsky.net>
Lucas Gabriel Sánchez <unkiwii@gmail.com>
Expand Down
1 change: 1 addition & 0 deletions CONTRIBUTORS
Expand Up @@ -82,6 +82,7 @@ Jozef Chúťka <jozefchutka@gmail.com>
Julian Domingo <juliandomingo@google.com>
Jun Hong Chong <chongjunhong@gmail.com>
Jürgen Kartnaller <kartnaller@lovelysystems.com>
Justin Swaney <justin.mark.swaney@gmail.com>
Konstantin Grushetsky <github@grushetsky.net>
Leandro Ribeiro Moreira <leandro.ribeiro.moreira@gmail.com>
Loïc Raux <loicraux@gmail.com>
Expand Down
2 changes: 1 addition & 1 deletion lib/util/stream_utils.js
Expand Up @@ -839,7 +839,7 @@ shaka.util.StreamUtils = class {
// currently don't support 'fLaC', while 'flac' is supported by most
// major browsers.
// See https://bugs.chromium.org/p/chromium/issues/detail?id=1422728
if (codecs === 'fLaC') {
if (codecs === 'fLaC' && !shaka.util.Platform.isSafari()) {
return 'flac';
}

Expand Down

0 comments on commit 070ff8e

Please sign in to comment.