HTML 5 Tutorial (v)

Source: Internet
Author: User

Video has been widely popular on the WEB, but its format is almost exclusively proprietary. YouTube uses flash,microsoft using Windows media®,apple to use QuickTime. The markup that is used in one browser to embed the content is not valid in another browser. As a result, WhatWG proposes to introduce a new video element that can be used to embed any visual format. For example, you can embed my QuickTime movie "a Sora in Prospect Park" with the following code:

<video src= "Http://www.css3-html5.com/sora.mov"/>

The choice of which format and decoder is preferred is still controversial. May strongly recommend or require the use of Ogg Theora. It is also possible to optionally support proprietary formats such as QuickTime and MPEG-4 formats that are subject to patent restrictions. The actual format is likely to be determined by the market, as in the GIF, JPEG, and PNG formats (these formats overwhelm the competitors of BMP, X-bitmap, and JPEG 2000 through market competition and become the preferred format for IMG elements).

It is also proposed to introduce audio elements. For example, you can use the following code to add a background music to a Web page:

<audio src= "Spacemusic.mp3" autoplay= "AutoPlay" loop= "20000"/>

The AutoPlay property instructs the browser to start playing immediately after the page is loaded, rather than waiting for an explicit user request. The audio loop plays 20,000 times and then stops (or stops when the user closes the window or turns to another page). Of course, browsers can (and should) allow users to shut down embedded media, not just the page author's request.

Browsers must support WAV format, and other formats such as MP3 can also be supported.

Because older browsers do not support these elements, and they do not make sense to blind and deaf users, audio and video elements can contain additional tags that describe the content of the audio and videos. This is also helpful for search engines. Ideally, these tags are full text versions of audio and video content. For example, code 8 shows John F. Kennedy's inaugural address written in HTML 5.

<audio src= "Kennedyinauguraladdrees.mp3" >
<p>
Vice President Johnson, Mr Speaker, Mr Chief Justice,
President Eisenhower, Vice President Nixon, President Truman,
Reverend Clergy, fellow citizens:
</p>
<p>
We observe today not a victory of the party, but a celebration of
Freedom--symbolizing a end, as a beginning--
Signifying renewal, as as. For I have sworn before
and Almighty God the same solemn oath our forebears
Prescribed nearly a century and three-quarters ago.
</p>
<p>
The world are very different now. For Mans holds in his mortal
Hands the power to abolish all forms of human poverty and all
Forms of human life. And yet the same revolutionary beliefs for
Which our forebears fought are still at issue around the globe--
The belief that the rights of a man come not from the
Generosity of the state, but from the hand of God.
</p>
<p>
...
</p>
</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.