HTML video tag


<video> tag

The <video> tag is used to embed any video resources into a web page.

The following video formats are supported,

  • MP4
  • Ogg
  • WebM

autoplay and src attribute in <video> tag

src attribute is used to specify the path of the video file.

If you add autoplay attribute in the <video> tag, the given video file plays automatically, when the page is loaded.

Example

Try Yourself

width attribute in <video> tag

The width attribute is used to set the width of the video player.

Example

Try Yourself

controls attribute in <video> tag

The controls attribute is used to show the controls of the video player, like play, pause, and other options.

Example

Try Yourself

muted attribute in <video> tag

The muted attribute is used to mute the sound.

Example

Try Yourself

loop attribute in <video> tag

The loop attribute is used to play the given video file repeatedly.

Example

Try Yourself