Apple Music Api SkiptoNextItemnot working

66 Views Asked by At

Trying to skip to the next item in the queue, but when applicationMusicPlayer.skipToNextItem() is called, the place in the queue doesn't change, the current track just starts over. The queue is composed of an array of string item IDs.

   self.applicationMusicPlayer.setQueue(with: trackIDs)

And here is the code used to skip to the next item in the queue

@IBAction func nextSong(_ sender: Any) {
         print("current Index in Queue: \(self.playlistManager.applicationMusicPlayer.indexOfNowPlayingItem)")
        self.playlistManager.applicationMusicPlayer.skipToNextItem()
        print("After skip: \(self.playlistManager.applicationMusicPlayer.indexOfNowPlayingItem)")
    }
0

There are 0 best solutions below