This shows you the differences between two versions of the page.
media_links [2015/01/16 14:54] wbeckett created |
media_links [2021/06/04 02:16] |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== HTML5 Media Links ====== | ||
- | |||
- | |||
- | syncing content with video: [[http://www.smashingmagazine.com/2011/03/11/syncing-content-with-html5-video/ | Sync]] | ||
- | |||
- | <code> | ||
- | <div id="stage"> | ||
- | <video src="http://vid.ly/4f3q1f?content=video" controls></video> | ||
- | <div id="time"></div> | ||
- | </div> | ||
- | <script> | ||
- | (function(){ | ||
- | var v = document.getElementsByTagName('video')[0] | ||
- | var t = document.getElementById('time'); | ||
- | v.addEventListener('timeupdate',function(event){ | ||
- | t.innerHTML = parseInt(v.currentTime) + ' - ' + v.currentTime; | ||
- | },false); | ||
- | })(); | ||
- | </script> | ||
- | </code> | ||
- | |||
- | |||
- | |||