SyntaxStudy
Sign Up
HTML Beginner 1 min read

HTML Video

HTML Video

The <video> element embeds video natively without plugins like Flash.

Key Attributes

  • src — Video file URL
  • controls — Show playback UI
  • autoplay — Play on load (needs muted in most browsers)
  • loop — Loop the video
  • muted — Mute audio
  • poster — Thumbnail image shown before playing
  • width / height — Video dimensions

Embedding YouTube

YouTube videos are embedded with an <iframe>, not the <video> tag.

Example
<!-- Basic video player -->
<video src="video.mp4" controls width="640" height="360"></video>

<!-- Multiple formats with poster image -->
<video controls poster="thumbnail.jpg" width="640">
  <source src="video.mp4" type="video/mp4">
  <source src="video.webm" type="video/webm">
  Your browser does not support video.
</video>

<!-- Autoplay muted loop (for hero backgrounds) -->
<video autoplay muted loop width="100%">
  <source src="background.mp4" type="video/mp4">
</video>