While you can do that, a word to the wise. Sometimes having a continuous background sound can annoy your user base and drive people away from the site. It's one thing on web sites I will avoid putting up for that reason. But if you really want to do this,
The code below will automatically launch background music and will play through the song file in a continuous loop. It will also embed a player into the page so that the visitor can stop the music if they want to. Keep in mind that many website visitors
find continuous background music very annoying, so use this code as tactfully as possible.
There is no way to play an audio or video continously through the whole site unless it's playing in a different window (popup may be). But take in mind that background music sucks big time specially when there is no way to stop it! What if your users
open the website while they are at a hospital etc.? If you really need to achieve this, you can use iframes. Load the javascript into a one iframe and make it consistent across pages. Have a seperate iframe to load the site pages. So the iframe which contains
the javascript won't get reloaded when there is a postback.
I can understand wanting to do this, but I must pass along a great site that teaches good design by showing off bad design in practice and perhaps some of you have visited this site before:
jitendra2coo...
Member
27 Points
54 Posts
Playing continuous background music
Mar 27, 2012 12:39 PM|LINK
I want to run backgruond music continuously in my website like this www.mkscollege.com.
How can I do this?
If possible give sample code or any e.g.
Thanks.
bbcompent1
All-Star
33824 Points
8760 Posts
Moderator
Re: Playing continuous background music
Mar 27, 2012 12:49 PM|LINK
While you can do that, a word to the wise. Sometimes having a continuous background sound can annoy your user base and drive people away from the site. It's one thing on web sites I will avoid putting up for that reason. But if you really want to do this,
Sum8
Contributor
4141 Points
931 Posts
Re: Playing continuous background music
Mar 27, 2012 12:50 PM|LINK
Try usnig below HTML tags:
In the BGSOUND tag, set the value of the property "LOOP" to "-1" representing an infinite loop.
Sumit Pathak
------------------
ThisPost = Helped == True ? "Mark As Answer" : "Elaborate your problem in more details"
madan535
Contributor
3229 Points
1180 Posts
Re: Playing continuous background music
Mar 27, 2012 12:55 PM|LINK
The code below will automatically launch background music and will play through the song file in a continuous loop. It will also embed a player into the page so that the visitor can stop the music if they want to. Keep in mind that many website visitors find continuous background music very annoying, so use this code as tactfully as possible.
ramiramilu
All-Star
97809 Points
14494 Posts
Re: Playing continuous background music
Mar 27, 2012 01:54 PM|LINK
Html5 Audio Tag in continous loop - http://www.catswhocode.com/blog/mastering-the-html5-audio-property
Thanks,
JumpStart
Ruchira
All-Star
44216 Points
7184 Posts
MVP
Re: Playing continuous background music
Mar 27, 2012 02:00 PM|LINK
Hello,
There is no way to play an audio or video continously through the whole site unless it's playing in a different window (popup may be). But take in mind that background music sucks big time specially when there is no way to stop it! What if your users open the website while they are at a hospital etc.? If you really need to achieve this, you can use iframes. Load the javascript into a one iframe and make it consistent across pages. Have a seperate iframe to load the site pages. So the iframe which contains the javascript won't get reloaded when there is a postback.
My Tech blog | My YouTube ChannelPlease 'Mark as Answer' if this post helps you.madan535
Contributor
3229 Points
1180 Posts
Re: Playing continuous background music
Mar 27, 2012 02:53 PM|LINK
How to Embed MP3 to a Website and Play Continuously without Interruption Across Pages
http://toughride.com/wordpress/how-to-embed-mp3-to-a-website-and-play-continuously-without-interruption-across-pages/
bbcompent1
All-Star
33824 Points
8760 Posts
Moderator
Re: Playing continuous background music
Mar 27, 2012 02:57 PM|LINK
That link is for wordpress, not asp.net friend.
madan535
Contributor
3229 Points
1180 Posts
Re: Playing continuous background music
Mar 27, 2012 03:41 PM|LINK
Sorry for that link Just use an i-frame. It's easy and will work.
bbcompent1
All-Star
33824 Points
8760 Posts
Moderator
Re: Playing continuous background music
Mar 27, 2012 03:44 PM|LINK
I can understand wanting to do this, but I must pass along a great site that teaches good design by showing off bad design in practice and perhaps some of you have visited this site before:
www.webpagesthatsuck.com
One of the things they mention is sound on the web page, FWIW :)