From 28f6c05acb10e08d9fbc7735ea1a58c8f400c24c Mon Sep 17 00:00:00 2001 From: Thomas Forgione Date: Wed, 24 Mar 2021 08:18:46 +0100 Subject: [PATCH] I don't like this way of doing record position --- index.html | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/index.html b/index.html index 0406ba1..1fd5cf3 100644 --- a/index.html +++ b/index.html @@ -23,8 +23,7 @@ if (app.ports !== undefined && app.ports.registerVideo !== undefined) { app.ports.registerVideo.subscribe(function(args) { window.scrollTo(0, 0); - var time = vd.parseTime(args[2]); - time = time || vd.parseTime(localStorage.getItem(args[0])); + var time = vd.parseTime(args[2]) || undefined; requestAnimationFrame(function() { if (args[0] !== lastId) { @@ -39,8 +38,6 @@ player.currentTime(time); } }); - - setTimeout(recordPosition, 1000); }); } @@ -50,13 +47,6 @@ lastId = undefined; }); } - - function recordPosition() { - if (lastId !== undefined) { - localStorage.setItem(lastId, player.currentTime()); - setTimeout(recordPosition, 1000); - } - }