Html – Playing audio in a browser

audio, audio-player, html

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=\"MediaPlayertype=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?

Best Solution

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=\"MediaPlayertype=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>