Skip to content

Instantly share code, notes, and snippets.

@jabley
Created January 27, 2012 10:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jabley/1688272 to your computer and use it in GitHub Desktop.
Save jabley/1688272 to your computer and use it in GitHub Desktop.
Script to show video events in HTML5
// Investigating http://www.w3.org/2010/05/video/mediaevents.html
// Firefox creates pause and play events when seeking / seeked on a playing video, Chrome does not.
// Execute this script in Firebug console or similar to capture events
var script = document.createElement("script");
script.src = "http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js";
document.getElementsByTagName("head")[0].appendChild(script);
$("#video").bind("play", function() {console.log("play " + new Date()); })
$("#video").bind("pause", function() {console.log("pause " + new Date()); })
$("#video").bind("seeking", function() {console.log("seeking " + new Date()); })
$("#video").bind("seeked", function() {console.log("seeked " + new Date()); })
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment