HTML5 audio

The basic properties and the use of audio sound label

audio playback standard definition of major label sound file or an audio stream, all current major browsers support the tag, it supports three audio formats are Ogg, Mp3 and Wav.

If you need to play audio in HTML5 page, enter the following basic format

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

</audio>

Which, src attribute is the address specified audio to be played back, control the properties for adding play, pause and volume controls, inserted between the <audio> and </ audio> The content is not supported by the browser for display of audio elements.

autoplay autoplay If this attribute is present, the audio playback immediately after the ready. 

controls controls if the property is in, then displayed to the user controls, such as play button. 

loop loop if the property appears whenever the audio end start playing again. 

preload preload If this attribute is present, the audio is loaded when the page is loaded and ready to play. If you use the "autoplay", this attribute is ignored. 

src url URL to play audio. 

Guess you like

Origin www.cnblogs.com/wwttc/p/11368505.html