Article introduction of Wulin.com (www.vevb.com): Like audio, in the past, if we wanted to play videos on the web, we would play them through Flash. Not all browsers installed Flash player plug-in, but now in HTML5, we can completely play videos without Flash or other plug-ins.
Like audio, in the past, if we wanted to play videos on the web, we would play them through Flash. Not all browsers installed Flash player plug-in, but now in HTML5, we can completely play videos without Flash or other plug-ins.
video tag:
IE9
FireFox 5.0
Safari 5.5
Chrome 12
Opera 11.5
Mpeg4
√
×
√
√
×
Ogg
×
√
×
√
√
WebM
×
√
×
√
√
Ogg: Ogg files with Theora video encoding and Vorbis audio encoding
MPEG4: MPEG 4 files with H.264 video encoding and AAC audio encoding
WebM: WebM files with VP8 video encoding and Vorbis audio encoding
The properties of the video tag are:
property
Value (can be omitted)
describe
src
url
The URL of the video to be played can be a network path or a relative path.
Controls
Controls
Shows controls to the user, such as play button.
loop
loop
Playback restarts whenever the video ends.
preload
preload
The video is loaded when the page is loaded and ready to be played. If autoplay is used, this property is ignored.
autoplay
autoplay
The video will be played immediately after it is ready.
width
autoplay
The width of the video.
height
autoplay
The height of the video.
Note: The properties of video are basically the same as those of audio, except that there are additional properties of Width and height.
source subtitle
This tag is used to specify the path of the video. Generally, when this sub-tag exists, the src attribute cannot appear in the video anymore. Different video support for the video tag is different under different browsers. In order to make it playable in different browsers, we can have multiple video formats. Then we only need to add this tag to specify the video, and the browser will be the video format supported by video playback. Source has two properties, namely:
property
describe
src
The URL of the video to be played can be a network path or a relative path.
type
Video Type
<h1>Please watch the video, the video comes from the laboratory on Sogou browser homepage:</h1>
<video width=600 height=400 controls=controls autoplay=true>
<source src= type=video/mp4/>
<source src= type=video/ogg/>
</video>