Not until you finish watching your YouTubes, mister.
September 20, 2011 10:32 AM   Subscribe

Is there some way (maybe with javascript?) to track how much of an embedded YouTube video someone has watched on my website?

I want to embed a longish YouTube video and keep track of whether or not my users have watched (or rather played) it from beginning to end. Ideally, the system would be able to tell the difference between them having actually watched it and them having simply advanced the head to moments before the end.

I would also like, if they have only watched part of it, to save their timestamp so that I can queue it up to that point next time they return to the page. It would be ideal if this timestamp saving could be done automatically when they navigate away, but if it can only be done with a "save timestamp" button, that's okay.

I know that the YouTube player tracks these things, but is there any way for me to get access to the information?

Unfortunately, it has to be YouTube.
posted by 256 to Computers & Internet (1 answer total)
Best answer: The YouTube Javascript API has some hooks for doing this

You'll need to add an event listener to capature the start/stop events.

Then query the current playback status for duration
posted by bitdamaged at 10:43 AM on September 20, 2011 [3 favorites]

« Older did I just watch The Last Unicorn too many times?   |   Help me put the 'fun' in 'funeral.' Newer »
This thread is closed to new comments.