Announcements

Help Wizard

Step 1

NEXT STEP

[API] is there a way to start playing a playlist from a specific song?

Solved!

[API] is there a way to start playing a playlist from a specific song?

Hi , I'm building an app in android to control the spotify app in a phone. I'm pretending to connect it with a small app in a raspberry pi which will be in a car with a screen to pass songs / navigate playlists etc without using the phone

 

So I've managed to list Tracks from a Playlist and I'm able to play a track, but when it ends I want the next songs are from the playlist.

 

I don't see a clear way to pass a "starting song" parameter to the player.

 

If I pass a track url from the playlist individually, the next tracks won't be related with the playlist

 

Also I Thought about using the queue to do this but isn't the same thing and also I don't see a Way to clear it, so it will be full of unrelated songs in the case the user navigates and seeks some songs from different playlists.

 

Please could you tell me any way to do this ? Many thanks!

 

I'm using Web API but I could use Android api if there's a way to do this with it.

 

 

Reply

Accepted Solutions
Marked as solution

You should be able to do this as the Start/Resume a User's Playback endpoint supports this, you can provide the context_uri of the playlist e.g. spotify:playlist:37i9dQZF1DXcBWIGoYBM5M and then the offset of the track in the playlist as a Uri. e.g. {"uri": "spotify:track:1301WleyT98MSxVHPZCA6M"} it should play from that point onwards

View solution in original post

5 Replies
Marked as solution

You should be able to do this as the Start/Resume a User's Playback endpoint supports this, you can provide the context_uri of the playlist e.g. spotify:playlist:37i9dQZF1DXcBWIGoYBM5M and then the offset of the track in the playlist as a Uri. e.g. {"uri": "spotify:track:1301WleyT98MSxVHPZCA6M"} it should play from that point onwards

Hi @RoguePlanetoid, AFAIK the Start/Resume a User's Playback endpoint requires a Premium account, is that correct?

Indeed, that does require a Spotify Premium account so won't work without the user having one

Thanks for the reply. Is it the same for the Android/iOS SDK? I read this old announcement (https://developer.spotify.com/community/news/2018/09/14/updates-mobile-platform/) where it is mentioned that : "Unlike our previous playback SDKs, the Android and iOS SDK now allow you to “remote control” playback in the Spotify app. As a result, you can control playback for all users (not just Premium) and provide offline playback."

 

Many thanks! I did not notice it could be done that way
Sorry for the late response, I didn't had enought time to try until now

Suggested posts