Delete play pos if less then 10 seconds of video remaining

This commit is contained in:
WardPearce
2024-03-09 19:22:29 +13:00
parent bfcceb58eb
commit dd14a18eaa
+5 -1
View File
@@ -50,7 +50,11 @@
onDestroy(async () => {
if (get(playerSavePlaybackPosition) && player?.currentTime) {
localStorage.setItem(data.video.videoId, player.currentTime.toString());
if (player.currentTime < player.duration - 10) {
localStorage.setItem(data.video.videoId, player.currentTime.toString());
} else {
localStorage.removeItem(data.video.videoId);
}
}
player = undefined;