videojs-playbackrate-adjuster is a Video.js 7 middleware designed to dynamically adjust the displayed duration and current time in the Video.js control bar when the playback rate is changed. For instance, if a 20-minute video is played at 2x speed, the control bar will visually represent it as a 10-minute video, with the progress bar updating proportionally to the adjusted perceived duration. The current stable version is 1.0.1. This library primarily functions as a side-effect plugin, automatically attaching itself to the `videojs` global upon inclusion, without requiring explicit instantiation or assignment. It serves as a specific utility for enhancing the user experience in scenarios where playback speed manipulation is common, ensuring the UI accurately reflects the perceived playback progress rather than the absolute media time. The library's release cadence is not formally defined but typically aligns with compatibility needs for Video.js itself.
npm install videojs-playbackrate-adjusterVerified import paths — ran on the pinned version, not inferred.
Demonstrates initializing Video.js with the playback rate adjuster and observing the control bar's displayed duration change when the playback rate is altered.
Ensure your project uses a compatible version of `video.js`, preferably 7.x.
Understand that this is a UI-level adjustment. If you need to manipulate actual media timing, use Video.js's native API methods (e.g., `player.currentTime()`) or other plugins.
Always load `video.js` (e.g., via a `<script>` tag or `require`) before `videojs-playbackrate-adjuster`.
Ensure that the `video.js` script is loaded in your HTML before `videojs-playbackrate-adjuster.min.js`, or that `require('video.js')` executes before `require('videojs-playbackrate-adjuster')` in module environments.Always wrap player-specific operations within the `player.ready(function() { /* ... */ });` callback to ensure the player is fully initialized and its API methods are available.