Share on Google+Share on Google+

HTML5 video element, Implementation of <video> tag.

The <video> tag is used for adding video or media file in HTML document.

HTML5 video element, Implementation of <video > tag.


The <video> tag is used for adding video or media file in HTML document. It is not present in HTML4.01. It is not only for video, you can use audio or image. You can write content inside the video tag. It will be display only, when browser do not support video tag. If you use image instead of video, then you use poster attribute for address of Image.

Attribute of video tag:

Attributes Value Description
autoplay autoplay Video will start automatically play.
autobuffer autobuffer Video will start automatically buffer.
controls controls for showing controls.
loop loop for repetition of media data.
height pixel Define height of media.
poster URL of a image Address of image.
src URL(video, audio) Address of media.
width pixel Define width of media.

Declaration Syntax :

Declaration syntax of video tag in HTML5.

<video src="URL" > </video >
<video >
                    <source src="URL" >  
                          <source src="URL">  
          </video >

Example of <video> in HTML5:

<!doctype html >
<html >
<title>Video Tag </title>
<p><b>Example of video tag in HTML5.</b></p>
<video src="1.mp4" controls >
Browser does not support video tag.
</video >

Download this code

Difference Between HTML5 and HTML4.01:

The video tag  is only available in HTML5. It is not available in HTML4.01.


Posted on: September 15, 2010 If you enjoyed this post then why not add us on Google+? Add us to your Circles

Share this Tutorial Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.


Advertisement null