New features such as html5 audio and video

Source: Internet
Author: User

Comments: Html5, as the next-generation web standard, started the html5 craze years ago. html5 audio frequency audio and video have been noticed by netizens, And I am curious to collect and sort out some related stuff, if you want to know more about html5, you can refer to html5 as the next-generation web standard. A year ago, Xuan started the html5 craze. I just want to know about html5. I don't want to say anything about html5 and RIA (silverlight, flash, JavaFx, etc.), and there is nothing to say. There is a reason for its existence. It is proven by facts and time.

Some new features appear in html5:
Canvas Element: video and audio/audio elements;
Support for local offline storage (localStorage, sessionStorage;
Add special content elements: article, footer, header, nav, and section;
Add Form Controls: calendar, date, time, email, url, and search.
Today, let's take a look at the video and audio frequency. In html5, we set the standard video method: video.
<Video src = "xxx.ogg" controls = "controls"> your browser does not support it yet. </video> You can also set multiple sources, the browser selects the first identifiable video for us to play, such: <video width = "320" height = "240" controls = "controls"> <source src = "xxx.ogg" type = "video/ogg"> <source src = "xx1.mp4" type = "video/mp4"> your browser does not support the following video attributes:

Attribute Value Description
Autoplay Autoplay If this attribute appears, the video will be played immediately after it is ready.
Controls Controls If this attribute is displayed, the control, such as the play button, is displayed to the user.
Height Pixels Set the height of the video player.
Loop Loop If this attribute is displayed, the media file starts playing again after being played.
Preload Preload

If this attribute is displayed, the video is loaded when the page is loaded and ready for playing.

If "autoplay" is used, this attribute is ignored.

Src Url video address The URL of the video to be played.
Width Pixels Set the width of the video player.

Autobuffer

Autobuffer

(Automatic buffering)

When a webpage is displayed, the Binary Attribute indicates whether the content is automatically buffered by the user proxy (browser) or the content is buffered by the user using related APIs.

Poster

Url image address

 

When the video does not respond or the buffer is insufficient, the attribute value is linked to an image. The image will be displayed in a certain proportion.


In HTML5, the audio frequency standard is set to the audio element, which can play audio files or audio streams.
The audio format is similar to video: multiple sources are directly inserted.:

The Code is as follows:
<Audio controls = "controls">
<Source src = "xx.ogg" type = "audio/ogg">
<Source src = "xx1.mp3" type = "audio/mpeg">

Your browser does not support it yet.
</Audio> its attributes are smaller than those of video, such as height, width, and poster. In our development, multimedia is becoming more and more important, and html5 has seen these videos and audio.

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.