Skip to content

Commit

Permalink
fix: Gap jump at start when first jump lands in a new gap (shaka-proj…
Browse files Browse the repository at this point in the history
…ect#5408)

This change accounts for a gap jump at the start of an asset that lands
the user user inside of another gap. The video element is still `paused`
at this point, but we've moved past the `startTime` because we jumped a
gap. Thus the gap jumper gets stuck, and playback will never start.
  • Loading branch information
baconz committed Jul 19, 2023
1 parent 7d049eb commit f56d49b
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/media/gap_jumping_controller.js
Expand Up @@ -243,6 +243,13 @@ shaka.media.GapJumpingController = class {
}

this.video_.currentTime = jumpTo;
// This accounts for the possibility that we jump a gap at the start
// position but we jump _into_ another gap. By setting the start
// position to the new jumpTo we ensure that the check above will
// pass even though the video is still paused.
if (currentTime == this.startTime_) {
this.startTime_ = jumpTo;
}
this.gapsJumped_++;
this.onEvent_(
new shaka.util.FakeEvent(shaka.util.FakeEvent.EventName.GapJumped));
Expand Down

0 comments on commit f56d49b

Please sign in to comment.