Is there option for video seeking to be disabled? But the control bar and seek bar to be still visible.
We do that during our prerolls via css:
.vjs-progress-control {
display: none;
}
I wrote a plugin for that, haven't had time to make it public. Hope this helps. You can toggle it by calling disable/enable and still visually see the progress.
Plugin:
https://github.com/rsadwick/videojs-disable-progress
jfiddle:
http://jsfiddle.net/rsadwick/Qmeat/
Nice plugin @rsadwick.
You could also try pointer-events: none; on the vjs-progress-control, though that's not supported in IE < 11
@rsadwick did a great plugin, thank you.
How can I disable video seeking only for a upcoming part of video? The mentioned plugin disables it in total but if I want to be able to jump back in video it does not let you it. Currently I'm using this awkward way:
me.video.addListener('timeupdate', function() {
if (Math.floor(me.video.getCurrentTime()) > options.maxSecondsSeek) {
me.video.pause();
me.video.setCurrentTime(timeBeforeChange);
me.video.play();
} else if (Math.floor(me.video.getCurrentTime()) == options.maxSecondsSeek) {
me.options.maxSecondsSeek += 1;
}
timeBeforeChange = me.video.getCurrentTime();
});
This will disable seeking over non-seen video part, but allows jump back in time. Is there any better way to accomplish that?
@rebendajirijr,
Here is a quick example. This will disable the progress in the video between 3 - 9 seconds. You can change it through the timeCode obj:
var video = document.querySelector('video');
var player = videojs(video);
// initialize the plugin, passing in autoDisable
player.disableProgress({
autoDisable: true
});
var timeCode = {
start: 3,
end: 9
}
player.on('timeupdate', function (e) {
if (this.currentTime() >= timeCode.start && this.currentTime() <= timeCode.end) {
this.disableProgress.disable();
} else {
this.disableProgress.enable();
}
});
@rsadwick Your plugin is perfect. Thank you so much !
@rsadwick is there a way to prevent user seeking / ff / scrubbing until the video has been watched?
I mean: progress is disable while watching the video, but if I am at second 10 I can go back to second 5 and again move ff to second 10... is this possible?