HTML Video Tag

By Xah Lee. Date: . Last updated: .

Here's a video tag:

<video src="" controls></video>

Here's how your browser shows it:

Specifying Multiple Video Formats

If you have multiple video formats, you can use the “source” tag. Browser will pick the one it understands or most suitable. Example:

<video controls>
  <source src="mymovie.ogg" type="video/ogg">
  <source src="mymovie.mp4" type="video/mp4">
  Your browser does not support the video element.

Video Tag Attributes

Optional attributes.

none, metadata, auto
Show control panel. • Does not take any value
Start to play automatically. • Does not take any value
Loop playback. • Does not take any value
value is integer, in pixels
value is integer, in pixels
example: … poster="image.jpg" …

Video Formats Browser Support

video format support 2018-11-14

HTML Video Audio

  1. HTML Video Tag
  2. HTML Audio Tag
Liket it? I spend 2 years writing this tutorial. Help me spread it. Tell your friends. Or, Put $5 at patreon.

Or, Buy JavaScript in Depth

If you have a question, put $5 at patreon and message me.

Web Dev Tutorials

  1. HTML
  2. Visual CSS
  3. JS in Depth
  4. JS Object Reference
  5. DOM Scripting
  6. SVG
  7. Blog