The <video> tag is used for adding video or media file in HTML document.
The <video> tag is used for adding video or media file in HTML document.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.
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 of video tag in HTML5.
<video src="URL" > </video > OR <video > <source src="URL" > <source src="URL"> ................................... </video > |
<!doctype html > <html > <head> <title>Video Tag </title> </head> <body> <p><b>Example of video tag in HTML5.</b></p> <video src="1.mp4" controls > Browser does not support video tag. </video > </body> </html> |
The video tag is only available in HTML5. It is not available in HTML4.01.