Web Hosting Talk







View Full Version : Playing an MP3?


dazerrackers
02-20-2004, 02:33 PM
How do i play an MP3? on my site so it plays in the background whats the code for me to do it?
Its a stupid question i know :(

Wojtek
02-20-2004, 02:47 PM
and its a stupid thing to do in my oppinion

whenever theres backround music on a website I leave. Nothing more annoying.

You could put it in a flash if you want, but most people wont like that.

Corey Bryant
02-20-2004, 04:14 PM
Here is one snippet:

<object id="MediaPlayer" width=320 height=286
classid="CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95"
standby="Loading Microsoft® Windows® Media Player components..."
type="application/x-oleobject"
codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,7,1112">
<PARAM NAME="filename" VALUE="interview_fox_video.asx">
<PARAM NAME="autoStart" VALUE="true"> <PARAM NAME="showControls" VALUE="true">
<param name="ShowStatusBar" value="true"> <PARAM NAME="Autorewind" VALUE="true">
<PARAM NAME="ShowDisplay" VALUE="false">
<EMBED SRC="interview_fox_video.asx" WIDTH=320 HEIGHT=286 type="application/x-mplayer2" name=MediaPlayer autostart=1 showcontrols=0 showstatusbar=1 autorewind=1 showdisplay=0>
</EMBED></OBJECT>

Make sure to replace the source (interview_fox_video.asx) in BOTH places with the path to your MP3.

MGCJerry
02-20-2004, 05:21 PM
I have a php script that loads a directory of media files (mp3, mid, wav, etc), and allows the user to choose which one plays and to even stop the music.

You can look at the code to see how I did it... The source is located at: http://2thextreme.org/WebPlayer.phps

If this isnt what you're looking for, this may help others who use the search feature. :)

dazerrackers
02-20-2004, 07:43 PM
thankyou coreybryant, and all others who helped it works good now :D