HTML Video



Syntax :


<video src = "foo.mp4"  width = "300" height = "200" controls>
   Your browser does not support the <video> element.   
</video>

The controls attribute adds video controls, like play, pause, and volume.

 Html5 added a new tag for add video files on the web page before html5 is achieved by using <embed> tag.

The text between the <video> and </video> tags will only be displayed in browsers that do not support the <video> element.


Example :

<video width="320" height="240" autoplay>
  <source src="video.mp4" type="video/mp4" />
  <source src="video.ogg" type="video/ogg" />
  Your browser does not support the video tag.
</video>

Note: Chromium browsers do not allow autoplay in most cases. However, muted autoplay is always allowed.

Add muted in tag after play video but a video is muted


Example :

<video width="320" height="240" autoplay muted>
  <source src="video.mp4" type="video/mp4" />
  <source src="video.ogg" type="video/ogg" />
  Your browser does not support the video tag.
</video>