From 070ff8eb32c7b88571227da2eadbe0f32c6f18d2 Mon Sep 17 00:00:00 2001 From: Justin Swaney Date: Thu, 15 Feb 2024 19:17:07 -0600 Subject: [PATCH] fix: Fix detection of flac support on Safari (#6250) 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 --- AUTHORS | 1 + CONTRIBUTORS | 1 + lib/util/stream_utils.js | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/AUTHORS b/AUTHORS index 74bff17d9e..eae29e18a1 100644 --- a/AUTHORS +++ b/AUTHORS @@ -54,6 +54,7 @@ Jonas Birmé Jozef Chúťka Jun Hong Chong Jürgen Kartnaller +Justin Swaney JW Player <*@jwplayer.com> Konstantin Grushetsky Lucas Gabriel Sánchez diff --git a/CONTRIBUTORS b/CONTRIBUTORS index 017b50a658..484a534bec 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -82,6 +82,7 @@ Jozef Chúťka Julian Domingo Jun Hong Chong Jürgen Kartnaller +Justin Swaney Konstantin Grushetsky Leandro Ribeiro Moreira Loïc Raux diff --git a/lib/util/stream_utils.js b/lib/util/stream_utils.js index 64293ccb91..f63630d268 100644 --- a/lib/util/stream_utils.js +++ b/lib/util/stream_utils.js @@ -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'; }