From 63e464e96cff86ae60a5c74edb26faf5fb258878 Mon Sep 17 00:00:00 2001 From: HarithaKintali <46102337+HarithaKintali@users.noreply.github.com> Date: Wed, 5 Jun 2019 16:54:21 +0530 Subject: [PATCH 1/2] Dwell time calculation while a video in iFrame is getting played When a user clicks on any iFrame Timer will stop as window gets blur. Timer will start again only when it gets focus. It will get focus by clicking on the page. So in addition to that now timer will also start when user moves mouse on screen. --- timeme.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/timeme.js b/timeme.js index 1fc57a4..450d5b4 100644 --- a/timeme.js +++ b/timeme.js @@ -320,7 +320,10 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. TimeMe.triggerUserHasReturned(); }); - document.addEventListener("mousemove", function () { TimeMe.resetIdleCountdown(); }); + document.addEventListener("mousemove", function () { + window.focus(); + TimeMe.resetIdleCountdown(); + }); document.addEventListener("keyup", function () { TimeMe.resetIdleCountdown(); }); document.addEventListener("touchstart", function () { TimeMe.resetIdleCountdown(); }); window.addEventListener("scroll", function () { TimeMe.resetIdleCountdown(); }); From 0b3b92077c21db2cae74f0c7d40a296b448a0d5b Mon Sep 17 00:00:00 2001 From: HarithaKintali <46102337+HarithaKintali@users.noreply.github.com> Date: Thu, 6 Jun 2019 10:49:46 +0530 Subject: [PATCH 2/2] Fix in code --- timeme.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/timeme.js b/timeme.js index 450d5b4..89d91f7 100644 --- a/timeme.js +++ b/timeme.js @@ -321,8 +321,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. }); document.addEventListener("mousemove", function () { - window.focus(); TimeMe.resetIdleCountdown(); + window.focus(); }); document.addEventListener("keyup", function () { TimeMe.resetIdleCountdown(); }); document.addEventListener("touchstart", function () { TimeMe.resetIdleCountdown(); });