Video

This HTML element embeds a media player into the document.

The video element may be used for both video and audio.

Attributes

  • the global attributes
  • autoplay
  • controls
  • controlslist
  • crossorigin
  • disablepictureinpicture
  • disableremoteplayback
  • height
  • loop
  • muted
  • playsinline
  • poster
  • preload
  • src
  • width

Events

  • audioprocess
  • canplay
  • canplaythrough
  • complete
  • durationchange
  • emptied
  • ended
  • error
  • loadeddata
  • loadedmetadata
  • loadstart
  • pause
  • play
  • playing
  • progress
  • ratechange
  • seeked
  • seeking
  • stalled
  • suspend
  • timeupdate
  • volumechange
  • waiting

Usage notes

Not all browsers support all video formats; use source elements to offer options and fallbacks. The browser will choose the first one it understands.

You can use the object-position property to adjust the position of the video within the element's frame.

You can use the object-fit property to control how the video is resized to fit the frame.

Subtitles and captions can be added with the track element.

Accessibility concerns

Videos should provide both captions and transcripts.

See also

Learn more