HTML - <video> tag

The <video> tag in HTML is used to embed video content on a web page. It allows users to play videos with built-in controls.

Attributes of the <video> tag:

  1. src
    Specifies the path to the video file
    Example: <video src="movie.mp4">

  2. controls
    Displays video controls like play, pause, and volume
    Example: <video controls>

  3. autoplay
    The video starts playing automatically when the page loads
    Example: <video autoplay>

  4. loop
    The video will start over again, every time it is finished
    Example: <video loop>

  5. muted
    The video will start with the sound muted
    Example: <video muted>

  6. preload
    Specifies if and how the video should be loaded when the page loads
    Values: auto, metadata, none
    Example: <video preload="metadata">

The <source> tag is often used inside <video> to specify multiple file formats for better browser compatibility.