This videojs plugin allows you to disable video progress. Useful for preroll videos where you need to disable the user from progressing/scrubbing the video.
Download videojs
In your web page:
var enabled = false;
videojs("example_video_1").ready(function () {
this.disableProgress();
if(enabled){
this.disableProgress.enable();
}
else{
this.disableProgress.disable();
}
});
Want to auto disable the controls, use the autoDisable option:
videojs("example_video_1").ready(function () {
var player = this;
player.disableProgress({
autoDisable: true
});
});
Use the tiny api to enable/disable through js:
videojs("example_video_1").ready(function () {
var player = this;
player.disableProgress();
//something changes where you need to disable:
player.disableProgress.disable();
//some awesome event happens when you need to enable:
player.disableProgress.enable()
});
Check out example.html to see Disable Progress in action.