Reputation: 1
Is there a way to log events like starting, stopping, playing, pausing online videos? Is there a unique way for all types of online videos? I'm building google chrome extension and i would like to capture all such events in it. Thanks for help!
Upvotes: 0
Views: 423
Reputation: 21517
Add listeners for all video events. In a form of:
var logger = function(e) {console.log(e); };
video.addEventListener('play', logger, false);
video.addEventListener('pause', logger, false);
Of course, this will only work for HTML5 videos, not Flash or other plugins.
Upvotes: 1
Reputation: 27765
Most online videos based on flash players, QuickTime plugins, HTML5 elements etc. There is no universal way to handle all this kinds of video. You need to write specific handlers for events for each type of video player, for each site.
For example YouTube and Vimeo has different flash players and different HTML5 objects for HTML5 video player. You need to see source of html of YouTube and Vimeo to see how it work and then try to write event handlers, but this will be different for other sites.
Upvotes: 1