---
title: systemMusicPlayer
framework: mediaplayer
role: symbol
role_heading: Type Property
path: mediaplayer/mpmusicplayercontroller/systemmusicplayer
---

# systemMusicPlayer

Returns the system music player, which controls the Music app’s state.

## Declaration

```swift
class var systemMusicPlayer: any MPMusicPlayerController & MPSystemMusicPlayerController { get }
```

## Return Value

Return Value The system music player.

## Discussion

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.

## See Also

### Getting a music player

- [applicationMusicPlayer](mediaplayer/mpmusicplayercontroller/applicationmusicplayer.md)
- [applicationQueuePlayer](mediaplayer/mpmusicplayercontroller/applicationqueueplayer.md)
