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
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ Jonas Birmé <[email protected]>
Jozef Chúťka <[email protected]>
Jun Hong Chong <[email protected]>
Jürgen Kartnaller <[email protected]>
Justin Swaney <[email protected]>
JW Player <*@jwplayer.com>
Konstantin Grushetsky <[email protected]>
Lucas Gabriel Sánchez <[email protected]>
Expand Down
1 change: 1 addition & 0 deletions CONTRIBUTORS
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ Jozef Chúťka <[email protected]>
Julian Domingo <[email protected]>
Jun Hong Chong <[email protected]>
Jürgen Kartnaller <[email protected]>
Justin Swaney <[email protected]>
Konstantin Grushetsky <[email protected]>
Leandro Ribeiro Moreira <[email protected]>
Loïc Raux <[email protected]>
Expand Down
2 changes: 1 addition & 1 deletion lib/util/stream_utils.js
Original file line number Diff line number Diff line change
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.