I'm creating a series of video tutorials and would like to prevent users from seeking forward and skipping sections. I'll be using an HTML5 video player that will be used for desktop and iPad browsers. Ideally, I'd like this to work on the iPhone as well, but I realize you have no control over the video on the phone since it uses the iPhone video player.
How can I prevent users from seeking forward on an HTML5 video player?
Thanks for your answer Rick.
I noticed that the user can drag and hold the seeker which allowed them to continue so I added where not seeking to the getPos function.HTML 5 and jQuery.
var video = document.getElementsByTagName('video')[0];
function allowMove() {
$('input[id$="btnNext"]').removeAttr('disabled');
$('input[id$="videoFlag"]').val("1");
}
function getpos() {
if (!(video.seeking)) {
curpos = video.currentTime;
}
console.log(curpos)
}
onesecond = setInterval('getpos()', 1000);
function setPos() {
var ct = video.currentTime;
if (ct > curpos) {
video.currentTime = curpos;
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With