Home >Web Front-end >HTML Tutorial >Html5 audio_html/css_WEB-ITnose

Html5 audio_html/css_WEB-ITnose

WBOY
WBOYOriginal
2016-06-24 11:49:281128browse

Currently, the audio element supports three audio formats:

  IE 9 Firefox 3.5 Opera 10.5 Chrome 3.0 Safari 3.0
Ogg Vorbis    
MP3    
Wav    

Eg.

<audio controls="controls">  <source src="song.ogg" type="audio/ogg">  <source src="song.mp3" type="audio/mpeg">Your browser does not support the audio tag.</audio>

b97864c2e0ef2353a16c4d64c7734e92 Attributes of the tag

Attribute value description
autoplay autoplay If this attribute appears, the audio will be played as soon as it is ready.
controls controls If this attribute appears, displays controls, such as a play button, to the user.
loop loop If this attribute is present, playback will restart whenever the audio ends.
preload preload 属性 值 描述
autoplay autoplay 如果出现该属性,则音频在就绪后马上播放。
controls controls 如果出现该属性,则向用户显示控件,比如播放按钮。
loop loop 如果出现该属性,则每当音频结束时重新开始播放。
preload preload

如果出现该属性,则音频在页面加载时进行加载,并预备播放。

如果使用 "autoplay",则忽略该属性。

src url 要播放的音频的 URL。
If this attribute appears, the audio will be loaded when the page is loaded and prepared for playback . This attribute is ignored if "autoplay" is used.
src url The URL of the audio to be played.
Statement:
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