Created
February 24, 2013 09:06
-
-
Save miccheng/5023187 to your computer and use it in GitHub Desktop.
Testing video tag.
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> | |
| <title>Video Tag Test</title> | |
| <style type="text/css"> | |
| video{ | |
| border: 1px solid #000; | |
| } | |
| </style> | |
| </head> | |
| <body> | |
| <div> | |
| <h1>Video Here</h1> | |
| <div> | |
| <video width="640" id="advideo"> | |
| <source src="" type="video/mp4"> | |
| </video> | |
| </div> | |
| </div> | |
| <script type="text/javascript"> | |
| var videos = ['a.webm', 'b.webm', 'c.webm', 'd.webm']; | |
| var vid, n = 0, rooturl = 'http://vloopbug.webconverger.com/'; | |
| vid = document.getElementById('advideo'); | |
| vid.src = rooturl + videos[n]; | |
| vid.addEventListener('ended', function(){ | |
| n++; | |
| this.src = rooturl + videos[n]; | |
| this.play(); | |
| if (n == 3) n = -1; | |
| }); | |
| vid.play(); | |
| </script> | |
| </body> | |
| </html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment