开发者

What is the most "compatible" way of autoplaying sound?

I want to add a sound in my page that autoplays but it seems like all ways require some plugin or codex or idk so I'm not quite sure what is the best audio for开发者_Go百科mat and way to code it so it works for most users and browsers.

Is there some way to works for most people?

Thanks


you can use BGSOUND tag like this :

<BGSOUND SRC="waitng2.wav" LOOP="2"> 

but only accepts WAV and MID formats.

for MP3 formats you can use EMBED tag but in some browser need plugin to be played.

<embed src="http://www.davesite.com/webstation/html/davesite.mp3" 
   loop="true" autoplay="false" width="145" height="60"></embed>

you can also use compination of these two ways to correct compatablity problem:

<NOEMBED><BGSOUND SRC="waitng2.wav" LOOP="2"></NOEMBED>
<EMBED SRC="waitng2.mp3" HEIGHT="0" WIDTH="0" AUTOSTART="TRUE"></EMBED> 
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜