HTML5 video playback event attributes and API controls

Source: Internet
Author: User

In the past, if we wanted to play a video on the Web, we also played it through Flash. Not all browsers have installed the Flash Player Plug-in, but now we are in HTML5, you can play the video completely out of Flash or other plug-ins. 1. A brief introduction to the video format: avi, RMB, wmv, mpeg4, ogg, and webm videos are mainly composed of video, audio, and encoding formats supported by html5: ogg = Ogg file with Theora video encoding and Vorbis Audio Encoding MPEG4 = with H. 264 video encoding and AAC audio encoding MPEG 4 file WebM = WebM file with VP8 video encoding and Vorbis Audio Encoding 2. HTML5 video tag <video> attribute <video src = "movie.mp4" controls = "controls"> </video> <video src = "movie.mp4" controls = "c Ontrols "> the browser does not support HTML5 video playback </video> <video width =" 300 "controls =" controls "…> <Source src = "movie.ogg" type = "video/ogg"> <source src = "movie.mp4" type = "video/mp4"> </video> 3. HTML5 video API Control obtain the video tag, here is the DOM object varvideo = document. getElementById ('videoid'); you can also use the jQuery method as follows: varvideo =$ ('# videoid '). get (0); load video: load (), play video: play (), pause: pause (), fast forward to 10 seconds: currentTime + = 10 increase in playback speed: playbackRate ++ playback speed increased by 0.1: playbackRate + = 0.1 volume increased: volume + = 0.1 mute: muted = true 3. Example <! DOCTYPE html>

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.