如果用户更改页面,如何让 flash mp3 播放器继续播放?

发布于 2024-07-06 10:59:23 字数 285 浏览 9 评论 0原文

我真的很喜欢 8tracks.com 上的 mp3 播放器,并且想知道他们如何在我更改页面时保持 mp3 播放?

例如,在此处收听曲目 http://8tracks.com/mixes?q=Aztec+相机并单击指向另一页面的链接之一。 音乐中断了 1/4 秒,然后在正确的位置重新出现!

我不认为它使用流媒体服务器,所以想知道这是否是闪存的一个功能?

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

橙幽之幻 2024-07-13 10:59:23

保持简单:让播放器在 onunload 触发时将当前曲目/时间存储在 cookie 中,然后在加载下一个页面时从那里开始。 您需要用 JavaScript 编写几个支持函数,因为 AFAIK Flash 无法访问浏览器 cookie 或 JS 事件。

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.

绾颜 2024-07-13 10:59:23

不知道他们是否这样做,但您始终可以将音乐播放器和主页放在两个不同的框架中(仅主要内容框架可见)。 当然,这对于(例如)在地址栏中输入新地址没有帮助。

编辑:他们不是这样做的。 据推测,他们正在保存这首歌& cookie 中的播放位置并使用它在每个新页面上重新启动播放器。

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.

玩套路吗 2024-07-13 10:59:23

您可以使用 Ajax 来做到这一点,这样您的内部“链接”实际上不会导航到另一个页面,而只是将内容加载到您的主内容 div 中。 这将允许任何流媒体不间断地继续,只要它驻留在内容被替换的 div 之外。

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.

好倦 2024-07-13 10:59:23

或者避免使用ajax而使用iframe

Or avoid ajax and instead use a iframe

━╋う一瞬間旳綻放 2024-07-13 10:59:23

是的,但是您会遇到与框架有关的所有问题,您将结束在所有页面上添加脚本代码,以在用户直接进入网站而不使用框架定义网站时进行处理

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文