The video Element

Contact Us or call 1-877-932-8228
The video Element

The video Element

The video element is very similar to the audio element. Like with audio, it can be as simple as:

<video src="video-file.mp4"></video>

But it's always a good idea to provide multiple source options as different browsers support different video types. As with audio, browsers will use the first file they find that they support.

video Tag Attributes

Attribute Description
src Points to the video file. Only used when there are no nested source elements.
controls Boolean. If present, indicates that controller will be displayed.
preload

Possible values:

  • auto: Browser should choose whether to preload the file.
  • metadata: Browser should only preload the metadata as the user is likely not to need the file. This is the default.
  • none: Browser should not preload anything as the user is likely not to need the file.
autoplay Boolean. If present, video will begin to play as soon as it has loaded.
loop Boolean. If present, video repeats indefinitely.
height Height in pixels. You should use the actual height of the video.
width Width in pixels or percentage. You should use the actual width of the video.

Creating and Converting Video Files

  1. Miro Video Converter - free, open source tool for quickly converting between video file types. Available for Mac and Windows.
  2. Windows Live Movie Maker - free tool for making movies (WMV files) on Windows 7.
Next