views:

2055

answers:

8

I am searching for a plugin or code using which I'll be able to run background music when my website will open. This type of functionality normally found in flash website, where background, but I want to make it using jquery in my website,

Please provide any plugin or code link, which will help me in this issue.

Thanks

+4  A: 

Heres a nice link

Playing and Controlling MP3 songs and FLV videos with javascript

rahul
+3  A: 

You might want to look into the HTML 5 <audio> tag, although if you want IE support you'll ultimately have to fall back to a plugin like Flash or Quicktime.

Tobias Cohen
+5  A: 

I use the jplayer plugin. http://www.happyworm.com/jquery/jplayer/

It has methods you can call to run audio at any time and without a player.

Jourkey
This is cool and works for me. I choose this because I'm already using JQuery library in ma website. :D Thanks
Prashant
A: 

The only cross-browser, OS-independent way you can do this horrible thing is to use an invisible flash applet that exposes an API you can control via Javascript. Sadly, I don't know how to make one and I can't find an invisible player anywhere so I guess my answer isn't very useful. Oh well.

Kaze no Koe
+1  A: 

I think the way to go is the SoundManager library - I've used it for a similar purpose where a client demanded to have background music.

It's also used by sites like CitySounds.fm.

VoxPelli
+4  A: 

This is a perfectly good and acceptable question.

If you site consists of more than one page - it's not Flash nor full Ajax (like Gmail) - you have to make sure the player stays on a frame that does not change so that your music does not stop when you click a link.

 ---------------------
|    site content     |
|                     |
|---------------------
|  invisible frame    |
 ---------------------

This will also mean that a problem can arise with searching bots that may point directly into a frame of your site - skipping the index and thus disabling music. If that is not the case you should be fine.

You can then use a sound library SoundManager, like @VoxPelli pointed out, to control your javascript. Do notice that the site @VoxPelli mentions is a great example of a site with music! However when you click on explore the music breaks as the user is directed to a new page. The only way to overcome this is with frames.

Hope it helps!

Frankie
+1 Interesting workaround for page browsing.
Kevin Peno
A: 

You should check this short and sweet tutorial http://motyar.blogspot.com/2010/07/play-sounds-on-web-with-soundmanager.html

Motyar