标签:style blog io ar sp strong 数据 on 2014
在HTML5标准网页里面,我们可以运用audio标签来完成我们对声音的调用及播放。
以下是最经常见到的运用HTML5三种基本格式:
1.最少的代码
<audio src="song.ogg" controls="controls"></audio>
2.带有不兼容提醒的代码
<audio src="song.ogg" controls="controls"> Your browser does not support the audio tag. </audio>
3.尽量兼容浏览器的写法
<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>
HTML5音频格式
当前,HTML5 Audio标签支持三种格式的音频,分别是wav mp3和ogg格式。而目前主流浏览器对他们的支持如下:
IE 9 | Firefox 3.5 | Opera 10.5 | Chrome 3.0 | Safari 3.0 | |
---|---|---|---|---|---|
Ogg Vorbis | √ | √ | √ | ||
MP3 | √ | √ | √ | ||
Wav | √ | √ | √ |
IE8以及IE8以下不支持HTML5的audio标签。
HTML 5 Audio属性
标签:style blog io ar sp strong 数据 on 2014
原文地址:http://blog.csdn.net/wangxw8746/article/details/40739797