Like audio, in the past, if we wanted to play a video on the Web, we also played it through Flash, and not all browsers installed the Flash Player Plug-in, now, in HTML5, we can completely play videos out of Flash or other plug-ins. Video Tag :...,. Like audio, in the past, if we wanted to play a video on the Web, we also played it through Flash, and not all browsers installed the Flash Player Plug-in, now, in HTML5, we can completely play videos out of Flash or other plug-ins.
Video Tag:
|
IE9 |
FireFox 5.0 |
Safari 5.5 |
Chrome 12 |
Opera 11.5 |
|
Mpeg4 |
√ |
× |
√ |
√ |
× |
|
Ogg |
× |
√ |
× |
√ |
√ |
|
WebM |
× |
√ |
× |
√ |
√ |
Ogg: Ogg file with Theora video encoding and Vorbis Audio Encoding
MPEG4: MPEG 4 file with H.264 video encoding and AAC audio encoding
WebM: WebM files with VP8 video encoding and Vorbis Audio Encoding
Video tags have the following attributes:
|
Attribute |
Value (omitted) |
Description |
|
Src |
Url |
The URL of the video to be played. The path can be a network path or a relative path. |
|
Controls |
Controls |
Display controls to users, such as playback buttons. |
|
Loop |
Loop |
Play the video again at the end of each video. |
|
Preload |
Preload |
The video is loaded when the page is loaded and ready for playing. If "autoplay" is used, this attribute is ignored. |
|
Autoplay |
Autoplay |
The video will be played immediately after it is ready. |
|
Height |
Autoplay |
The width of the video. |
|
Width |
Autoplay |
The height of the video. |
Note: The video attributes are basically the same as those of audio, except that the Width and height attributes are added.
Source sub-tag
This label is used to specify the video path. When this sub-label exists, the src attribute cannot appear in the video. Different browsers support different video tags, to enable video playback in different browsers, multiple video formats are available. You only need to add this tag to specify the video format, the browser displays the supported video formats for video playback. Source has two attributes:
|
Attribute |
Description |
|
Src |
The URL of the video to be played. The path can be a network path or a relative path. |
|
Type |
Video type |
Please watch the video. The video comes from the lab on the homepage of sogou Browser:
The above is the content of the HTML5 video tag application, which is practiced every day. For more information, see PHP Chinese Network (www.php1.cn )!