ios-sdk icon indicating copy to clipboard operation
ios-sdk copied to clipboard

How to get the current play song list

Open f513234428 opened this issue 5 years ago • 4 comments

I would like to ask a question, how to get the current music play song list, for example, the song list I created is played, it will automatically play the radio song list, this is random, I want to get this song list, query / add / delete Wait for the operation.I know how to add music to the queue, but the important thing is that I can't get the list that is currently playing.

I have to say that this is a very good open source project. I have spent a few days mastering most of it. For the music player, the function is very perfect, the interface and documentation are also standard. One thing I want to mention is that In the future, there is no plan to launch the Obje-C version of the Demo. For newcomers like me, it will be easier to get started. Haha, if it is better.

f513234428 avatar Oct 28 '19 04:10 f513234428

You can get the currently playing track by getting the playerState: https://spotify.github.io/ios-sdk/html/Protocols/SPTAppRemotePlayerAPI.html#//api/name/getPlayerState: Within PlayerState, inspect the track field.

kkarayannis avatar Oct 30 '19 09:10 kkarayannis

The list of tracks can be fetched using this call: https://spotify.github.io/ios-sdk/html/Protocols/SPTAppRemoteContentAPI.html#//api/name/fetchChildrenOfContentItem:callback:.

The number of items you get in the response are limited to 20, so if the playlist is longer than that you won't get all of the tracks.

eedvardsson avatar Dec 11 '19 10:12 eedvardsson

Is the limitation to 20 tracks intended or just a bug? For my application I need the complete playlist. Is there any way to get around the 20 items?

twalenzyk avatar Mar 12 '20 22:03 twalenzyk

@eedvardsson what should I pass to this to get the list of currently playing (queue) items?

maysamsh avatar Jan 29 '21 18:01 maysamsh