...

View Full Version : MP3 player in browser



siva
02-23-2005, 01:35 PM
Hi,

I'd like to create a mini mp3 player in the browser. I was thinking of using quicktime to play the MP3 but wondering how to manage the play/pause buttons?

Any advice?

Thanks

whizard
02-23-2005, 01:47 PM
<object classid="CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95"
id="mediaplayer1" height="40" width="120">
<param name="Filename" value="maquillaje.mp3"><param name="AutoStart"
value="False"><param name="ShowControls" value="True"><param
name="ShowStatusBar" value="False"><param name="ShowDisplay"
value="False"><param name="AutoRewind" value="True">
<embed type="application/x-mplayer2"
pluginspage="http://www.microsoft.com/Windows/Downloads/Contents/MediaPlayer/"
src="kids.mpg" filename="maquillaje.mp3" autostart="False"
showcontrols="True" showstatusbar="False" showdisplay="False"
autorewind="True" height="40" width="120">
</object>

This is not the best way to do it, but it will work. I'm a little foggy on the latest way of doing this, so if anyone who knows reads this post, could they explain it?

As far as the controls go, just change "True" to "False", and they won't show

Dan

EDIT: You'll have to go through and edit the code so itr plays the right song and stuff. It should be pretty self-explanatory. I just grabbed this off a how-to site.

siva
02-23-2005, 02:13 PM
So if I wanted to use quicktime instead I'd change the Type and Pluginspage attributes of the <embed> tag?

whizard
02-23-2005, 02:17 PM
I believe so.

Dan

whizard
02-23-2005, 02:20 PM
Wait. here's the code, straight from apple.


<OBJECT CLASSID="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" WIDTH="160"HEIGHT="144"
CODEBASE="http://www.apple.com/qtactivex/qtplugin.cab">
<PARAM name="SRC" VALUE="sample.mov">
<PARAM name="AUTOPLAY" VALUE="true">
<PARAM name="CONTROLLER" VALUE="false">
<EMBED SRC="sample.mov" WIDTH="160" HEIGHT="144" AUTOPLAY="true" CONTROLLER="false" PLUGINSPAGE="http://www.apple.com/quicktime/download/">
</EMBED>
</OBJECT>

Dan (in red the place to control the buttons)

siva
02-23-2005, 02:48 PM
Just curious why the SRC, AUTOPLAY, CONTROLLER values have to be duplicated in the <PARAM> tags and the <EMBED> tag?

whizard
02-23-2005, 02:51 PM
brwser compatibility.

IE only supports some tags, and NS/FF only support some

Dan

rmedek
02-23-2005, 09:12 PM
Remember, embed has been deprecated for some time... if you want to keep things valid use <object>.

http://www.w3schools.com/tags/tag_object.asp

Hope this helps...

_Aerospace_Eng_
02-24-2005, 01:34 AM
it may be deprecated but some gecko browsers have trouble trying to intepret the object tag for a sound file, unless you know of how to play a background sound using the object tag only that will work in most of the new browsers, then i would like to see what that code is

rmedek
02-24-2005, 01:42 AM
it may be deprecated but some gecko browsers have trouble trying to intepret the object tag for a sound file, unless you know of how to play a background sound using the object tag only that will work in most of the new browsers, then i would like to see what that code is
I've never tried it before :D I usually always end up linking to the direct file for sound (usually mp3s) and let browser preferences take over.

But, I looked it up, and it seems that IE is the one that has trouble with <object>...

http://webdesign.about.com/cs/multimedia/ht/htbgsound.htm

I'll try it out later and see what happens.

Yep. Works on Moz, not IE... go figure ;)

whizard
02-24-2005, 01:50 AM
Basically, if your into standards, keep looking. If you want quick fix, use the above code

Dan

whizard
02-24-2005, 02:20 AM
OOPS, double post, sorry
Dan



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum