homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Code, Content, and Presentation / HTML
Forum Library, Charter, Moderators: incrediBILL

HTML Forum

Need a simple background music player
Need to play an mp3, autostart crossplatform: firefox, IE, AOL

10+ Year Member

Msg#: 4133216 posted 4:55 pm on May 15, 2010 (gmt 0)

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!



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

Msg#: 4133216 posted 6:54 pm on May 15, 2010 (gmt 0)

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.


Msg#: 4133216 posted 1:55 pm on Jun 25, 2010 (gmt 0)

<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.

Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / HTML
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved