views:

966

answers:

5

I really like the mp3 player on 8tracks.com and was wondering how they manage to keep the mp3 playing even when I change pages?

For example, listen to the track here http://8tracks.com/mixes?q=Aztec+Camera and click on one of the links to another page. The music cuts out for 1/4 of a second and then comes back in at exactly the right point!

I don't think it's using a streaming server, so was wondering if it's a feature of flash?

A: 

Dunno if this is how they do it, but you could always put the music-player and the main page in two different frames (with only the main content-frame visible). Of course that wouldn't help with (eg) typing a new address into the address-bar.

EDIT: That's not how they're doing it. Presuambly they're saving the song & playback position in a cookie and using it to restart the player on each new page.

A: 

Yup, but you would get all the problemas that are involved with frames, you would end adding script code on all pages to take care when the user entered the site directly without the frame defining site

AlbertEin
Because answers are most often sorted by votes and not by time like a traditional forum this answer is totally out of context-- i.e. we have no idea what post you're talking about. If you want to comment on other people's posts add a comment, not another answer (like I'm doing now)
SCdF
After typing that I realised you had rep < 50 so you can't post comments (not sure why this is :s). Until then, can you link to the posts you're talking about?
SCdF
ah, I was wondering about the non-sequitur too...
matt lohkamp
Sorry, it was my first comment so i didn't know about that, thanks for the tip =)
AlbertEin
A: 

You could do it with Ajax by making it so that your internal "links" don't actually navigate to another page, but simply load content into your main content div. This would allow any streaming media to continue uninterrupted as long as it resides outside the div where the content is being replaced.

alord1689
A: 

Or avoid ajax and instead use a iframe

AlbertEin
+4  A: 

Keep it simple: have the player store the current track/time in a cookie when onunload fires, then start from there when the next page loads. You'll need to write a couple support functions in JavaScript, as AFAIK Flash doesn't have access to browser cookies or JS events.

skymt
+1 this is what I would have wrote but you did it more fast!
Daok