tags:

views:

70

answers:

3

Hi,

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=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=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?

Thanks

+1  A: 

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

Pekka
I made one: http://quickmediasolutions.com/sandbox/audio_player/ It comes with instructions too!
George Edison
George: The sample rate heads-up at the bottom of your player page possibly answers a question I had earlier today: http://stackoverflow.com/questions/2095185/embedded-flash-mp3-player-slow-on-some-files-normal-on-others What a great coincidence!!
Pekka
Great! I answered your question there :)
George Edison
We will test it in the next few days and I'll accept your answer if it works out. Cheers!
Pekka
Cool. Any questions or comments, feel free to contact me at [email protected]
George Edison
A: 

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.

Tor Valamo
A: 

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>
Mikael S
While this is technically the most correct answer, it's still Windows Media Player, and still doesn't work outside Windows.
Pekka
It does. I use mplayerplug-in in Firefox and Chrome under Linux. Firefox just chose the correct player after what file to play.
Mikael S
Interesting, didn't know that.
Pekka
I tried this code but it didn't work. I'll try again and will let you know about the result. Thanks!
dedalo