Skip to content

Instantly share code, notes, and snippets.

@rymai
Created April 15, 2011 11:09
Show Gist options
  • Save rymai/921532 to your computer and use it in GitHub Desktop.
Save rymai/921532 to your computer and use it in GitHub Desktop.
SublimeVideo: Autoplay and loop (snippet)
<!-- Inside the <head> tag -->
<script type="text/javascript" src="http://cdn.sublimevideo.net/js/YOUR_TOKEN.js"></script>
<!-- Inside the <body> tag -->
<video id="video1" poster="posterframe.jpg" width="640" height="360" preload="none">
<source src="video.mp4" />
<source src="video.ogv" />
</video>
<!-- Just before </body> (or in the <head> tag) -->
<script type="text/javascript">
sublimevideo.ready(function(){
sublimevideo.prepareAndPlay("video1");
sublimevideo.onEnd(function(sv){
sublimevideo.play(sv.element);
});
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment