Video Format
Currently, the video element supports three types of videos:
format |
IE |
Firefox |
Opera |
Chrome |
Safari |
Ogg |
No |
3.5+ |
10.5+ |
5.0+ |
No |
MPEG 4 |
9.0+ |
No |
No |
5.0+ |
3.0+ |
WebM |
No |
4.0+ |
10.6+ |
6.0+ |
No |
OGG = Ogg file with Theora video encoding and Vorbis audio encoding
MPEG4 = MPEG 4 file with H + video encoding and AAC audio encoding
WebM = WebM file with VP8 video encoding and Vorbis audio encoding
properties of the <video> tag
Properties |
value |
Descriptive narrative |
AutoPlay |
AutoPlay |
Assuming this property appears, the video plays as soon as it is ready. |
Controls |
Controls |
Assuming this property appears, the control is displayed to the user, for example, the button is played. |
Height |
Pixels |
Sets the height of the video player. |
Loop |
Loop |
Assuming this property occurs, the media file starts playing again when it is finished playing. |
Preload |
Preload |
Assuming this property appears, the video loads when the page loads and prepares to play. If you use "autoplay", this property is ignored. |
Src |
Url |
The URL of the video to play. |
Width |
Pixels |
Sets the width of the video player. |
Example 1
<video src= "Movie.ogg" width= "," "height=" controls= "controls" >your browser does not support the video tag.< ;/video>
The content inserted between <video> and </video> is displayed for browsers that do not support video elements.
The control property is used to join the play, pause, and volume controls.
Example 2
<video width= "height=" controls= "Controls" > <source src= "Movie.ogg" type= "Video/ogg" > <source src= "Movie.mp4" type= "Video/mp4" >your browser does not support the video tag.</video>
The video element agrees with multiple source elements.
The source element is able to link different video files.
The browser will use the first recognizable format.
HTML 5 Video usage