Skip to content

Commit a5f0f8a

Browse files
committed
fix: Fix end-of-stream detection for VOD
PR #8603 refactored the conditions for being "buffered to the end". Two of these conditions from Player didn't fit in the new location (Playhead). One (this.isEnded()) was moved, and the other (this.mediaSourceEngine_.ended()) was dropped by accident. This restores the dropped condition inside isEnded(). Verified on Chromecast.
1 parent 80f407f commit a5f0f8a

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

lib/player.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9347,6 +9347,13 @@ shaka.Player = class extends shaka.util.FakeEventTarget {
93479347
if (!this.video_ || this.video_.ended) {
93489348
return true;
93499349
}
9350+
9351+
// This means that MediaSource has buffered the final segment in all
9352+
// SourceBuffers and is no longer accepting additional segments.
9353+
if (this.mediaSourceEngine_ && this.mediaSourceEngine_.ended()) {
9354+
return true;
9355+
}
9356+
93509357
return this.fullyLoaded_ && !this.isLive() &&
93519358
this.video_.currentTime >= this.seekRange().end;
93529359
}

0 commit comments

Comments
 (0)