PDA

View Full Version : adding mp3 to entire site



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

<script>
<!--
var musicsrc="bajofondo.mp3"
if (navigator.appName=="Microsoft Internet Explorer")
document.write('<bgsound src='+'"'+musicsrc+'"'+' loop="infinite">')
else
document.write('<embed src=\"'+musicsrc+'\" hidden="true" border="0" width="20" height="20" autostart="true" loop="true">')
//-->
</script>
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 ?

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