扫码一下
查看教程更方便
html5 提供了播放音频文件的标准。
直到现在,仍然不存在一项旨在网页上播放音频的标准。
今天,大多数音频是通过插件(比如 flash)来播放的。然而,并非所有浏览器都拥有同样的插件。
html5 规定了在网页上嵌入音频元素的标准,即使用
internet explorer 9 , firefox, opera, chrome, 和 safari 支持
注意: internet explorer 8 及更早ie版本不支持
如需在 html5 中播放音频,你需要使用以下代码:
control 属性供添加播放、暂停和音量控件。
在 之间你需要插入浏览器不支持的
目前,
浏览器 | mp3 | wav | ogg |
---|---|---|---|
internet explorer 9 | yes | no | no |
chrome 6 | yes | yes | yes |
firefox 3.6 | yes | yes | yes |
safari 5 | yes | yes | no |
opera 10 | yes | yes | yes |
format | mime-type |
---|---|
mp3 | audio/mpeg |
ogg | audio/ogg |
wav | audio/wav |
标签 | 描述 |
---|---|
定义了声音内容 | |
规定了多媒体资源, 可以是多个,在 |