<video> : Video Embed element

Introduction

The <video> element in HTML is used to embed video content into a web page. It provides a standard way to embed video files directly into HTML documents, allowing users to view the video content without the need for additional plugins.

Here’s a basic example of how you might use the <video> element:

Output:

In this example:

  • The <video> element defines a video player.
  • The controls attribute adds standard video controls (play, pause, volume control, etc.) to the player.
  • The width and height attributes specify the dimensions of the video player.
  • The <source> element provides the video source using the src attribute, and the type attribute specifies the MIME type of the video file.

You can include multiple <source> elements to provide different video formats (e.g., MP4, WebM, Ogg) to ensure compatibility across different browsers. The browser will choose the first supported video format from the provided <source> elements.

Leave a Comment