Welcome to WebmasterWorld Guest from

Forum Moderators: incrediBILL

Message Too Old, No Replies

Need a simple background music player

Need to play an mp3, autostart crossplatform: firefox, IE, AOL



4:55 pm on May 15, 2010 (gmt 0)

10+ Year Member

Hello all! Its been awhile since i've posted here, i have gone to 3 confrences, twice in Las Vegas and once in New Orleans, my home town! Onto the question..

I am working on a site where my client wants to add an mp3 sound file to the background. I know i know, it's a bad idea but that's what she wants and i got her to only have it be 15 seconds and it fades out.

I am looking for a simple script to do this but everyone i have found does not work cross platform. She uses AOL browser and the simple embed feature will not play on all browsers, i need it to work on IE, AOL and firefox.

Also,i am looking for an mp3 script of some sort that will let people click on am image that i create that says "CLICK HERE FOR MUSIC" and the 15 second song will play.

So to summarize:

1. Need a simple mp3 player to play in background that works on AOL, IE and Firefox with autostart

2. Need a way to click on a customized image to start a song, doesn't have to be able to stop it.

Thanks, and time is of the essence!


6:54 pm on May 15, 2010 (gmt 0)

WebmasterWorld Senior Member tedster is a WebmasterWorld Top Contributor of All Time 10+ Year Member

I'd suggest importing the MP3 files into a Flash .flv file. Players for that technology are all over the place, and the market penetration and cross-browser compatibility are the best.


1:55 pm on Jun 25, 2010 (gmt 0)

5+ Year Member

<script language="JavaScript" type="text/javascript">
if (navigator.appName == "Microsoft Internet Explorer") {
document.write('<bgsound src="your-file.mp3" loop="false">');
else {
document.write('<embed type="application/x-mplayer2" pluginspage="http://www.microsoft.com/Windows/MediaPlayer/" name="MediaPlayer" src="your-file.mp3" autostart="true" showstatusbar="0" showcontrols="0" showdisplay="0" volume="1" height="1" width="1" loop="false"><br>');
// End -->

As far as I know this will do what you want. Note that the <bgsound> tag is the standard for playing music on IE and Opera. Put the code in your head tags and it'll play on pageload.

Featured Threads

Hot Threads This Week

Hot Threads This Month