Video Tag in HTML

Video Tag

1. The <video> tag was introduced in HTML5.

2. The <video> tag is used to embed or attach video to a web page.

3. It is a container tag.

4. It is a block-level element.

5. To mention the path of the video, we have to use the <source> tag (which is a non-container tag).

6. In the <source> tag, we have to use the src attribute to provide the path of the video.

7. We can provide multiple sources using multiple <source> tags.

8. The content written within the <video> tag will be displayed when the browser does not support the video tag.

9. Syntax: <video> <source src='path-of-video'> Video tag is not supported by the browser. </video>

Attributes Of Video Tag

1. Controls - Enables the video controls like play, pause, and volume.

2. Autoplay - Automatically plays the video when the page loads.

3. Loop - Plays the video continuously in a loop.

4. Muted - Mutes the audio of the video.

5. Poster - Applies a cover image to the video before playback.

6. Width - Specifies the width of the video element.

7. Height - Specifies the height of the video element.