Name is required.
Email address is required.
Invalid email address
Answer is required.
Exceeding max length of 5KB

Disable seeking/scrubbing


There are a number of posts I have found on this topic and most do not give a conclusive answer.

We use the licenced player in our elearning solution. There are instances that a user must watch a madatory video before a page (in an online learning course) is marked complete. We have a custom plugin that runs the code needed to complete a page on the the video end event, but we have had issues with stopping a user scrubbing to the end of the video.

The obvious options are

- disable contolbar, easy enough but we look fullsreen, volume and progress bar.

- use a custom/modified skin, this is our current solution but we still get 2 blank timecode in the controlbar both set to 00.00.

My ideal solution would be to leave the seekbar, buffer and progress indicators and times as these are helpful on seeing how much is buffered, where you are in the video etc, but disable the users seek functionality.

I was hoping to achive this with a skin or plugin and not a modded player file as this means more work updating player on new releases.

Leigh



13 Community Answers

Pablo

JW Player Support Agent  
0 rated :

@Leigh -

There’s currently no way to disable the controlbar’s ability to seek. You should be able to remove the seek bar through skinning (http://www.longtailvideo.com/support/jw-player/jw-player-for-flash-v5/16018/customizing-the-controlbar-layout) – if that’s not working, please post a link to a page which demonstrates the problem.

Alternately, you could disable the built-in controlbar entirely, and create your own plugin which replicates the controlbar’s functionality. You can even reuse most of the existing controlbar’s source code.

JW Player

User  
0 rated :

I did this and it works great.

bc.. var seeking = false;
var currentPosition = 0;
jwplayer().onTime(function (callback) {
currentPosition = callback.position;
});

jwplayer().onSeek(function (position, offset) {
var localPosition = currentPosition;
if (!seeking) {
seeking = true;
jwplayer().seek(localPosition);
} else {
seeking = false;
}
});


Pablo

JW Player Support Agent  
0 rated :

Nice workaround! Thanks for sharing.

JW Player

User  
0 rated :

I am also in need of disabling seeking.

I am using the newest wordpress plugin for jwplayer, and I tried this solution, but unfortunately it doesn't work.

It is the first time I am trying to customize jwplayer through javascript,and I included jwplayer.js as stated in the javascript api reference, but it still doesn't work.

It would be ideal if I could make it work - can anyone give me some guidelines?

Thanks

JW Player

User  
1 rated :

I have a similar requirement and the above workaround works for me - exactly once :)

I start the video, attempt to seek ahead, it buffers then puts me right back to where I was. However, if I then attempt to seek again, I am able to go to any point in the video - at which time, that point becomes the new "start" point for the seek, i.e. it then resets once back to that point. Then, I can advance again.

I am using this snippet with the embedder - any ideas?

JW Player

User  
-1 rated :

The solution above works great in a browser. Any ideas on how to implement this on iPad?

JW Player

User  
-1 rated :

I modified the solution a bit to ONLY disallow forward-seeking past a yet-unwatched point. That is, backward-seeking is allowed and forward-seeking is allowed up to their furthest-watched point. This was tested against version 5.7.1896.

bc.. var seek_okay = false;
var max_seen = 0.0; // only allow forward-seeking to the furthest point they've watched
jwplayer().onSeek(function (position, offset) {
if (!seek_okay) {
max_seen = Math.max(max_seen, position.position);
if (position.offset > position.position) {
seek_okay = true;
setTimeout(function(){jwplayer().seek(Math.min(max_seen, position.offset))},100);
}
} else {
seek_okay = false;
}
});



Can't say for sure it will work for others. The setTimeout need was weird :/. I think it's because (in the release I'm using) the seeking happens AFTER the onSeek callback, and knocks out our seeking. I dunno, but there it is.

JW Player

User  
1 rated :

I updated mpn's code to show the full solution with the onTime event.
bc.. var maxPlayPosition = 0.0;
var seeking = false;
jwplayer().onTime(function (event) {
if (!seeking) {
maxPlayPosition = Math.max(event.position, maxPlayPosition);
}
});
jwplayer().onSeek(function (event) {
if (!seeking) {
if (event.offset > maxPlayPosition) {
seeking = true;
setTimeout(function () { jwplayer().seek(maxPlayPosition); }, 100);
}
} else {
// this happens when the timer triggers the onSeek event
seeking = false;
}
});



Also, for the LongTail developers, the reason we need to do this is we provide courses that have to be watched in their entirety to qualify for professional credits, so fast forwarding is not an option, although they can re-watch portions they already saw. It would be GREAT for the JWPlayer to add a "seek cancel" ability.

Pablo

JW Player Support Agent  
1 rated :

@CodeGrue -

We’re familiar with the use case, but can’t provide a good mechanism for this across all platforms. A good example of this is on iOS, where the browser’s video controls take over, and the user can seek anywhere in the video.

The best way to do this which will work everywhere would probably be some server-side logic, for example using Wowza Media Server.

JW Player

User  
1 rated :

Is it possible to disable seeking on Ipad .
I used the above code . it is working on browser other than ipad .
Any Solution ??

Pablo

JW Player Support Agent  
0 rated :

@Amit -

It is not possible to disable seeking on the iPad.

JW Player

User  
0 rated :

Hello PabloS

Thanks for replying but I am trying the onseek event on Ipad using
Jwplayer 5.9 and using Javascript API but still on seek event is not working on ipad

jwplayer("mediaplayer").setup({
flashplayer: "player.swf",
file: "video.mp4",
image: "preview.jpg",
events: {
onSeek: function() {
alert("On Seek Event called "); }
}
});

it is working on Other browser but not on Ipad. and you have stated that onseek should work on Ipad .

Please suggest if my code is lacking some thing

Thanks

Pablo

JW Player Support Agent  
0 rated :

@Amit -

This is actually a known limitation with the onSeek event on iOS:

http://www.longtailvideo.com/support/forums/jw-player/player-development-and-customization/26145/jw-player-onseek-event-work-with-html5-in-ios-devices-in-a-future-release

There’s a ticket for the 6.0 player to address this limitation:

http://developer.longtailvideo.com/trac/ticket/1630

This question has received the maximum number of answers.