<VIDEO>
Tag Description
<video> allows us to add videos to our web pages without the need for a plug-in. New in HTML5.
Code Example
<video controls="controls">
<source src="media/video/movie01.ogg" type="video/ogg" />
<source src="media/video/movie01.mp4" type="video/mp4" />
Video element not supported
</video>
Result
Attributes
| Attribute | Value | Description |
|---|---|---|
| autoplay | autoplay | Video plays when loaded |
| controls | controls | Adds video controls |
| height | px | Sets height |
| loop | loop | Video loops |
| preload | auto, metadata, none | Specifies whether or not video loads when page loads. Ignored if autoplay present |
| src | URL | Video source |
| poster | URL | Poster image source |
| width | px | Sets width |
Browser Support
| Browser | Comment |
|---|---|
| Firefox | Yes |
| Safari | Yes |
| Chrome | Yes |
| Opera | Yes |
| IE 9 | Yes |
| IE <= 8 | No |
Codec Support
| Codec | Browser |
|---|---|
| ogg/theora | Firefox, Chrome, Opera |
| H.264 (mp4) | IE 9, Chrome, Safari |
| WebM | Firefox => 4.02, Chrome => 6, Opera |
Notes
- Use
<source>to provide browser flexibility
Useful Links
Title
details
