Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

JQuery: How to run background music in website? [closed]

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

like image 404
djmzfKnm Avatar asked Nov 03 '09 04:11

djmzfKnm


2 Answers

I use the JPlayer plugin. It has methods you can call to run audio at any time and without a player.

like image 180
Jourkey Avatar answered Oct 12 '22 19:10

Jourkey


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!

like image 42
Frankie Avatar answered Oct 12 '22 19:10

Frankie