Cover Image for HTML video Tag
67 views

HTML video Tag

The HTML <video> tag is used to embed videos or multimedia content into a web page. It provides a standard way to play video files directly in the browser without the need for external plugins.

Here’s an example of how the <video> tag can be used:

HTML<span role="button" tabindex="0" data-code="<video src="video.mp4" controls> Your browser does not support the video tag.
<video src="video.mp4" controls>
  Your browser does not support the video tag.
</video>

In the above example, the <video> tag is used to embed a video file named “video.mp4” into the web page. The src attribute specifies the URL or path to the video file. The controls attribute adds playback controls to the video player, allowing users to play, pause, seek, and adjust the volume of the video.

If the browser does not support the <video> tag or the video format, the fallback content inside the <video> element will be displayed. In this example, the message “Your browser does not support the video tag” will be shown to users who cannot view the video.

The <video> tag supports various attributes and options to control the behavior and appearance of the video player, such as autoplay, loop, poster (thumbnail image), and more. You can also include multiple <source> elements within the <video> tag to provide alternative video formats for different browsers.

Here’s an example showing multiple video sources:

HTML<span role="button" tabindex="0" data-code="<video controls> <source src="video.mp4" type="video/mp4"> <source src="video.webm" type="video/webm"> Your browser does not support the video tag.
<video controls>
  <source src="video.mp4" type="video/mp4">
  <source src="video.webm" type="video/webm">
  Your browser does not support the video tag.
</video>

In this example, both the MP4 and WebM formats are provided as alternative sources for the video. The browser will automatically select the compatible video format based on its capabilities.

By using the <video> tag, you can easily embed and control video content within your web pages, making it accessible and enjoyable for your website visitors.

YOU MAY ALSO LIKE...

The Tech Thunder

The Tech Thunder

The Tech Thunder


COMMENTS