HTML - <video> Tag


Advertisements


Description

The HTML <video> tag is used to embed video into your web page, it has several video sources.

Example

Live Demo
<!DOCTYPE html>
<html>

   <head>
      <title>HTML video Tag</title>
   </head>

   <body>
      <p>Run your first program using an Online Compiler (compileonline.com)</p>
      <br />
      
      <video width = "500" height = "300" controls>
         <source src = "/html/compileonline.mp4" type = "video/mp4">
         This browser doesn't support video tag.
      </video>
   </body>

</html>

This will produce the following result −

Global Attributes

This tag supports all the global attributes described in − HTML Attribute Reference

Specific Attributes

The HTML <video> tag also supports the following additional attributes −

Attribute Value Description
autoplay html-5 autoplay Specifies that the video will play automatically.
controls html-5 controls Specifies that the video controls gets displayed.
height html-5 pixels Specifies the height
loop html-5 loop Specifies that the video will start again every time after finish.
muted html-5 muted Specifies that the audio should be muted
poster html-5 URL Specifies the image to be shown while the video is downloading.
preload html-5 auto
metadata
none
Specifies what author thinks will lead to user experience at its best.
src html-5 URL Specifies the URL
width html-5 pixels Specifies the width

Event Attributes

This tag supports all the event attributes described in − HTML Events Reference

Browser Support

Chrome Firefox IE Opera Safari Mobile
Yes Yes Yes Yes Yes Yes

html_tags_reference.htm

Advertisements