HTML5 Video

By | January 31, 2020

How to set audio in a web page, we have taken a step in the first chapter, in this we will see how in the web page we can set the video. Can add element. Earlier there was no simple easy way to add video element, but HTML5 has provided this facility so that we can easily add video files to the web page.

Example:-


<video width="300" height="200" controls>
	<source src="video1.mp4" type="video/mp4">
	<source src="video2.ogg" type="video/ogg">
	Your browser does not support the video tag.
</video>

The controls tag present in the video adds video controls such as play pause volume etc. to the video.

The height attribute in the video controls the height of the video and the width attribute controls the video’s width.

Adds the video that needs to be added to the <source> element present in the video.

The content written in the <video> and </video> tags will be shown in a browser that does not support the new element video tag of HTML5.

HTML5 <video> autoplay:-

This tag is used if the video has to auto start.

Example:-


<video width="300" height="200" controls autoplay>
	<source src="video1.mp4" type="video/mp4">
	<source src="video2.ogg" type="video/ogg">
	Your browser does not support the video tag.
</video>

HTML5 Video-Media Types:-

File FormatMedia Type
WebMvideo/webm
MP4video/mp4
Oggvideo/ogg

HTML5 <video> Browser Support:-

All modern browsers enable HTML5 videos.

Spread the love

Leave a Reply

Your email address will not be published. Required fields are marked *