Skip to content

Commit

Permalink
fix: call to load in MediaElement using src= in HLS Safari (#6478)
Browse files Browse the repository at this point in the history
Fixes #6447
  • Loading branch information
avelad committed Apr 26, 2024
1 parent da7863d commit 064c3b7
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions lib/player.js
Expand Up @@ -2596,6 +2596,15 @@ shaka.Player = class extends shaka.util.FakeEventTarget {
mediaElement.load();
}

// In Safari using HLS won't load anything unless you call load()
// explicitly, no matter the value of the preload attribute.
// Note: this only happens when there are not autoplay.
if (mediaElement.preload != 'none' && !mediaElement.autoplay &&
shaka.util.MimeUtils.isHlsType(mimeType) &&
shaka.util.Platform.safariVersion()) {
mediaElement.load();
}

// Set the load mode last so that we know that all our components are
// initialized.
this.loadMode_ = shaka.Player.LoadMode.SRC_EQUALS;
Expand Down

0 comments on commit 064c3b7

Please sign in to comment.