I have a video which I pause with javascript by adding addEventListener.
<video id="home-hero-video" preload autoplay="autoplay" muted="muted">
<source src="videourl.mp4" type="video/mp4">
</video>
The video is on autoplay and when the video reach the 5s it pause.
var video = document.getElementById('home-hero-video');
video.addEventListener("timeupdate", function () {
if (this.currentTime >= 5.000) {
this.pause();
}
}, false);
What I want is on scroll down the video to start/resume playing again from the 5s to the end.
var scrollableElement = document.body;
scrollableElement.addEventListener('wheel', checkScrollDirection);
function checkScrollDirection(event) {
if (checkScrollDirectionIsUp(event)) {
// console.log('scroll UP');
} else {
video.removeEventListener("timeupdate");
video.play();
}
}