如何Spotify的网络浏览器按钮,Spotify应用互动? [英] How does the Spotify web browser button interact with the Spotify app?

查看:361
本文介绍了如何Spotify的网络浏览器按钮,Spotify应用互动?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

看看这个播放按钮,书面完全看来,用javascript: Spotify的播放按钮

Check out this play button, written entirely it seems, using javascript: spotify play button.

注意,pressing发挥会造成Spotify的开始播放音乐。好吧,我明白这是通过一些特定的应用程序协议链接来实现(像Spotify的://播放),虽然我可能是错的。但疯狂的是,如果你停止播放音乐的Spotify,该按钮将在浏览器更新显示,音乐停止播放!如何运作的?

Notice that pressing play will cause Spotify to start playing music. OK, I figure that's done via some app-specific protocol link (like spotify://play), although I could be wrong. But the crazy part is that if you stop playing music in Spotify, the button will be updated in the browser to show that the music has stopped playing! How does that work?

您可以看一下这里其源。

You can look at its source here.

推荐答案

在桌面运行在服务器*。spotilocal.com 您的计算机上,然后在网络上,嵌入播放器(例如)将选择一个子域名(例如: fdxubmxkqp.spotilocal.com

The desktop runs a server at *.spotilocal.com on your computer, then on the web, the embed player (example) will choose a subdomain name (example: fdxubmxkqp.spotilocal.com).

然后,它使请求到本地服务器的API,其实例

It then makes request to the local server's API, examples:

https://fdxubmxkqp.spotilocal.com:4370/service/version.json
https://fdxubmxkqp.spotilocal.com:4370/simplecsrf/token.json

和它只是返回一些JSON:

And it just returns some JSON:

{
"version": 9, 
"client_version": "1.0.10.107.gd0dfca3a"
}

请参阅这张截图获取更多的信息,或者您也可以通过去获得同样的信息到 news.spotify.com 并使用网络审查员spotilocal作为一个过滤器。

See this screenshot for more info, or you can get the same info by going to news.spotify.com and using the Network inspector with "spotilocal" as a filter.

在这里输入的形象描述

这篇关于如何Spotify的网络浏览器按钮,Spotify应用互动?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆