HTML - <video> tag
The <video> tag in HTML is used to embed video content on a web page. It allows users to play videos with built-in controls.
Attributes of the <video> tag:
-
src
Specifies the path to the video file
Example: <video src="movie.mp4"> -
controls
Displays video controls like play, pause, and volume
Example: <video controls> -
autoplay
The video starts playing automatically when the page loads
Example: <video autoplay> -
loop
The video will start over again, every time it is finished
Example: <video loop> -
muted
The video will start with the sound muted
Example: <video muted> -
preload
Specifies if and how the video should be loaded when the page loads
Values: auto, metadata, none
Example: <video preload="metadata">
The <source> tag is often used inside <video> to specify multiple file formats for better browser compatibility.