From d59323a60162dec8f0fc8f4a8b74199c0f6e30cc Mon Sep 17 00:00:00 2001 From: 11Tuvork28 Date: Fri, 31 Dec 2021 03:24:08 +0100 Subject: [PATCH] Add check to avoid saving player pos to the length of the given video by saving a minimum of 15 at the end --- assets/js/player.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets/js/player.js b/assets/js/player.js index 0cc4bab9..d45ff5d0 100644 --- a/assets/js/player.js +++ b/assets/js/player.js @@ -215,7 +215,7 @@ if (video_data.params.save_player_pos) { const raw = player.currentTime(); const time = Math.floor(raw); - if(lastUpdated !== time) { + if(lastUpdated !== time && raw <= video_data.length_seconds - 15) { save_video_time(time); lastUpdated = time; }