HTML and CSS Reference
Basic HTML5 Video Implementation
In the <video> tag's most minimal implementation, it requires only a valid src attribute. For
example, if we took a nifty little video of the waves crashing at Muir Beach, California (just
north of San Francisco), and we encoded it as an H.264 .mp4 file, the code might look like
<video src= "muirbeach.mp4" //>
To see an example of this basic code, look at the CH6EX1.html file in the code distribution.
tually part of the HTMLMediaElement interface, implemented by the HTMLVideoElement ob-
ject. Some of the more important properties include:
The URL to the video that you want to play.
true or false . Forces the video to play automatically when loaded.
true or false . Loops the video back to the beginning when it has finished playing.
A number between 0 and 1. Sets the volume level of the playing video.
A URL to an image that will be shown while the video is loading.
There are also some methods of HTMLVideoElement that are necessary when playing video in
A method used to start playing a video.