As with audio, in the past, if we wanted to play video on the web, it was all played via Flash, and not all browsers had Flash Player plug-ins installed, and now we're in HTML5, we can completely disengage from flash or other plugins to play the video.
Video Tags:
|
IE9 |
FireFox 5.0 |
Safari 5.5 |
Chrome 12 |
Opera 11.5 |
Mpeg4 |
√ |
X |
√ |
√ |
X |
Ogg |
X |
√ |
X |
√ |
√ |
WebM |
X |
√ |
X |
√ |
√ |
ogg: Ogg file with Theora video encoding and Vorbis audio encoding
MPEG4: MPEG 4 files with the H. W video encoding and AAC audio encoding
WebM: WebM file with VP8 video encoding and Vorbis audio encoding
The properties of the video tag are:
" /td> |
value (can be omitted) |
description |
src |
url |
The URL of the video to play, the path can be a network path or a relative path. |
controls |
controls |
displays controls, such as play buttons, to the user. |
loop |
Loop |
starts playing again at the end of the video. |
preload |
preload |
The video loads when the page loads and prepares to play. If you use "autoplay", the property is ignored. |
autoplay |
AutoPlay |
The video will play as soon as it is ready. |
width |
autoplay |
The length of the video. |
height |
autoplay |
The length of the video. |
Note: The properties of video are basically the same as the audio properties, except for the width and height properties.
SOURCE Sub-label
This tag is used to specify the path of the video, the general existence of this sub-label can no longer appear in the video src attribute, in different browsers have different video support videos, then we want to be able to play in different browsers, there are a variety of video formats, Then we just need to add this tag to specify the video, and the browser will be the video format supported by the movie. The source has two properties, namely:
Property |
Describe |
Src |
The URL of the video to play, the path can be a network path or a relative path. |
Type |
Video type |
-
- <video width= "" "height=" controls= "Controls" Autoplay= "true";
- <source src= "http://ie.sogou.com/lab/inc/ Bigbuckbunny.mp4 "type=" Video/mp4 "/>
- <source src=" http:/ IE.SOGOU.COM/LAB/INC/BIGBUCKBUNNY.OGV "type=" Video/ogg "/>
- </video>