3

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?

3 Answers 3

1

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

5
0

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>
4
  • While this is technically the most correct answer, it's still Windows Media Player, and still doesn't work outside Windows.
    – Pekka
    Jan 19, 2010 at 23:23
  • 2
    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
    Jan 19, 2010 at 23:58
  • Interesting, didn't know that.
    – Pekka
    Jan 20, 2010 at 0:06
  • I tried this code but it didn't work. I'll try again and will let you know about the result. Thanks!
    – dedalo
    Jan 20, 2010 at 22:19
0

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.