HTML5 video and audio audio detailed

Source: Internet
Author: User

HTML5 video and audio audio detailed

Some new features have emerged in HTML5:

Canvas element
Video and audio audio elements;
Support for local offline storage (localstorage,sessionstorage);
New special content elements: article, footer, header, nav, section;
New form controls: Calendar, date, time, email, url, search.
Take a look at video and audio today: The standard way to set video in HTML5: Videos

<video src= "Xxx.ogg" controls= "Controls" > your browser does not support Oh </video> we can also set up multiple source, the browser will select the first recognizable video to play, in the form of: <video width= "height=" controls= "Controls" > <source src= "Xxx.ogg" type= "Video/ogg" > <source Src= "Xx1.mp4" type= "Video/mp4" > your browser does not support Oh </video>video attributes are: attribute value description
AutoPlay AutoPlay If this property appears, the video plays immediately after it is ready.
Controls controls if this property appears, the control is displayed to the user, such as the play button.
Height pixel sets the altitude of the video player.
Loop loop If this property appears, it starts playing again when the media file is finished playing.
Preload preload If this property occurs, the video loads when the page loads and prepares to play.

If "autoplay" is used, the property is ignored.

src URL video Address the URL of the video to play.
Width pixel sets the length of the video player.
Autobuffer
Autobuffer

(Automatic buffering)
When the Web page is displayed, the binary property represents the content that is automatically buffered by the user agent (browser) or the user uses the relevant APIs for content buffering

Poster
URL Picture Address

This property value is linked to an image when the video is not responding or the buffer is insufficient. The image will be displayed in a certain proportion

The HTML5 provides an audio standard for audio elements, and audio elements can play sound files or audio streams.

Audio format is similar to video: Direct Line multiple Source:

<audio controls= "Controls" >
<source src= "Xx.ogg" type= "Audio/ogg" >
<source src= "Xx1.mp3" type= "Audio/mpeg" >
Your browser doesn't support it.
</audio> its properties than video less height, width, poster. Multimedia is becoming more and more important in our development, and HTML5 these video and audio.

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.