Detailed video code in HTML5

Source: Internet
Author: User
This article is mainly about Html5video part of the chapter, more suitable for beginners to learn HTML5 some things, below to try the structure of this element.

HTML5 Video

Many sites will use video. HTML5 provides the standard for displaying video.

Video on a web site

Until now, there is still no standard for displaying video on a Web page.

Today, most videos are displayed via plugins (such as Flash). However, not all browsers have the same plugin.

HTML5 provides a standard way to include video through the visual element.

Browser support

Internet Explorer + +, Firefox, Opera, Chrome, and Safari support elements.

Note: Elements are not supported in Internet Explorer 8 or earlier IE versions.

HTML5 (VIDEO)-How to work

To display the video in HTML5, all you need is:

<! DOCTYPE Html>

Your browser does not support the HTML5 video tag.

</video>

</body>

Element provides play, pause, and volume controls to control the video.

Element elements also provide the width and Height properties to control the size of the video. If you set the height and width, the required video space is retained when the page loads. If you do not set these properties and the browser does not know the size of the video, the browser will not be able to load a specific space, the page will vary depending on the size of the original video.

The content inserted between the tag and the label is presented to browsers that do not support the video element.

Element supports multiple elements. Elements can be linked to different video files. The browser will use the first recognizable format:

HTML5-Control using the DOM

HTML5 and elements also have methods, properties, and events.

And elements of methods, properties, and events can be controlled using JavaScript.

There are methods for playing, pausing, loading, and so on. The properties (such as length, volume, etc.) can be read or set. One of the DOM events can tell you, for example, that the element starts playing, paused, stopped, and so on.

The simple method in the example shows us how to use elements, read and set properties, and how to invoke a method.

<! DOCTYPE html> 

Your browser does not support the HTML5 video tag.

</video></div> <script> var Myvideo=document.getelementbyid ("Video1"); function Playpause () {if (myvideo.paused)   myvideo.play (); else   myvideo.pause ();} function Makebig () { myvideo.width=560; } function Makesmall () {myvideo.width=320;} function Makenormal () {myvideo.width=420;} </script> </body> &L T;/html>

HTML5 Video Tag

<video> Define a video

<source> define a variety of media resources, such as <video> and <audio>

<track> defined in the Media Player text track

HTML5 (VIDEO)-How to work

To display the video in HTML5, all you need is:

<! DOCTYPE Html>

Your browser does not support the HTML5 video tag.

</video>

</body>

Element provides play, pause, and volume controls to control the video.

Element elements also provide the width and Height properties to control the size of the video. If you set the height and width, the required video space is retained when the page loads. If you do not set these properties and the browser does not know the size of the video, the browser will not be able to load a specific space, the page will vary depending on the size of the original video.

The content inserted between the tag and the label is presented to browsers that do not support the video element.

"Recommended"

HTML base element that gives you 0 basic learning HTML

HTML5 using the video element

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.