Loading...
HTML <video> Tag

HTML <video> Tag

In this tutorial, we will learn about video tag in HTML with the help of examples.


<video> Tag

Video tag <video> is used to embed the video files into the web page.

Note : The <source> tag is used inside the <video> tag to specify the different video sources.

Syntax

<video>......... </video>

Example

<!DOCTYPE html>
<html>
  <head>
    <title>Video Element</title>
  </head>
  <body>
    <video width = "350px" height = "200px" controls>
      <source src = "./video.mp4" type = "video/mp4">
      <source src = "./video.ogg" type = "video/ogg">
      Your browser does not support the video format
    </video>
  </body>
</html>

Output


Specific Attribute

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

Global Attribute

Video Tag support all the global attributes of HTML.


Event Attribute

Video Tag support all the event attributes of HTML.


Next Tutorial

We hope that this tutorial helped you develop better understanding of the concept of <video> tag in HTML.

Keep Learning : )

In the next tutorial, you'll learn about HTML <wbr> Tag.

- Related Topics