HTML5 daily video tag application-

Source: Internet
Author: User
Like audio, in the past, if we wanted to play a video on the Web, we also played it through Flash, and not all browsers installed the Flash Player Plug-in, now, in HTML5, we can completely play videos out of Flash or other plug-ins. Video Tag :...,. Like audio, in the past, if we wanted to play a video on the Web, we also played it through Flash, and not all browsers installed the Flash Player Plug-in, now, in HTML5, we can completely play videos out of Flash or other plug-ins.


Video Tag:


IE9

FireFox 5.0

Safari 5.5

Chrome 12

Opera 11.5

Mpeg4

√

×

√

√

×

Ogg

×

√

×

√

√

WebM

×

√

×

√

√


Ogg: Ogg file with Theora video encoding and Vorbis Audio Encoding
MPEG4: MPEG 4 file with H.264 video encoding and AAC audio encoding
WebM: WebM files with VP8 video encoding and Vorbis Audio Encoding



Video tags have the following attributes:

Attribute

Value (omitted)

Description

Src

Url

The URL of the video to be played. The path can be a network path or a relative path.

Controls

Controls

Display controls to users, such as playback buttons.

Loop

Loop

Play the video again at the end of each video.

Preload

Preload

The video is loaded when the page is loaded and ready for playing. If "autoplay" is used, this attribute is ignored.

Autoplay

Autoplay

The video will be played immediately after it is ready.

Height

Autoplay

The width of the video.

Width

Autoplay

The height of the video.


Note: The video attributes are basically the same as those of audio, except that the Width and height attributes are added.



Source sub-tag

This label is used to specify the video path. When this sub-label exists, the src attribute cannot appear in the video. Different browsers support different video tags, to enable video playback in different browsers, multiple video formats are available. You only need to add this tag to specify the video format, the browser displays the supported video formats for video playback. Source has two attributes:

Attribute

Description

Src

The URL of the video to be played. The path can be a network path or a relative path.

Type

Video type



Please watch the video. The video comes from the lab on the homepage of sogou Browser:
         
          
  
  


The above is the content of the HTML5 video tag application, which is practiced every day. For more information, see PHP Chinese Network (www.php1.cn )!

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.