Swift skip current song playing on iPhone

212 Views Asked by At

I would like to display info and skip the current song being played by the iPhone. I understand MPMusicPlayerController can do this for apple music. However, I would like to display and skip the current song if it is being played by a third-party app like Spotify or Audible.

1

There are 1 best solutions below

2
Yash Parikh On

let audioPlayer = MPMusicPlayerController.systemMusicPlayer

next song audioPlayer.skipToNextItem()

previous song audioPlayer.skipToPreviousItem()