deezer播放器和url的变化没有音乐停止。

时间:2021-07-11 18:56:15

Have you ever used deezer.com? If you have and you are a developer you have questioned how can the music still play and the url of the page in the address bar is changing without hash , only reloading the content but the player not...

你曾经使用过deezer.com吗?如果你有,你是一个开发人员,你会问,音乐怎么可能还在播放,地址栏里的页面url正在改变,没有哈希,只是重新加载内容,但是播放器没有……

Like using 2 iframes and the parent page gets the url from the reloaded iframe page but not reloading the the second one or the whole site ?

像使用2个iframe和父页面从重载的iframe页面获取url,而不是重新加载第二个或整个站点?

If my description is not accurate, please ask me for more details.

如果我的描述不准确,请询问我更多的细节。

Who know about this feature , or an example of how to do this ?

谁知道这个特性,或者如何做这个?

I have seen that is possible in browsers like ie10,ff,chrome , but on browsers like ie7-8, how can this be possible ?

我已经在ie10、ff、chrome等浏览器上看到了这一点,但是在ie7-8这样的浏览器上,这怎么可能呢?

1 个解决方案

#1


2  

They use the new HTML5 history api.

他们使用新的HTML5历史api。

Some resources about it:

一些资源:

To check that Deezer does use this feature:

要检查Deezer是否使用了这个特性:

wget http://cdn-files.deezer.com/js/min/core.js -O - | grep 'history.pushState'

wget http://cdn-files.deezer.com/js/min/core.js - o - | grep 'history.pushState'

#1


2  

They use the new HTML5 history api.

他们使用新的HTML5历史api。

Some resources about it:

一些资源:

To check that Deezer does use this feature:

要检查Deezer是否使用了这个特性:

wget http://cdn-files.deezer.com/js/min/core.js -O - | grep 'history.pushState'

wget http://cdn-files.deezer.com/js/min/core.js - o - | grep 'history.pushState'