HTML5 Advanced -5 HTML5 audio processing (audio playback in H5, programming of audio players)

Source: Internet
Author: User

First, play audio in the HTML5


Audio element

-The audio element can be embedded in an HTML page, and the attributes of the element can be set to be automatically played, preloaded, and looped back.

-The audio element provides play, pause, and volume controls to control

650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M02/7E/3D/wKiom1b6LpjQvCMiAABCaU0pHzY845.png "title=" Web.png "alt=" Wkiom1b6lpjqvcmiaabcau0phzy845.png "/>

-Use the audio element to provide files in three different formats: MP3, OGG, Wav

-MP3: Using MPEG Audio decoder

-OGG: Using OGG Audio decoder

-WAV: With WAV Audio decoder

650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M01/7E/39/wKioL1b6L8HQg5aIAAEjBqtlbkY161.png "title=" Web.png "alt=" Wkiol1b6l8hqg5aiaaejbqtlbky161.png "/>

-Grammatical structure

650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M00/7E/39/wKioL1b6L-2Sqgz6AAD0msw0fpI128.png "title=" Web.png "alt=" Wkiol1b6l-2sqgz6aad0msw0fpi128.png "/>


Audio properties

-The audio element supports the following properties

-src: Specifies the URL of the file to be played through <source>

-Controls: Can activate the default page provided by each browser

-AutoPlay: AutoPlay after loading audio

-Loop: When this property is set, the audio is played repeatedly

-Preload: Cache settings


Second, the programming realization Audio player


Reference: http://jasonteach.blog.51cto.com/5192112/1758040 programming for video player


Summary: This chapter mainly introduces the next HTML5 audio processing (playing audio in H5, programming to implement audio player)


This article from the "Technical Exchange" blog, declined reprint!

HTML5 Advanced -5 HTML5 audio processing (audio playback in H5, programming of audio players)

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.