I have a page of videos and am trying to tell if the vid has been played and update the play count. The following (with the PHP script) works fine if, and only if, the vid plays right to the end.
const vid = document.getElementsByTagName("video")[0];
vid.addEventListener("ended", function(e) {
console.log("Ended");
fetch("updVideoCount.php?id=<?=$id?>");
});
If someone watches the vid but leaves the page during the credits, the count is not updated.
Is there any way to check if the video is played for, say, a minute?