You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With the Spotify Web SDK and API, only polling can be used to get updates on current track - potentially sending too many requests to Spotify (and possibly getting charged more). Ideally we should directly communicate with Spotify as little as possible via the API/SDK, under the assumption that each request is charged (free under development mode).
The Web Player, however, uses a web socket connected to Spotify's servers in order to immediately receive updates to current track, allowing the player to react instantaneously to track changes. There are two problems with this:
This is only allowed if the track is playing through the web player
This is only offered client-side
In order to update the server with the song queue, and other updates regarding the current track, the client player will need to pass these updates to our server via the web socket and send (produce) those events to a Kafka topic to be consumed by the server.
Intro
With the Spotify Web SDK and API, only polling can be used to get updates on current track - potentially sending too many requests to Spotify (and possibly getting charged more). Ideally we should directly communicate with Spotify as little as possible via the API/SDK, under the assumption that each request is charged (free under development mode).
The Web Player, however, uses a web socket connected to Spotify's servers in order to immediately receive updates to current track, allowing the player to react instantaneously to track changes. There are two problems with this:
In order to update the server with the song queue, and other updates regarding the current track, the client player will need to pass these updates to our server via the web socket and send (produce) those events to a Kafka topic to be consumed by the server.
Specs
Kafka topics:
current-track
Flow
Tasks
Create events between client and web socket:
Create server consumers:
The track queue or state doesn't need to be created, but everything should be in place to create and sync track state in the server.
The text was updated successfully, but these errors were encountered: