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: #6232, #6234, #6370, #6372
  • Loading branch information
amtins committed Nov 29, 2023
1 parent 720eecf commit 9c6225b
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 @@ -2509,6 +2509,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 9c6225b

Please sign in to comment.