vkontakte.ru 中的音频播放器是如何完成的

发布于 2024-12-11 07:41:39 字数 247 浏览 0 评论 0原文

俄罗斯社交网络中有一个在线播放音乐的功能。没什么特别的,但即使我在网站上导航,音乐也会继续播放。所以 URL 正在改变(不是哈希部分),但音乐播放得很流畅。

它是如何完成的?我只是好奇这些人是如何做得这么好。 在此处输入图像描述

在此输入图像描述

In russian social network there is a functionality to play music online. Nothing special but music continues playing even if I'm navigating on the site. So Url is changing (not hash part) but music is playing smoothly.

How is it done? Just I'm curios how these guys did it so well.
enter image description here

enter image description here

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

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

发布评论

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

评论(3

木落 2024-12-18 07:41:39

杜兹是对的。他们使用 AJAX 调用来刷新除实际音乐/视频播放器之外的所有页面。如果您查看 Firefox 中的 Firebug,您会发现,当您单击页面时,NET 请求不会刷新,而是会添加到主队列中。尝试打开音乐播放器、firebug(网络面板)并切换页面。享受。

Dutzi is correct. They are using AJAX calls to refresh all of the page other than the actual music/video player. If you look at Firebug in Firefox, when you click on a page the NET requests are not being refreshed they are being done added to the main queue. Try opening up a music player, firebug(net panel) and switching pages around. Enjoy.

呆橘 2024-12-18 07:41:39

页面不会重新加载,它只是 ajax 请求更改页面的部分内容或 iframe。

对于网址栏,他们可能使用类似 swfaddress 的内容。

The page doesn't reload, it's just ajax requests changing parts of the page, or an iframe.

For the URL bar, they're probably using something like swfaddress.

夏日落 2024-12-18 07:41:39

所以他们通过 JavaScript 使用历史操作。这样他们就可以修改浏览器的 url,而无需重新加载页面。
示例可以在 mozilla 页面查看

So they are using history manipulation via javascript. This way they modify the url of the browser without reloading the page.
Examples can be seen on mozilla page

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