View Full Version : adding mp3 to entire site

10-11-2008, 09:56 PM
Hey all, I added a mp3 sound to my index, with this code:

var musicsrc="bajofondo.mp3"
if (navigator.appName=="Microsoft Internet Explorer")
document.write('<bgsound src='+'"'+musicsrc+'"'+' loop="infinite">')
document.write('<embed src=\"'+musicsrc+'\" hidden="true" border="0" width="20" height="20" autostart="true" loop="true">')
I have two problems:

1/ Problem is that, when I click on a link to go to another page, the music stops. And when I place this code in every page, the music starts over again every time I go to another page. How can I keep the music going during the whole visit of the site, please ?

2/ How can add a 'stop/pause' image ?

10-14-2008, 02:23 AM
Why only in IE? Firefox (and probably Opera, Safari, etc.) can play music too.

To play the song across pages, I believe you need to let the user download the song file and play it in a standalone media player. When you play it on a page, it's dependent on that page's presence in the browser.

I have no idea about the buttons.