Thursday, October 25, 2012

HTML Video: Part 2


already wrote a post on HTML5 video. This expands on it and explains things like auto play. 
Master Code + controls = auto play, loop

To add loop, auto play and "poster" or image that's shown when the video first loads, use this code:
<video poster="thumbnail.png" autoplay loop controls tabindex="0">
  <source src="vide.webm" type="video/webm"; codecs="vp8, vorbis" />
  <source src="video.mp4" type="video/mp4"; codecs="theora, vorbis" />
</video>

Replace thumbnail.png with the URL of the pic you want to display when the video is first loaded, video.webm with the URL of the webm version of your video, video.mp4 with the URL of the mp4 version of your video. The autoplay and loop controls set what they sound like: autoplay making the video play upon loading and loop making the video repeat. More on HTML5 video is available at my former post.


Desktop

FeatureChromeFirefox (Gecko)Internet ExplorerOperaSafari
HTML5 video20.012.09.012.05.1

No comments:

Post a Comment

Feel free to comment. Keep it nice, polite and on topic. You may link to a site if it contains content relates to the content of whatever post you are commenting on. You may link to a site that only uses, for example, HTML5 video. Remember, on topic!