Comment: HTML video is suitable for HTML 5+, used to define online video streaming media. Here is a brief introduction, which is convenient for friends in need.
HTML <video> is suitable for HTML 5+, which defines video streaming for online viewing.
<video src="http://www.vevb.com/movie.ogg" controls="controls">
Here are comment texts, if HTML 5 cannot be supported, the browser will display the texts here. If supported, the video will be displayed directly and the text will be ignored.
</video>
In HTML 4 and before, if you wanted to embed online videos in a web page, you generally needed to use Flash video streams. By using <object> and <embed> tags, you can play swf, flv and other format video files through the browser, but the premise is that the browser must install a third-party plug-in: Adobe Flash Player. Modern smartphones and iPads generally cannot support Flash, so they cannot browse videos on the web. And HTML 5 has changed this fact, web developers can easily load video files using the <video> tag without any third-party plug-ins.
Property value description
autoplayautoplay If this property appears, the video will be played immediately after it is ready.
controlscontrols If this property appears, the controls are displayed to the user, such as the play button.
height pixel value sets the height of the video player.
If looploop, playback starts again when the media file has finished playing.
preloadauto/meta/none specifies whether to preload the video, possible values:
auto - Load the entire video after the page loads
meta - Only metadata is loaded after the page is loaded
none - video is not loaded after the page is loaded
* The URL of the video to be played by the src video address, it is recommended to use the absolute address.
width pixel value sets the width of the video player.
How to write compatible video tags?
Since old browsers and Internet Explorer do not support <video> elements, we must find a solution for these browsers that supports Flash files. Unfortunately, like HTML 5 audio, the file formats involved in videos are not supported in the same way as Firefox and Safari/Chrome. So if you want to use HTML 5 videos at this time, you need to create three video versions. OGG, MP4, FLV/SWF
<video controls>
<!-- Firefox-compliant -->
<source src="http://www.vevb.com/ movie.ogg" type="video/ogg" />
<!-- Compatible with Safari/Chrome-->
<source src="http://www.vevb.com/ movie.mp4" type="video/mp4" />
<!-- If the browser does not support the video tag, use flash -->
<embed src="http://www.vevb.com/ movie.swf" type="application/x-shockwave-flash"
width="320" allowscriptaccess="always" allowfullscreen="true"></embed>
</video>