Video.js: Disable mouse seeking on visible control bar

Created on 2 Oct 2013  路  8Comments  路  Source: videojs/video.js

Is there option for video seeking to be disabled? But the control bar and seek bar to be still visible.

question

All 8 comments

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:

http://jsfiddle.net/42jA2/2/

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?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

stephanedemotte picture stephanedemotte  路  4Comments

zhulduz picture zhulduz  路  3Comments

d3x7r0 picture d3x7r0  路  4Comments

borm picture borm  路  3Comments

kocoten1992 picture kocoten1992  路  4Comments