Skip to content

Commit

Permalink
fix(player): cache_.currentTime is not updated when the current time …
Browse files Browse the repository at this point in the history
…is set

Updating cache_.currentTime as soon as the currentTime is set avoids having to wait for the timeupdate event, which results in:

- making cache_.currentTime more reliable
- updating the progress bar on mouse up after dragging when the media is paused.

See also: videojs#6232, videojs#6234, videojs#6370, videojs#6372
  • Loading branch information
amtins committed Jun 2, 2023
1 parent ce50541 commit 7bf0759
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/js/player.js
Original file line number Diff line number Diff line change
Expand Up @@ -2486,6 +2486,10 @@ class Player extends Component {

this.techCall_('setCurrentTime', seconds);
this.cache_.initTime = 0;

if (isFinite(seconds)) {
this.cache_.currentTime = Number(seconds);
}
}

/**
Expand Down

0 comments on commit 7bf0759

Please sign in to comment.