How to add video using HTML?

To add a video to a webpage using HTML, you can use the <video> element. The <video> element requires a source for the video, which you can specify using the src attribute. Here’s an example of how to add a video to your HTML page:

<video width="320" height="240" controls>
  <source src="video.mp4" type="video/mp4">
  <source src="video.ogg" type="video/ogg">
  Your browser does not support the video tag.
</video>

In the example above, the video is 320 pixels wide and 240 pixels high. The controls attribute adds controls to the video player, such as play/pause, volume, and the timeline. The <source> elements provide multiple sources for the video, in case the browser doesn’t support the first format. The text between the <video> tags is displayed in browsers that don’t support the <video> element.

Note that different browsers support different video formats, so it’s best to provide multiple formats if possible. The most widely supported formats are MP4 (H.264 video and AAC audio) and Ogg (Theora video and Vorbis audio).