HTML5 Audio Audio and video

Source: Internet
Author: User

HTML5 as a next-generation Web Standard, the HTML5 craze began years ago. For HTML5 I just look at it. About HTML5 and Ria (SILVERLIGHT,FLASH,JAVAFX, etc.) I do not want to say anything, there is nothing to say, there is a reason for its existence. Which is inferior, left to the facts, time to prove.

Some of the new features appear in HTML5:

    • Canvas elements
    • Video and audio audio elements;
    • Support for local offline storage (localstorage,sessionstorage);
    • Added special content elements: article, footer, header, nav, section;
    • Added form controls: Calendar, date, time, email, url, search.

Take a look at video and audio today: The standard way to set up video in HTML5:

<video src= "Xxx.ogg" controls= "Controls" > your browser is not supported Oh </video>
  We can also set a number of source, the browser will select the first recognizable video for us to play, such as:
<video width= "height=" controls= "Controls" >  
<source src= "Xx1.mp4" type= "Video/mp4" >
Your browser is not yet supported Oh </video>
The video properties are:
Properties value Description
AutoPlay AutoPlay If this property appears, the video plays as soon as 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 height of the video player.
Loop Loop If this property appears, the media file starts playing again when it finishes playing.
Preload Preload

If this property appears, the video loads when the page loads and prepares to play.

If you use "autoplay", the property is ignored.

Src URL Video Address The URL of the video to play.
Width Pixel Sets the width of the video player.

Autobuffer

Autobuffer

(Auto-buffering)

When the Web page is displayed, the binary attribute indicates whether the user agent (browser) automatically buffers the content, or the user uses the relevant API for content buffering

Poster

URL Image Address

When the video is unresponsive or insufficient buffering, the property value is linked to an image. The image will be displayed at a certain percentage.

In HTML5, the audio element is defined as audio, and the audio element can play a sound file or stream.

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 is not yet supported Oh </audio>
Its properties are less than video height, width, poster.
Multimedia is becoming more and more important in our development, and HTML5 has appeared in these video and audio.

HTML5 Audio Audio and video

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.