View Full Version : How to make my music don't refresh if i go to another page
davelf
06-29-2010, 10:34 AM
How to make my music don't refresh if i go to another page?
I developing this page using php, and for the music i'm using flash.
this is the project (http://imaxxo.net/rotkan/)
thx in advanced:)
azoomer
06-29-2010, 08:02 PM
Hi davelf. I have seen a couple of threads with this issue before, but haven't seen a really good solution yet. Only way I can think of getting the music playing continuously when changing pages, is to have the new pages in a frame. Well, maybe you could load the new content with ajax or scroll animate it in a div. As far as i know you can't change the url. Making the whole site in flash could also do it.
It would be interesting if someone had a smarter solution though.
watch (http://css-tricks.com/video-screencasts/84-site-walkthrough/).
basically, the entire site is on a single page, and content is shown/hidden via jQuery. If there's too much content for a single page, you can use ajax in a similar fashion: reload the main content area rather than actually going to the new page. Since you don't actually go anywhere, the music doesn't stop.
davelf
07-01-2010, 02:42 AM
Hi davelf. I have seen a couple of threads with this issue before, but haven't seen a really good solution yet. Only way I can think of getting the music playing continuously when changing pages, is to have the new pages in a frame. Well, maybe you could load the new content with ajax or scroll animate it in a div. As far as i know you can't change the url. Making the whole site in flash could also do it.
It would be interesting if someone had a smarter solution though.
yup, i agree with that. I don't see any solution or source code to fix this problem too.
About your solution:
1. use iframe, i don't really like to use frame, it's just not compatible and fit with my design, i don't think this is for me.
2. make the whole page into flash, ya that could work out but, that's why i put this thread in HTML, cause i ask for HTML solution, not flash.
3. Ajax, this is what i thinking about.:)
Thx anyway
davelf
07-01-2010, 02:45 AM
watch (http://css-tricks.com/video-screencasts/84-site-walkthrough/).
basically, the entire site is on a single page, and content is shown/hidden via jQuery. If there's too much content for a single page, you can use ajax in a similar fashion: reload the main content area rather than actually going to the new page. Since you don't actually go anywhere, the music doesn't stop.
Thx traq, i never see a page like this before. They have a single URL for everypage, even they don't refresh?
i've already seen the video, and for my level it's too difficult to understand, so still hope someone will give an example or hard code to solve this. :)
djr33
07-01-2010, 04:44 AM
It IS complex. You are using everything backwards-- trying to not refresh one small part while refreshing everything else.
One very simple option that may be best if the other ways are too complex or don't work is to just use a popup. Have a "pop out" button on your music player, that creates a new window, then they can browse any page while keeping the popup available for the player.
yes, it's quite complex. I understand the concept, but the execution is beyond me at present. And there is quite a bit of code in that demo that's unrelated to the continuously playing music.
davelf
07-01-2010, 06:21 AM
It IS complex. You are using everything backwards-- trying to not refresh one small part while refreshing everything else.
One very simple option that may be best if the other ways are too complex or don't work is to just use a popup. Have a "pop out" button on your music player, that creates a new window, then they can browse any page while keeping the popup available for the player.
last time i develop a page where, user don't need to refresh, i use the dynamicdrive script, and it work the music don't need to refresh / start over and over again.
here is my work (http://imaxxo.com/imaxxo02/indexTree.html)
But after i finish develop that page, i got some problem:
1. It take to long waiting time to load all of the content.
2. I can't redirect or send a URL to my client to a single page (ex. portfolio, about, myservices, etc), because everything is in a single page.
So i don't think to make a page like that again, and Traq give a wonderful example, from what i see in the video, they fix all of my problem. But once again it's really complex.
And about your solution here, pop up?
:confused:
What does it mean?
so i make a separate page to put my music code there?
Thx to both of you..:)
djr33
07-01-2010, 06:52 AM
Yes, you would make one page (many pages) with your website, and a separate page with the music player.
davelf
07-15-2010, 03:12 AM
Hi, continue the last discussion, after trial and error for a week. I try a new solution.
I'm using iframe to make that music stay on it;s position (not refreshing)
i combine it with php, so this the big picture:
1. i make a music.html, i put my music flash there
2. i call that music.html and put it into a new page called music.php
<iframe src="music.html" width="100%" height="40" frameborder="0"></iframe>
3. and i call music.php in my index.php
How come the music.php don't show anything?
Is there any problem if i use the iframe in php?
Thx very much....:)
djr33
07-15-2010, 05:59 PM
I don't think that is enough information to be able to understand and help you. Do you have a link to the page?
I also still don't believe there is a way to use an iframe that won't refresh if you plan to refresh the main page.
And no, PHP works with iframes.
Also, I have an unrelated idea that might solve this. It is complicated, but I think it would work.
Create an index page for your site like this:
...
<body>
<iframe src="home.htm"></iframe>
<div class="musicplayer">MUSIC CODE</div>
</body>
</html>
For "musicplayer", add absolute positioning that places it above the rest of the page, above the iframe.
For the iframe, make it 100% width and 100% height.
Then just create more pages like home.htm, and link to them within the iframe and it will load in the iframe.
The only major problem with this is that your page will always have the same URL (for the main page), and people can't bookmark specific pages. But I don't know any way at all to avoid that if you are using a static music player.
davelf
07-16-2010, 02:53 AM
The only major problem with this is that your page will always have the same URL (for the main page), and people can't bookmark specific pages. But I don't know any way at all to avoid that if you are using a static music player.
aaaaahhh, this client killing me softly.
They want a every single page have their own url, but they don't want the music refresh...
i need to pray more...
Thx djr33...
djr33
07-16-2010, 03:00 AM
You could TRY to use Javascript to create a #page part of the URL. But I don't know how that would work. It might...
davelf
07-17-2010, 05:10 PM
if you mean like traq said, honestly i don't even know how to start, haha.
That not at my level, maybe some day.:D
azoomer
07-17-2010, 05:34 PM
Davelf, check this out
http://www.asual.com/jquery/address/
see the "tabs" for example, I mean
http://www.asual.com/jquery/address/samples/tabs/
you can change the last part of the url while staying on the same page ( continuous music) and you can change most of the contents with ajax. The ajax content can be made crawlable by spiders. I think it's better than frames (anything is better than frames). And it should be way easier than the jQuery demo from css-tricks
edit:
I made a DEMO HERE (http://azoomer.com/davelf/)
It takes a while for the music to load, but after that it keeps playing even though the ( pseudo) urls and the content changes. View it in FF, safari or chrome. There's a problem in with the music in IE that i have to work on.
Update: OK now it should be working in IE too (with a little hacking). The code is not so pretty now so there's a little work for you to do if you want to use it.
Powered by vBulletin® Version 4.2.2 Copyright © 2021 vBulletin Solutions, Inc. All rights reserved.