cladera / videojs-offset

VideoJS plugin for play a segment of a video.
MIT License
64 stars 43 forks source link

Update currentTime value in Video.js cache #58

Closed chdh closed 3 years ago

chdh commented 3 years ago

fixes #43

The source of the problem is: In Video.js, SeekBar.getCurrentTime_() retrieves the current video position from the cache when the player is in scrubbing mode (i.e. while the mouse button is down). The cached currentTime value is set at the end of Player.currentTime(). The videojs-offset plugin overrides Player.currentTime() and modifies the returned value, but the original (wrong) currentTime value gets cached. This patch fixes that by updating the cached value.

See: getCurrentTime_() in seek-bar.js currentTime() in player.js

cboissel-onf commented 3 years ago

This fix interests me, thanks @chdh. @cladera do you have any idea when you will be able to merge it?

cladera commented 3 years ago

Thank you very much @chdh! The fix looks great. I had to cherry picked your commit though because it was not following conventional commit and I wanted the commit to appear in the Changelog.