954,600 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Background music start

I have some music in the background of my website (Let it snow.mp3) - using the following code:


At the moment it starts playing automatically.

If the user is already listening to some music this can be annoying.

Would it be possible to have an alert box which comes up when the music is loaded saying something like:

Do you want to listen to "Let it Snow" by Chris Isaak while you browse my web site?
[Yes] [No]

Hope you can help

Martin

martinkorner
Junior Poster
102 posts since Aug 2005
Reputation Points: 10
Solved Threads: 0
 

Why not set autostart to false and set hidden to false? I THINK that would give some sort of musical icon they can click on to listen.

server_crash
Postaholic
2,111 posts since Jun 2004
Reputation Points: 113
Solved Threads: 20
 

The only thing wrong with that is if they don't see the player.

Martin

martinkorner
Junior Poster
102 posts since Aug 2005
Reputation Points: 10
Solved Threads: 0
 

I have a problem. on my website, a flash player plays a background sound but when I refresh it or i change the page, it stops like it is available only at that page. what can I do to hear that sound on multiple pages of my site? please help me

Clawsy
Posting Whiz in Training
225 posts since Feb 2008
Reputation Points: 11
Solved Threads: 7
 
I have a problem. on my website, a flash player plays a background sound but when I refresh it or i change the page, it stops like it is available only at that page. what can I do to hear that sound on multiple pages of my site? please help me

Unless you make your entire site with flash, I think the only way to achieve this is to use frames - so your site pages run in one frame on a main page which just has that frame and your flash player on.Hope this helps,
Martin

martinkorner
Junior Poster
102 posts since Aug 2005
Reputation Points: 10
Solved Threads: 0
 

Thanks but I do not use frames because its ruining the design I think. Someone told me another way but VERY VERY COMPLICATED. To use a session in php or something like that to register the 'time of the song' when I change the page and to resume it on the other page in that session. Is anyone who tried this complicated method? I do not know how to control the sound like that.

Clawsy
Posting Whiz in Training
225 posts since Feb 2008
Reputation Points: 11
Solved Threads: 7
 

Err... you could remember where the song is and restart it at the correct place on every page; but getting it syncronized properly over the Internet will be hell. It would take a long time to implement, a long time to test, and might not ever work without noticeable gaps or jumps in the song.

A frame is probably your best bet. I wouldn't worry about it 'runing the design', no1 need ever see the frames, and theres no reason you can't place a conformant W3C strict XHTML page inside a conformant W3C frameset XHTML frameset document. The only issue with frames is you lose the ability to use the address bar effectively.

MattEvans
Veteran Poster
Moderator
1,386 posts since Jul 2006
Reputation Points: 522
Solved Threads: 64
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You