TimeMe.js icon indicating copy to clipboard operation
TimeMe.js copied to clipboard

Not working correctly when user watches a video on a page

Open nerra0pos opened this issue 8 years ago • 5 comments

When a user is watching a video e.g. YouTube embedded on the page, he fastly goes idle with your script (not accounting the view time of a video).

It would be good, if you could implement a beacon function which could be triggered manually in order to let the script continue measuring time.

nerra0pos avatar Aug 16 '17 06:08 nerra0pos

TimeMe.resetIdleCountdown() seems to do what you are asking...

glappen avatar May 10 '18 18:05 glappen

Any working solution ? @terrapop How did you solve this problem?

javatechy avatar May 07 '19 13:05 javatechy

I tried this approach, using the following code:

                            iframePlayer.on('timeupdate', function(data){
                                TimeMe.resetIdleCountdown();
                            });

However it doesn't do anything at all, I can see using a console.log that it's really executed (about four times per secnd) but still it doesn't seem to count the time I'm spending in my video player iframe. Any clues?

DanielMalmgren avatar Oct 10 '19 07:10 DanielMalmgren

Hi again. Found a PR that completely solved this problem: https://github.com/jasonzissman/TimeMe.js/pull/59

DanielMalmgren avatar Oct 10 '19 08:10 DanielMalmgren

I have pushed a new solution for this issue and I would love to have your feedback on it: https://github.com/jasonzissman/TimeMe.js/pull/77

zvictor avatar Nov 12 '22 11:11 zvictor