Just as the question reads. If I goto my FB Activity, it shows the track that's being played and a pause b开发者_如何学编程utton. If I hit "Pause" it pauses my native spotify app instantaneously. How is this implemented?
The JavaScript on Facebook's site submits a request to a web service hosted by Spotify. I do believe that Spotify's client-side application maintains a connection with Spotify's servers. Spotify is able to push content to the user without the client making a request for it, so this web service seems to do this. From my research, I can't find that developing similar functionality is feasible via any API method, whether from Spotify or Facebook.
Spotify embeds a web server with a remote control API that Facebook uses directly.
Facebook and Spotify have a special partnership. This type of integration is not currently available to other developers.
精彩评论