systemMusicPlayer
Returns the system music player, which controls the Music app’s state.
Declaration
class var systemMusicPlayer: any MPMusicPlayerController & MPSystemMusicPlayerController { get }Return Value
The system music player.
Discussion
The System music player employs the Music app on your behalf. On instantiation, it takes on the current Music app state and controls that state as your app runs. Specifically, the shared state includes the following:
Repeat mode (see MPMusicRepeatMode)
Shuffle mode (see MPMusicShuffleMode)
Now-playing item (see nowPlayingItem)
Playback state (see playbackState)
Other aspects of the Music app’s state aren’t shared. Music that’s playing continues to play when your app moves to the background.