From c7b8f470d8af269299ed47fda5538d0af03d9a8d Mon Sep 17 00:00:00 2001 From: Fijxu Date: Tue, 4 Jun 2024 12:54:27 -0400 Subject: [PATCH] Set the video time to 0 if the video has been watched ALMOST completly --- assets/js/player.js | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/assets/js/player.js b/assets/js/player.js index d32062c6..9d99e3c7 100644 --- a/assets/js/player.js +++ b/assets/js/player.js @@ -351,12 +351,8 @@ if (video_data.params.save_player_pos) { const rememberedTime = get_video_time(); let lastUpdated = 0; - if(!hasTimeParam) { - if (rememberedTime >= video_data.length_seconds - 20) - set_seconds_after_start(0); - else - set_seconds_after_start(rememberedTime); - } + if(!hasTimeParam) set_seconds_after_start(rememberedTime); + if (rememberedTime >= video_data.length_seconds - 20 && !hasTimeParam) set_seconds_after_start(0); player.on('timeupdate', function () { const raw = player.currentTime();