Logo
  Sunday, May 20, 2012
Sign-In  |  Sign-Up  |  Contact Us  | Bookmark |  RSS Feed

HTML5 Tutorial FeedBurner

HTML5 Video Sample Code  
In order to create HTML5 video page, we need to create video file itself. There are many different video file formats and HTML5 can work pretty much with all of them. However, there are video file types that work more effective with HTML5 video tag.

Our recommendation is to use one of the following types: H.264: .mp4 or .mov. MPEG-4 is quite popular these days and if you can create video file in .mp4 format that would be sufficient for our task. There are other HTML5 codec formats supported by various browsers.

Let’s begin coding by setting up our HTML5 boilerplate file and adding the HTML5 video tag with its src and preload attributes set to specific values.

<!DOCTYPE HTML>

   <html>

   <head>

   <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

   <title>My video File Sample Code</title>

   </head>

   <body>

   <video src="myVideoFile.mp4" preload="auto"></video>

   </body>

   </html>

Next step in our process is to save this file to your local drive and test it on one of the browser’s supporting the HTML5 video tag.

HTML5 Video
Viewing MyVideoFile.mp4 on Safari browser

Download HTML5 Video Tag sample code: Download HTML5 Video Code

Print HTML5 Video Sample Code Bookmark HTML5 Video Sample Code

Related Articles  
Custom HTML5 Video Controller
HTML5 video controller allows user to interact with your embedded video just like YouTube video player allows you to ...
HTML5 Baseline Codec Media Element
HTML5 baseline codec is a video and audio formats supported by all browsers. As a result, we can rely on this media ...
HTML5 Video Tag
HTML5 video tag is used to provide video content linkage within your HTML5 webpage. HTML5 video tag has "src" attribute ...
HTML5 Video Conferencing
The HTML5 WebSockets allows HTML5 video conferencing and to share data through our web server with other user browsers. ...
HTML5 Video Browser Support
There are several major browsers that provide support for HTML5 video codec formats. However, this support is not ...
Opening HTML5 Video in Full Screen Mode
These days videos come in very good quality and someof the paying sites provide HD quality videos as well. So, it is ...
More