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

Prevent seeking/scrubbing (7.12.3)


I've tried implementing something like this

var seeking = false;
var currentPosition = 0;

player.onTime(function (callback) {
currentPosition = callback.position;
});

player.onSeek(function(ev) {
var localPosition = currentPosition;
if (!seeking) {
seeking = true;
player.seek(localPosition);

console.log(localPosition);
} else {
seeking = false;
}
});

The seek event gets hit but somehow there is no "going back", it behaves as if the seek is wrongly called.
I'd appreciate some help.

Thanks,

1 Community Answers

Todd

JW Player Support Agent  
0 rated :

Your code is working for me in Chrome 62 on a test page at http://qa.jwplayer.com/~todd/jw7-prevent-seeking.html.

What is the link to your test page?

This question has received the maximum number of answers.