TIL: How to use the HTML5 video tag
I have been messing around lately, jumping for one personal programming project to the next trying to find one that I am really interested in to add to my portfolio.
I haven't looked much into HTML5 so I thought I would go through the beginner HTML5 tutorials at w3schools.
One of the new features in HTML5 is the video tag which allows you to play videos in the browser without reliance on the flash video players that were previously used.
The syntax is pretty simple, if you want a video player to play the video movie.ogg, you would place the following code inside the body tag:
<video width="800" height="600" controls="controls">
<source src="movie.ogg" type="video/ogg" />
Your browser does not support the video tag.
</video>
If the browser does not support the video tag in HTML5 it will display the comment inside the video tag, in this case "Your browser does not support the video tag."
I also found an interesting table on Wikipedia about the supported video file formats by each browser.
Thanks to Dr Nic for the nice tutorial along with the Javascript and CSS for getting syntax highlighting working for the code samples in Tumblr.