@kokotree-inc/videojs-smooth-slider-plugin
Version:
A Video.js plugin that enhances the seek bar with smooth seeking functionality, allowing for a more responsive and precise user interaction during video playback. It overrides the default handleMouseMove and getPercent methods of the SeekBar component to
49 lines (30 loc) • 1.7 kB
Markdown
Enhance your Video.js player with smooth seeking capabilities using `videojs-smooth-slider-plugin`. This plugin provides an improved scrubbing experience, making the seek bar interactions more responsive and precise. It achieves this by customizing the `handleMouseMove` and `getPercent` methods of the Video.js `SeekBar` component.
Install the plugin into your project with npm:
```bash
npm install @kokotree-inc/videojs-smooth-slider-plugin
```
To integrate the plugin with your Video.js player:
```javascript
import videojs from "video.js";
import "@kokotree-inc/videojs-smooth-slider-plugin";
const player = videojs("my-video");
// Activate the smooth seek plugin with default settings
player.smoothSeek();
// Optionally, activate the plugin with custom settings
player.smoothSeek({
timeBuffer: 10, // time in seconds
});
```
- `timeBuffer`: (number) Specifies the time in seconds to buffer from the end of the video when seeking. This prevents the seek slider from reaching the very end of the video, which could inadvertently trigger the end of the video. Default is 5 seconds.
- **Smooth Scrubbing**: Offers a smoother and more intuitive seeking experience.
- **Video.js Compatibility**: Seamlessly integrates with the Video.js ecosystem.
- **Easy Integration**: Simple setup process with existing Video.js players.
Contributions to the `videojs-smooth-slider-plugin` are welcome. Please adhere to the established coding standards and include unit tests for any new or modified functionality.
This project is open-source and available under the [MIT License](LICENSE).