471,853 Members | 1,254 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,853 software developers and data experts.

Play Music in background while browsing though website

Hi everyone.

How can I play music in background while user can browse through my website. Uptill now I have created a music player which plays audio tracks but as soon as users jumps to another page the music stops.

How can I achieve this. any ideas !!!!!


Muddasir Hussain
Aug 10 '09 #1
17 12611
anybody ?
Aug 10 '09 #2
6,050 Expert 4TB
What are you using to play the sound?

P.S. Do not rush people - this is a privilege, not a service.

Aug 10 '09 #3
8,658 Expert Mod 8TB
this thread should be moved to HTML forum, since it’s got nothing to do with PHP. please ask a Moderator to move it there.
Aug 10 '09 #4
6,050 Expert 4TB
See my post above. When the user responds on the method used, I'll move it to the appropriate forum.

Aug 10 '09 #5
3,503 Expert Mod 2GB
On a side note, I personally think its just wrong to put music on to a site for a user to listen to, that they didn't choose to begin with. I usually find a way to disable it if I can as it usually conflicts with whatever I already am listening to. Just my .02.


Aug 10 '09 #6
569 Expert 512MB
I totally agree with you, but that's a design question :-)

Muddasir, you could divide your page in two frames. One of 100% and one of 0%, to make it invisible. In the 0% frame you put your music stuff and in the other one the rest. This will only work if you reload only the 100% frame and not the index.php where the frames are defined!

Aug 10 '09 #7
Thank you all for replying.

I am using embed code for player. It also has a feature of adding music to play list. Actually its the requirement of the project to keep playing the music while user can browse through the site.

@Steven: thanks i will try that

and my apologies for posting this question in this section rather than in html forum

- Muddasir
Aug 11 '09 #8
431 Expert 256MB
I was of the same opinion until recent. A friend of mine (photographer) showed me a site (gallery) with music that was working so well with the art work presented. Like sometime they do for real world galleries. After seeing that example I am not so quick on dismissing music on the site. But hey that's design issue :)
Aug 11 '09 #9
5,058 Expert 4TB
I was looking into pretty much this exact problem a while ago.

The only two solutions I came up with were using frames, as Steven suggested, and creating a 100% client-side site.
Personally I would rather create a client-side web then use frames, but that's just me.

Another option I disregarded from the start was to open the music player in another window, but that is an option if you don't mind using such a crude method.
Just make sure to take pop-up blockers into account if you do.

And I have to agree with Jeff to. I hate it when websites start playing audio without any warning.
Aug 12 '09 #10

Thank you for your reply.

Actually the site I am developing does not play audio without warning and stuff. Here is how it works on my website..

-> Registered user searches for music on the site..
-> User can add music track of their choices to the play list of music player.
-> If user click on PLAY then music will start playing in the player.

Note: Music player is on the right panel of the website and it appears on every page.

Now currently if user click on any other page. then music player stops playing, user has to replay it.

I will try using iframe. let see what happens.

PS: It was not my idea... its the client who wants this to be implemented :S :(

Thanks everyone :)

- Muddasir
Aug 12 '09 #11
6,050 Expert 4TB
If you were using flash, you could note the time that the page was closed (might have to do this in javascript) and set a cookie with that value. Then, when the page is re-opened, start the sound from that offset. As far as I know, you cannot set the start time offset on an <embed> object.

Anyway - moving this to HTML.

Aug 12 '09 #12
664 Expert 512MB
I need to find a solution to this ideal.
I'm making a wedding video website and I have music in the background for all the pages. There is one page where I want the music to stop so the user can view some videos. If the used decide they are done with that page they can click on the menus and I want the audio to restart on any of the pages. There are a total of 5 pages plus the video page.

I'm using two frames a main frame where the pages load and a menu page were the audio is located. I'm using a wave file and I placed the audio using Plugin.
is there a way I can stop the audio and restart it?

Any help in this area would be great
Aug 12 '09 #13
6,050 Expert 4TB
Flash or HTML (or silverlight maybe).
Aug 12 '09 #14
664 Expert 512MB
Flash take way to long to upload 6 pages of content, esp with the home page where I have a movie clip.
I'm using HTML now.
Will look into silverlight, I never used it.

I was hoping for s java scrpit .

Aug 12 '09 #15
6,050 Expert 4TB
I mean HTML 5, sorry.

Flash doesn't take long to load... not at all. I, using a MP3 API developed (which I have since lost), wrote a small music player, it loaded just as fast as any other element on my website.

Mark (must rewrite that API).
Aug 12 '09 #16
664 Expert 512MB
Thanks for the help so far.
I tied using Flash and it took along time to before the site came up.
I have 6 pages with a pre-loader on each one. The stage is set to 750 by 550
I have a background image set the stage size. rate is set to 60fps
photos are png at 72dpi
Each page has its own scene,
Page 1 has 6 photos in a movie clip rotating.
page 2 is about us
page 3 packages available
page 4 the video section this one take a while to load it had 10 different scene in it
page 5 content info
page 6 links

It takes about 6 to 9 sec. for it to load. and when I goto page 4 it takes another 3-4 seconds to load.
I have an audio file in a wave formate.

anyways I'm looking into creating a java applet, hoping that will solve the problem.


PS I only have dreamweaver 2004mx and flash professional flash project only goes to 7
Aug 12 '09 #17
5,058 Expert 4TB
I tried this, and it worked... but there was to long a pause in the music while the page was loading. Kind of made you want to not browse the web, so not to interrupt the music. Not exactly what you want your visitors to be thinking :-P

If I remember correctly, I just passed the offset into the Flash movie as a GET parameter.

I posted a thread about this in the Flash forum back then.
Aug 13 '09 #18

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

1 post views Thread by chitara | last post: by
reply views Thread by NeoPa | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.