02 / 12

How can we embed video in HTML?

Embedding Video in HTML

In HTML, the <video> element is used to embed video files directly into a web page. It allows users to play videos without needing external plugins like Flash.

Key Points about <video>
  1. 1

    The <video> tag supports attributes like controls, autoplay, loop, muted, and poster (to show a thumbnail before playing).

  2. 2

    Common video formats supported are MP4, WebM, and Ogg.

  3. 3

    The <source> tag inside <video> allows providing multiple file formats for better browser compatibility.

  4. 4

    If the browser doesn’t support the <video> element, fallback text or links can be displayed.

Example Usage

In short: The <video> element lets you embed and control video playback directly in your web pages.