use beforeunload :3

This commit is contained in:
Ashley //// 2024-04-21 03:16:07 +00:00
parent e5a6092a25
commit 1af6240596

View file

@ -183,10 +183,8 @@ function resumeProgress() {
} }
} }
video.addEventListener('timeupdate', () => { window.addEventListener('beforeunload', () => {
if (Math.floor(video.currentTime) % 5 === 0) {
saveProgress(); saveProgress();
}
}); });
video.addEventListener('ended', () => { video.addEventListener('ended', () => {