Created
October 4, 2011 20:49
-
-
Save dwynne/1262761 to your computer and use it in GitHub Desktop.
MediaElementJS Issue
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
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | |
| <title>HTML5 MediaElement</title> | |
| <script src="../build/mediaelement.js"></script> | |
| </head> | |
| <body> | |
| <video width="360" height="203" id="player1" src="http://video.ted.com/talks/podcast/AlGore_2006_480.mp4" | |
| type="video/mp4" controls="controls" preload="auto"> | |
| </video> | |
| <span id="time"></span> | |
| <script> | |
| var hasPlayedOnce = false; | |
| MediaElement('player1', { | |
| success: function (me) { | |
| me.addEventListener('progress', function () { | |
| document.getElementById('time').innerHTML = me.buffered.end(0); | |
| if (!hasPlayedOnce && me.buffered.end(0) > 20) { | |
| hasPlayedOnce = true; | |
| me.play(); | |
| } | |
| }, false); | |
| } | |
| }); | |
| </script> | |
| </body> | |
| </html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment