Skip to content

Instantly share code, notes, and snippets.

@ghinch
Created March 30, 2010 15:09
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 ghinch/349174 to your computer and use it in GitHub Desktop.
Save ghinch/349174 to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html>
<head>
<title>Test Media</title>
<script type="text/javascript" src="http://yui.yahooapis.com/combo?3.1.0pr5/build/yui/yui-min.js"></script>
</head>
<body>
<video width="640" height="480" controls autoplay>
<source type="video/mp4" src="video.mp4">
<source type="video/ogg" src="video.ogg">
</video>
<script type="text/javascript">
//<!--
YUI().use('node', 'event', function (Y) {
var v = Y.one('video'),
vEl = document.getElementsByTagName('video')[0];
v.after('timeupdate', function () {
// Does not fire
console.log('yui3 node timeup');
});
Y.after('timeupdate', function () {
// Does not fire
console.log('yui3 event timeup');
}, v);
vEl.addEventListener('timeupdate', function (e) {
// Fires
console.log('browser event timeup');
}, true);
//-->
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment