HTML video tag

HTML <video> tag adds video in a page. Subtitles may also be added in a video. We write the address of the video in the src attribute of video.

<video src="files/Hummingbird.mp4"  style="width:100%; height:100%;" controls>

Tag omission

Both opening and closing tags are necessary for the video element.

Global Attributes

All the global attributes are applicable on the video element.

Tag Attributes

Attributes that are applicable to <video> tag

Location (address) of the video

<video src="address of the video"> </video>

A type of poster visible before playing the video.

<video src="address of the video" poster="address of the picture"> </video>

The video plays automatically after the page is loaded. It is a boolean attribute.

<video src="address of video" auoplay> </video>

The video seeks back to the start of the video upon reaching at the end.

<video src="URL of video" loop> </video>

The audio is muted by default.

<video src="URL or address of video" muted> </video>

represents controls of the video such as pause, play, volume control.

<video src="URL or address of video" controls> </video>

represents the width of the media resource.

<video src="URL or address of video" width="100%"> </video>

defines the height of the media resource.

<video src="URL or address of video" height="760px"> </video>

the element handles crossorigin requests.


specifies how much buffering the video needs.

we can also add video in a page using source element. This method is useful when the same video of different types are used. In that case, if one browser does not support one video, then another type of the same video is played.

<video style="width:100%; height:100%;" controls>
  <source src="files/Hummingbird.mp4" type="video/mp4">
  <source src="files/Hummingbird.mkv" type="video/mkv">


Was this article helpful?