From 9cb92eb96ec38a7eec7604210fcff74d6ec5dff5 Mon Sep 17 00:00:00 2001 From: baconz Date: Wed, 19 Jul 2023 11:45:06 -0700 Subject: [PATCH] fix: Gap jump at start when first jump lands in a new gap (#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. --- lib/media/gap_jumping_controller.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/media/gap_jumping_controller.js b/lib/media/gap_jumping_controller.js index 27d93ab6c1..fa45c7979d 100644 --- a/lib/media/gap_jumping_controller.js +++ b/lib/media/gap_jumping_controller.js @@ -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));