HTML5 Video

Until now, all video elements on a web pages were displayed using plugins, such as Flash.

HTML5 has the <video> element. It’s a new element which specifies how to embed a video/movie on a web page.

If you use HTML5 for your media elements such as Video and Audio, your site viewers will not required additional plugins such as flash installed and enabled in their browsers.

If you want to embed HTML5 video element into your webpage, I’ve the sample code for you below.

Sample code for HTML5 video :

HTML5 <video> element

<video width=”320″ height=”240″ controls=”controls”>
<source src=”yourmoviefile.mp4″ type=”video/mp4″ />
<source src=”yourmoviefile.ogg” type=”video/ogg” />
Your browser does not support the video tag.

Attributes for audio element :

controls : adds controls to your video element such as play, volume and pause.

type : specifies type of format for the video file. It will play compatible format for browser.

src : source or location of your audio file.

Height and Width : You can also specify height and width of your video element on your site page.

Click here to learn more about what video file formats are supported by which browsers.

Note that different browsers support different format for both Video and Audio file formats.

As long as you have your video format and files available at their location, you can directly play your video content within your browsers.

We hope this is useful. Please post your comments or feedback if you have any!