TOP CATEGORIES

×

What is video tag syntax?

S

Shuhana Jha

Syntax of <video> Tag

<video src="movie.mp4" controls autoplay loop muted width="640" height="360" poster="thumbnail.jpg">

  Your browser does not support the video tag.

</video>

Explanation of Attributes

  • src → Path to the video file.
  • controls → Displays video controls (play, pause, volume, etc.).
  • autoplay → Video starts playing automatically.
  • loop → Video restarts automatically after finishing.
  • muted → Starts the video with sound muted.
  • width/height → Defines the size of the video player.
  • poster → Image to display before the video plays.
  • preload → Tells the browser how to load the video (auto, metadata, none).

Example with Multiple Sources

<video width="600" height="340" controls>

  <source src="movie.mp4" type="video/mp4">

  <source src="movie.ogg" type="video/ogg">

  <source src="movie.webm" type="video/webm">

  Your browser does not support the video tag.

</video>

0 votes

Your Answer