Ozgur Akcali
Ozgur Akcali

Reputation: 5492

Spotify API models.player context issue

We are developing an app for the Spotify platform. We have a problem with the player context.

We offer our users radio stations. These radio stations are not static playlists, they are created dynamically in runtime. The radio playing process is as follows:

The process works fine if the player has no context prior to starting our radios. But if there is a context already (for example, user starts playing a playlist on Spotify, and then starts a radio with our app), the player continues to play the previous context.

playTrack method does not change the current context of the player. Is there a way for playing a single track using the playContext method, or destroying the context of the player?

Upvotes: 0

Views: 164

Answers (1)

Thomas
Thomas

Reputation: 3358

I'd say that populating a temporary playlist (Playlist.createTemporary) would be the more straightforward implementation. Then your playlist would become the context.
You can still limit the number of songs provided (seems to be desirable in your case) because you can dynamically add new songs to the end of the playlist while it is going. You can also remove songs from the beginning as you go.

Upvotes: 1

Related Questions