Change the video playback speed using video.js
I've the same issue. I just found that:
videojs('my-player', {
playbackRates: [0.5, 1, 1.5, 2]
});
see videojs docs
From videojs v.4.6.0 on there is a JSON parameter for data-setup
that you can pass to add the playback speed option to the videoplayer:
<video id="my_video_1" class="video-js vjs-default-skin" controls
preload="auto" width="640" height="268"
data-setup='{ "playbackRates": [0.5, 1, 1.5, 2] }'>
Demo: http://jsbin.com/vikun/1/edit?html,output
Credits: https://stackoverflow.com/a/24767026/1066234
Note: You must use double quotes for the parameters within data-setup
.
-
Helpful: If you need to change the speed after the videoplayer is ready (Jquery), use:
var video = videojs('videoplay', options);
video.ready(function() {
// faster speed initially
this.playbackRate(1.5);
});