Skip to content

Commit 21d773d

Browse files
aveladTAhub
andcommitted
fix: Fix disable captions after load using src= on Safari (#8841)
Fixes #8840 --------- Co-authored-by: Theodore Abshire <[email protected]>
1 parent 844e7ce commit 21d773d

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

lib/player.js

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3319,7 +3319,13 @@ shaka.Player = class extends shaka.util.FakeEventTarget {
33193319
this.loadEventManager_,
33203320
() => {
33213321
this.playhead_.ready();
3322-
fullyLoaded.resolve();
3322+
// We don't consider native HLS playback "fully loaded" until
3323+
// we have loaded the first frame. This gives the browser time
3324+
// to load caption information.
3325+
if (!this.mimeType_ ||
3326+
!shaka.util.MimeUtils.isHlsType(this.mimeType_)) {
3327+
fullyLoaded.resolve();
3328+
}
33233329
});
33243330

33253331
const waitForNativeTracks = () => {
@@ -3388,6 +3394,11 @@ shaka.Player = class extends shaka.util.FakeEventTarget {
33883394
}
33893395

33903396
this.setupPreferredTextOnSrc_();
3397+
3398+
if (this.mimeType_ &&
3399+
shaka.util.MimeUtils.isHlsType(this.mimeType_)) {
3400+
fullyLoaded.resolve();
3401+
}
33913402
});
33923403

33933404
if (mediaElement.error) {

0 commit comments

Comments
 (0)