I am trying to play a list of songs from apple music using their track_id.
playlist
is of type [String]
and the app plays all songs in the queue.
It always starts with the first song as well, but after that everything is random each time. It acts the same way when I use the applicationMusicPlayer
. Any help?
self.player = MPMusicPlayerController.systemMusicPlayer()
self.player.beginGeneratingPlaybackNotifications()
self.player.repeatMode = MPMusicRepeatMode.None
self.player.shuffleMode = MPMusicShuffleMode.Off
self.player.setQueueWithStoreIDs(playlist)
self.player.shuffleMode = MPMusicShuffleMode.Off
self.player.play()