HTML5 Audio
HTML5 Audio(audio)
Audio on the Internet
Until now, there is still no such thing A standard designed to play audio on web pages.
Today, most audio is played through plug-ins (such as Flash). However, not all browsers have the same plugins.
HTML5 specifies a standard for embedding audio elements on web pages, using the
Browser support
Internet Explorer 9+, Firefox, Opera, Chrome, and Safari all support the
Note: Internet Explorer 8 and earlier IE versions do not support the
HTML5 Audio - How it works
To play audio in HTML5, you need to use The following code:
Example
Audio format and browser support
Currently, the
Chrome 6 +
Safari 5+ yes yes no
#11 10+ yes yes yes yes yes
## Autoplay AutoPlay If the attribute appears, the audio will be played immediately after ready. # Controls Controls If this attribute appears, it will display the control to the user, such as the play button. Loop Loop If this attribute appears, it will start playback at the end of the audio. Preload Preload If this attribute appears, the audio is loaded when the page is loaded, and it is prepared to play. If you use "AutoPlay", ignore the attribute. # SRC URL to play the audio URL.