ios-sdk
ios-sdk copied to clipboard
How to get the current play song list
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.
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.
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.
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?
@eedvardsson what should I pass to this to get the list of currently playing (queue) items?