Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Background Music


poppomooora

Recommended Posts

I want to know how to add a background music of only 1 song, and with a button for pausing the music. I just want it to be easy with only 1 song playing and then i can change the song by uploading a new song.

 

Thanks in advance

Link to comment
Share on other sites

Borrowing code from a site I did a long time ago, the basic code goes something like this:

 

<div>
<script language="JavaScript">
if(navigator.appName=="Netscape"){
document.write('<embed src="apollo11.wav" autostart="true" loop="false" controls="LargeConsole" width=100 height=25></embed>');}
else if(navigator.appName=="Microsoft Internet Explorer"){
document.write('<embed src="apollo11.wav" autostart="true" loop="false" width=100 height=25></embed>');}
else{
document.write('<embed src="apollo11.wav" autostart="true" loop="false"></embed>');}
</script>
<noscript><embed src="apollo11.wav" autostart="true" loop="false"></embed></noscript>
<noembed><bgsound src="apollo11.wav" loop=false></noembed>
</div>

In that code you'd want to change the file name it plays (it's set to play apollo11.wav).

 

And if you wanted the song to repeat change all instance of loop="false" to loop="true"

 

I give this code with this caveat: Most of the time when I click on a link that leads me to a site playing music my normal immediate reaction is to close the page.

 

If I want to listen to music I'll turn on the radio, thank-you very much...

:rolleyes:

If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Link to comment
Share on other sites

i have 1 question. where to add this code? to which file? :)

well im trying to convince the site owner that really customers are going to close the page, but he dont want to believe :) so i will do it for him as he will see the results :D

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...