From ca27fa0ee2b3f317e8ffb719a018671000155c2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lvaro=20Velad=20Galv=C3=A1n?= Date: Fri, 17 Jan 2025 11:06:21 +0100 Subject: [PATCH] fix: Use infiniteLiveStreamDuration equal to true in Safari 17 or above (#7901) Fixes https://github.com/shaka-project/shaka-player/issues/7899 --- externs/shaka/player.js | 8 +++++--- lib/util/player_configuration.js | 5 +++++ 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/externs/shaka/player.js b/externs/shaka/player.js index 29e38cb80c..da4da63093 100644 --- a/externs/shaka/player.js +++ b/externs/shaka/player.js @@ -1798,10 +1798,12 @@ shaka.extern.LiveSyncConfiguration; *
* Defaults to 0.5. * @property {boolean} infiniteLiveStreamDuration - * If true, the media source live duration - * set as aInfinity + * If true, the media source duration of livestreams will be set + * to Infinity. Otherwise, it will be set to a high but + * non-infinite number (2^32). *
- * Defaults to false. + * Defaults to false except on Safari 17 or above whose default + * value is true. * @property {number} preloadNextUrlWindow * The window of time at the end of the presentation to begin preloading the * next URL, such as one specified by a urn:mpeg:dash:chaining:2016 element diff --git a/lib/util/player_configuration.js b/lib/util/player_configuration.js index 6965da0a6c..84fc172153 100644 --- a/lib/util/player_configuration.js +++ b/lib/util/player_configuration.js @@ -274,6 +274,11 @@ shaka.util.PlayerConfiguration = class { shaka.util.Platform.isTizen(), }; + const safariVersion = shaka.util.Platform.safariVersion(); + if (safariVersion && safariVersion >= 17) { + streaming.infiniteLiveStreamDuration = true; + } + // WebOS, Tizen, Chromecast and Hisense have long hardware pipelines // that respond slowly to seeking. // Therefore we should not seek when we detect a stall