Skip to content

Instantly share code, notes, and snippets.

@Plou
Created June 13, 2013 12:16
Show Gist options
  • Save Plou/5773228 to your computer and use it in GitHub Desktop.
Save Plou/5773228 to your computer and use it in GitHub Desktop.
Html video tag & javascript to access it.
<video id="player" preload="auto" controls autoplay poster="img/thumb.jpg">
<source src="http://www.nicolas-hoffmann.net/animations/Cavernae_Terragen2.mp4" type="video/mp4" />
<source src="http://www.nicolas-hoffmann.net/animations/Cavernae_Terragen2.webm" type="video/webm" />
<source src="http://www.nicolas-hoffmann.net/animations/Cavernae_Terragen2.theora.ogv" type="video/ogg" />
Alternate content
</video>
var $video = $('#player'),
video = $video.get(0),
currentTime = video.currentTime;
$video.bind("timeupdate", function() {
currentTime = Math.round(this.currentTime-0.5);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment