The question is pretty old, but still relevant, so here is my solution:
var video = document.getElementById('video'); var supposedCurrentTime = 0; video.addEventListener('timeupdate', function() { if (!video.seeking) { supposedCurrentTime = video.currentTime; } }); // prevent user from seeking video.addEventListener('seeking', function() { // guard agains infinite recursion: // user seeks, seeking is fired, currentTime is modified, seeking is fired, current time is modified, .... var delta = video.currentTime - supposedCurrentTime; if (Math.abs(delta) > 0.01) { console.log("Seeking is disabled"); video.currentTime = supposedCurrentTime; } }); // delete the following event handler if rewind is not required video.addEventListener('ended', function() { // reset state in order to allow for rewind supposedCurrentTime = 0; });
Jsfiddle
This is a playerโs agnostic, it works even when the default controls are displayed, and they cannot be bypassed even when entering the code in the console.
source share