Created
January 27, 2012 10:58
-
-
Save jabley/1688272 to your computer and use it in GitHub Desktop.
Script to show video events in HTML5
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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