I made website if the user client the play button the video will play smoothly but when the video plays for sec then it stops playing.
jQuery(document).ready(function($){
var ppbutton = document.getElementById("vidbutton");
ppbutton.addEventListener("click", playPause);
myVideo = document.getElementById("video1");
function playPause() {
if (myVideo.paused) {
myVideo.play();
ppbutton.innerHTML = "Pause";
}
else {
myVideo.pause();
ppbutton.innerHTML = "Play";
}
}
});
But that causes the error: Uncaught (in promise) DOMException: The play() request was interrupted by a call to pause(). Coming up everytime but the video plays an stop brings up the error message again everytime clicking on the play button.