You have to break down the big problem into smaller problems.
First, you need to get your video's duration :
var vid = document.getElementById("myVideo");
duration = vid.duration;
Next, you need to get the scroll amount in percentage
function getVerticalScrollPercentage (elm) {
var p = elm.parentNode
return (elm.scrollTop || p.scrollTop) / (p.scrollHeight - p.clientHeight ) * 100
}
Next, you need to dynamically set your video's currentTime (in seconds), you can do it this way :
vid.currentTime = duration * percentage / 100;
And finally, you need to set the currentTime again, whenever the scroll amount changes. That is achieved by using an event listener, on the body
for example.
object.addEventListener("scroll", myScript);
Now put it all together :)