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

feat: add an option to handle smooth seeking #1

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

amtins
Copy link
Owner

@amtins amtins commented May 19, 2023

Description

Screencast.from.19.05.23.16.56.16.webm

Specific Changes proposed

Requirements Checklist

  • Feature implemented / Bug fixed
  • If necessary, more likely in a feature request than a bug fix
    • Change has been verified in an actual browser (Chrome, Firefox, IE)
    • Unit Tests updated or fixed
    • Docs/guides updated
    • Example created (starter template on JSBin)
  • Reviewed by Two Core Contributors

@amtins amtins force-pushed the feat/seek-bar-smooth-seeking branch from 8292be6 to 49bc1c7 Compare May 20, 2023 18:44
@amtins amtins force-pushed the feat/seek-bar-smooth-seeking branch 2 times, most recently from 11de73b to 396e196 Compare June 2, 2023 20:15
…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
Adds a player option called enableSmoothSeeking, which is false by default,
to provide a smoother seeking experience on mobile and desktop devices.

Usage:
```javascript
// Enables the smooth seeking
const player = videojs('player', {enableSmoothSeeking: true});

// Disable the smooth seeking
player.options({enableSmoothSeeking: false});
```

- **player.js** add an `option` called `enableSmoothSeeking`
- **time-display.js** add a listener to the `seeking` event if `enableSmoothSeeking` is `true` allowing to update the `CurrentTimeDisplay` and `RemainingTimeDisplay` in real time
- **seek-bar.js** `update` the seek bar on `mousemove` event  if `enableSmoothSeeking` is `true`
- add test cases
@amtins amtins force-pushed the feat/seek-bar-smooth-seeking branch from 396e196 to 5b8b883 Compare November 29, 2023 09:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant