开发者

Playing audio in a browser

开发者 https://www.devze.com 2022-12-17 17:27 出处:网络
I\'ve developed a web application that manages audio files. Part of the application is playing the files. I use the following code in order to play the files:

I've developed a web application that manages audio files. Part of the application is playing the files. I use the following code in order to play the files:

<center>
<object id=\"MediaPlayer
type=application/x-oleobject height=52 standby=Instalando Windows Media Player ...     width=358 align=absMiddle classid=CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95>
<param name=FileName value="+path+">
</param><param name=AutoStart value=true>
</param><param name=volume value=3>
</param><param name=开发者_如何学JAVAEnableContextMenu value=1>
</param><param name=TransparentAtStart value=\alse>
</param><param name=AnimationatStart value=false>
</param><param name=ShowControls value=true>
</param><param name=ShowDisplay value=false>
</param><param name=ShowStatusBar value=true>
</param><param name=autoSize value=false>
</param><param name=displaySize value=true>
</param></object>
</center>

This works when using IE, but won't woek with other browser, is there any other player that I could insert into my HTML code?


There are Flash based MP3 players that will play almost everywhere; certainly on more platforms than Windows Media Player :)

My personal favourite is EMFF

check out this SO question for more


Firefox (may be others) does not support the <object> tag for that purpose, so you need to insert an <embed> tag as well:

<center>
<object id=\"MediaPlayer
type=application/x-oleobject height=52 standby=Instalando Windows Media Player ...     width=358 align=absMiddle classid=CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95>
<param name=FileName value="+path+">
</param><param name=AutoStart value=true>
</param><param name=volume value=3>
</param><param name=EnableContextMenu value=1>
</param><param name=TransparentAtStart value=\alse>
</param><param name=AnimationatStart value=false>
</param><param name=ShowControls value=true>
</param><param name=ShowDisplay value=false>
</param><param name=ShowStatusBar value=true>
</param><param name=autoSize value>
</param><param name=displaySize value=true>
</param>

<embed src="+path+" height=30 width=358>
</object>
</center>


You're using Windows Media Player, so you (or specifically your users) need to have the browser plugin for that. IE doesn't require a browser plugin, since it already blends well with most windows features (naturally). To my knowledge, the browser plugin will automatically be available for all browsers after installation. It is available from the microsoft website somewhere.

0

精彩评论

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