Skip to content

Instantly share code, notes, and snippets.

@miccheng
Created February 24, 2013 09:06
Show Gist options
  • Select an option

  • Save miccheng/5023187 to your computer and use it in GitHub Desktop.

Select an option

Save miccheng/5023187 to your computer and use it in GitHub Desktop.
Testing video tag.
<!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