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?
我真的很喜欢8tracks.com上的mp3播放器,并且想知道即使我换页面他们如何设法保持mp3播放?
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!
例如,请在此处收听http://8tracks.com/mixes?q=Aztec+Camera中的曲目,然后单击指向其他页面的其中一个链接。音乐切断1/4秒,然后在正确的点回来!
I don't think it's using a streaming server, so was wondering if it's a feature of flash?
我不认为它使用流媒体服务器,所以想知道它是否是闪存的功能?
5 个解决方案
#1
4
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.
保持简单:让玩家在onunload触发时将当前曲目/时间存储在cookie中,然后在下一页加载时从那里开始。您需要在JavaScript中编写一些支持函数,因为AFAIK Flash无法访问浏览器cookie或JS事件。
#2
0
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.
Dunno如果这是他们这样做的话,但是你总是可以将音乐播放器和主页放在两个不同的帧中(只有主要的内容框架可见)。当然,这对于(例如)在地址栏中键入新地址没有帮助。
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.
编辑:这不是他们这样做的方式。 Presuambly他们将歌曲和播放位置保存在cookie中并使用它在每个新页面上重新启动播放器。
#3
0
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.
您可以使用Ajax来实现它,以便您的内部“链接”实际上不会导航到另一个页面,而只是将内容加载到主内容div中。这将允许任何流媒体继续不间断,只要它位于替换内容的div之外。
#4
0
Or avoid ajax and instead use a iframe
或者避免使用ajax而是使用iframe
#5
-1
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
是的,但你会得到所有涉及框架的问题,你会在所有页面上添加脚本代码,以便在用户直接进入网站时不需要框架定义网站
#1
4
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.
保持简单:让玩家在onunload触发时将当前曲目/时间存储在cookie中,然后在下一页加载时从那里开始。您需要在JavaScript中编写一些支持函数,因为AFAIK Flash无法访问浏览器cookie或JS事件。
#2
0
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.
Dunno如果这是他们这样做的话,但是你总是可以将音乐播放器和主页放在两个不同的帧中(只有主要的内容框架可见)。当然,这对于(例如)在地址栏中键入新地址没有帮助。
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.
编辑:这不是他们这样做的方式。 Presuambly他们将歌曲和播放位置保存在cookie中并使用它在每个新页面上重新启动播放器。
#3
0
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.
您可以使用Ajax来实现它,以便您的内部“链接”实际上不会导航到另一个页面,而只是将内容加载到主内容div中。这将允许任何流媒体继续不间断,只要它位于替换内容的div之外。
#4
0
Or avoid ajax and instead use a iframe
或者避免使用ajax而是使用iframe
#5
-1
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
是的,但你会得到所有涉及框架的问题,你会在所有页面上添加脚本代码,以便在用户直接进入网站时不需要框架定义网站