Skip to content

Commit

Permalink
fix: Use infiniteLiveStreamDuration equal to true in Safari 17 or abo…
Browse files Browse the repository at this point in the history
…ve (#7901)

Fixes #7899
  • Loading branch information
avelad authored Jan 17, 2025
1 parent 8fda5d8 commit 5005fac
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
8 changes: 5 additions & 3 deletions externs/shaka/player.js
Original file line number Diff line number Diff line change
Expand Up @@ -1826,10 +1826,12 @@ shaka.extern.LiveSyncConfiguration;
* <br>
* Defaults to <code>0.5</code>.
* @property {boolean} infiniteLiveStreamDuration
* If <code>true</code>, the media source live duration
* set as a<code>Infinity</code>
* If <code>true</code>, the media source duration of livestreams will be set
* to <code>Infinity</code>. Otherwise, it will be set to a high but
* non-infinite number (2^32).
* <br>
* Defaults to <code>false</code>.
* Defaults to <code>false</code> except on Safari 17 or above whose default
* value is <code>true</code>.
* @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
Expand Down
5 changes: 5 additions & 0 deletions lib/util/player_configuration.js
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,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
Expand Down

0 comments on commit 5005fac

Please sign in to comment.