Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Fix seeking timeouts #6539

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions lib/media/playhead.js
Original file line number Diff line number Diff line change
Expand Up @@ -382,10 +382,10 @@ shaka.media.MediaSourcePlayhead = class {
seekStart = seekEnd - this.minSeekRange_;
}

if (currentTime < seekStart || currentTime > seekEnd) {
// playhead is outside of the seekrange. Move playhead to catch up.
if (currentTime < seekStart) {
// The seek range has moved past the playhead. Move ahead to catch up.
const targetTime = this.reposition_(currentTime);
shaka.log.info('Jumping by ' + (targetTime - currentTime) +
shaka.log.info('Jumping forward ' + (targetTime - currentTime) +
' seconds to catch up with the seek range.');
this.mediaElement_.currentTime = targetTime;
}
Expand Down
2 changes: 1 addition & 1 deletion test/media/playhead_unit.js
Original file line number Diff line number Diff line change
Expand Up @@ -682,7 +682,7 @@ describe('Playhead', () => {

// It should allow a small buffer around the seek range.
seekCount = 0;
currentTime = 1030;
currentTime = 1030.062441;
jasmine.clock().tick(500);
currentTime = 1027.9233;
jasmine.clock().tick(500);
Expand Down