I. Description
Video tags are introduced in HTML5 to facilitate the playback of videos in the browser without the need to rely on flashplayer to be more lightweight. However, there are some issues to be aware of in terms of browser compatibility and video protocol support.
second, browser-compatible
HTML5 video tags are now supported by ie9+ and other mainstream browsers .
For IE8 and below the IE browser, you can consider introducing HTML5 extension support JS to try to solve, not pro-test.
third, video protocol support
Support: Ogg, MPEG4, WebM
Not supported: rtmp, RTSP (if transcoding, cut into HLS can be played, but even within the LAN also has about 3 seconds of delay)
Note: More detailed video format support would like to have informed friends to inform, thank you!
Four, DEMO
More properties, methods, and events refer to the list of APIs in this article's resources.
<!--define a video tag: AutoPlay: Auto-play; controls: Display the control; SRC: Specify the video source; Width,height: Set the display size of the video;<VideoId="My_video"AutoPlayControlsSrc="Https://media.w3.org/2010/05/sintel/trailer.mp4"Width="500"height= "$" ></video> <script type= "Text/javascript" > //get video objects Span class= "Hljs-keyword" >var Myvideo=document.getelementbyid ( "My_video"); //play video function Play () {myvideo.play ();} //pause video function pause () {myvideo.pause ();} </SCRIPT>
v. References
- HTML5 Video verbose api:https://msdn.microsoft.com/zh-cn/library/hh772500 (v=vs.85). aspx
- HTML5 Video Detail function demo:http://www.w3.org/2010/05/video/mediaevents.html
Web video playback "HTML5 video Tag"