Measure the test taker's knowledge about the multimedia-audio (audio) in HTML5)

Source: Internet
Author: User

Use audio tags <audio>

The use of the audio tag is very similar to that of the Video: when multiple audio files are specified, the browser will play the first supported audio file.

1. <audio src = "audio.ogg" controls>

2. Your browser does not support <audio> labels.

3.
</Audio>

 

Figure 5All <audio> available attributes are listed. Because you do not need to display the entire control like a video player, the high, low, and preview charts (poster) are no longer needed.

Figure 5
Audio tag <audio> attributes

Attribute

Value

Description

Autoplay

Autoplay

If specified, the audio will be played immediately after preparation.

Controls

Controls

Display the playback control toolbar ..

Loop

Loop

If this parameter is specified, loop playback is enabled.

Preload

Preload

If specified, the audio will be loaded during page loading. When Autoplay is specified, it is ignored.

SRC

URL

The URL of the target audio.

 

Like the video tag, you can specify multiple files and the browser will play the first file supported. You can also specify a fallback information for display when the browser does not support the <audio> label. The following is a simple example:

1. <audio controls autoplay>

2. <source src = "audio1.ogg" type = "audio/Ogg"/>

3. <source src = "audio1.mp3" type = "audio/MPEG"/>

4. Your browser does not support <audio> labels.

5.
</Audio>

 

Summary

Currently, the biggest problem with HTML5 multimedia is that you must provide different formats of files for different browsers, but its application is also the trend of the times. The following are some great references:

  • Http://www.w3.org/TR/html5/video.html
  • Http://dev.w3.org/html5/spec/Overview.html
  • Http://w3schools.com/html5/default.asp
  • Http://html5test.com/
  • Http://caniuse.com/

Reference: Learn about multimedia-video in HTML5)

Original article address: working with media in HTML5

Author: Jason beres

Reprinted please indicate the source: http://blog.csdn.net/horkychen

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.