HTML5 provides the <video> tag for embedding video content directly into web pages. The src attribute specifies the video file's location, and additional attributes like controls, autoplay, and loop enhance user interaction and playback options. The <video> tag supports multiple video formats through nested <source> elements for cross-browser compatibility. Using <video> ensures that multimedia content is easily accessible and viewable within modern browsers.
Examples:
<video width="640" height="360" controls>
<source src="video.mp4" type="video/mp4">
<source src="video.webm" type="video/webm">
Your browser does not support the video tag.
</video>
<video width="640" height="360" autoplay loop>
<source src="video.mp4" type="video/mp4">
<source src="video.webm" type="video/webm">
Your browser does not support the video tag.
</video>
HTML Code:
The Output of the above code:
HTML Video
HTML5 provides a standard for embedding video content on web pages.
<video width="320" height="240" controls>
<source src="movie.mp4" type="video/mp4">
Your browser does not support the video tag.
</video>