Home > Web Front-end > H5 Tutorial > body text

Audio element in HTML5

黄舟
Release: 2016-12-22 15:32:28
Original
1685 people have browsed it

HTML 5 provides a standard for playing audio.

Audio on the Web

Until now, there was still no standard that aimed at playing audio on web pages. Today, most audio is played through plug-ins (such as Flash). However, not all browsers have the same plugins. HTML 5 specifies a standard way to include audio through the audio element. The audio element can play sound files or audio streams.


HTML5 supported audio formats

Currently, the audio element supports three audio formats:

Audio element in HTML5

How does it work?

To play audio in HTML 5, all you need is:

<audio src="song.ogg" controls="controls"> </audio>
Copy after login

The control attribute is used to add play, pause and volume controls.

The above is the content of the audio element in HTML5. For more related content, please pay attention to the PHP Chinese website (www.php.cn)!


Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template