tags:

views:

199

answers:

2

Hi all,

I'm against it as I'm sure ALL of you are, but my client wants background music on their website.

I'm very new to this, so was wondering how should I do that? I know I should use iframes, but what's the actual way of using them? eg: do I just create the home page with 2 frames (one for the music, one for the rest of the website), and then every time the user clicks on a link I can load the usual destination page - or should I update all pages in some way to make sure they are 'frames enabled'? Also, I do I style the frame to make sure it's hidden?

thanks, Patrick

ps please don't reopen the discussion about why background music is not good - I do know that and personally hate it. But the client is adamant and paying for it so... ;)

+2  A: 

I guess first you'll have to identify how you want to play the music: flash, midi, whatever...

Using iframes, you may have size issues. Normal frames may work better. Of course style it so it's hidden.

However, the big problem is, when the user navigates away from the website with links on the website, the music will continue to play.

Nasty...

So another way you could do it is open a cool music player interface for the visitor in a new window. The problem with this is that most browsers have pop-up blockers on by default.

Think about this seriously before you do it - there are side affects as you can see.

sims
A: 

In any browser there is a native audio player:

moz,webkit: <audio src=""></audio> msie: <bgsound></bgsound>

and to go from page to page without change use web.2 ajax instead of any ugly evil frames.

A nice demo of this setup is at http://sitegen.com.au/

JamesM
"Any browser" only includes FF > 3.5, Safari 3.1+ (where Quicktime is also installed), Opera (though it's a different implementation of the audio tag) and IE (surprisingly all versions but no way to allow music pausing, except *maybe* deleting the DOM element ). Chrome is not supported.
Graphain