I've successfully implemented a feature that pauses and plays the video on scroll when it reaches a certain pixel height. However, I'm facing an issue where the code automatically plays the video whenever the scroll position is more than 13500px from the top. Is there a way to prevent the video from playing if it has been manually paused using the control button, even during scrolling? Currently, the video resumes playing even after being paused.
$(document).ready(function() {
$(window).scroll(function() {
var vid = document.getElementById("video_1");
if($(document).scrollTop() > 13500) {
vid.play();
}
else {
vid.pause();
}
});
});