<!--
{
  "availability" : [
    "iOS: 2.0.0 -",
    "iPadOS: 2.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.12.1 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 5.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "MediaPlayer",
  "identifier" : "/documentation/MediaPlayer",
  "metadataVersion" : "0.1.0",
  "role" : "Framework",
  "symbol" : {
    "kind" : "Framework",
    "modules" : [
      "Media Player"
    ],
    "preciseIdentifier" : "MediaPlayer"
  },
  "title" : "Media Player"
}
-->

# Media Player

Find and play songs, audio podcasts, audio books, and more from within your app.

## Overview

Use the Media Player framework, which is part of [MusicKit](https://developer.apple.com/musickit/), to control playback of the user’s media from your app. If your app incorporates music, you can use this framework to search for audio content, such as songs, podcasts, and books, in the user’s library. You can then play that content directly or ask the system Music app to play it. For example, a game might give users the option to play their own music while completing a particular game level.

> Important:
> To protect user privacy, users need to grant permission for your app to access their media library. Add the <doc://com.apple.documentation/documentation/BundleResources/Information-Property-List/NSAppleMusicUsageDescription> key to your app’s `Info.plist` file, and include a description of how you intend to use the user’s library. If this key isn’t present, the system terminates your app when it tries to access the user’s library.

To play content from the user’s library using the Media Player framework, use one of the built-in [`MPMusicPlayerController`](/documentation/MediaPlayer/MPMusicPlayerController) objects:

- An *application player* plays music locally within your app. Use this player when you want greater control over the audio you play for the user. This player doesn’t change the state of the built-in Music app.
- The *system player* employs the Music app to play audio on your behalf. Use this player when you want audio to continue playing even when the user switches away from your app.

Use media queries to retrieve the items you want to play and to populate the queue for the media player you select. After a user gives your app permission to access their Apple Music account, it can add songs, create playlists, and play songs from Apple Music. If your app detects that the user isn’t an Apple Music subscriber, it can offer a trial.

You can’t play video media items directly using the Media Player framework. To play videos containing [`MPMediaItem`](/documentation/MediaPlayer/MPMediaItem) objects, use an <doc://com.apple.documentation/documentation/AVFoundation/AVPlayer> object from <doc://com.apple.documentation/documentation/AVFoundation>. The system player also provides a way to play video items using the system apps.

> Important:
> Only use this framework to facilitate playback of the user’s audio content within your app. Don’t gather information about the user’s audio content for any other purpose. For more information about accessing Apple Music content, see the [App Store review guidelines](https://developer.apple.com/app-store/review/guidelines/#apple-sites-and-services).

## Topics

### Essentials

  <doc://com.apple.documentation/documentation/BundleResources/Information-Property-List/NSAppleMusicUsageDescription>

### Built-in music playback

[Playing audio using the built-in music player](/documentation/MediaPlayer/playing-audio-using-the-built-in-music-player)

Create a media player inside your app to play audio from the user’s media library.

[`MPMusicPlayerController`](/documentation/MediaPlayer/MPMusicPlayerController)

An object that plays audio media items from the device’s Music app library.

[`MPMediaPlayback`](/documentation/MediaPlayer/MPMediaPlayback)

A protocol that defines the interface for controlling audio media playback.

[`MPSystemMusicPlayerController`](/documentation/MediaPlayer/MPSystemMusicPlayerController)

A protocol for playing videos in the Music app.

### Media library synchronization

[`MPMediaLibrary`](/documentation/MediaPlayer/MPMediaLibrary)

An object that represents the state of synced media items on a device.

### Media item queries

[Using filters to create specialized queries](/documentation/MediaPlayer/using-filters-to-create-specialized-queries)

Add a filter set to a query before populating a music player queue.

[`MPMediaQuery`](/documentation/MediaPlayer/MPMediaQuery)

A query that specifies a set of media items from the device’s media library using a filter and a grouping type.

[`MPMediaQuerySection`](/documentation/MediaPlayer/MPMediaQuerySection)

A range of media items or media item collections from within a media query.

[`MPMediaPropertyPredicate`](/documentation/MediaPlayer/MPMediaPropertyPredicate)

A set of predicates for defining a filter in a media query.

[`MPMediaPredicate`](/documentation/MediaPlayer/MPMediaPredicate)

An abstract class that defines classes for filtering media in a media query.

### Media player queues

[`MPMusicPlayerControllerQueue`](/documentation/MediaPlayer/MPMusicPlayerControllerQueue)

An immutable queue containing the media items to play.

[`MPMusicPlayerControllerMutableQueue`](/documentation/MediaPlayer/MPMusicPlayerControllerMutableQueue)

A mutable queue containing the media items to play.

[`MPMusicPlayerApplicationController`](/documentation/MediaPlayer/MPMusicPlayerApplicationController)

A media player object that you use to revise the queue that’s currently playing.

[`MPMusicPlayerMediaItemQueueDescriptor`](/documentation/MediaPlayer/MPMusicPlayerMediaItemQueueDescriptor)

A set of properties and methods for modifying audio media items in the player’s media queue.

[`MPMusicPlayerStoreQueueDescriptor`](/documentation/MediaPlayer/MPMusicPlayerStoreQueueDescriptor)

A set of properties and methods for modifying items, based on their store identifier, in the player’s queue.

[`MPMusicPlayerPlayParametersQueueDescriptor`](/documentation/MediaPlayer/MPMusicPlayerPlayParametersQueueDescriptor)

A set of properties and methods for modifying how to play items, based on play parameters the framework returns.

[`MPMusicPlayerQueueDescriptor`](/documentation/MediaPlayer/MPMusicPlayerQueueDescriptor)

The abstract base class for audio media item and store queue descriptors.

### Media items and playlists

[Providing animated artwork for media items](/documentation/MediaPlayer/providing-animated-artwork-for-media-items)

Display animated artwork for your app’s media in system views, such as the lock screen, by providing video assets through your now playing info.

[`MPMediaItem`](/documentation/MediaPlayer/MPMediaItem)

A collection of properties that represents a single item in the media library.

[`MPMediaItemArtwork`](/documentation/MediaPlayer/MPMediaItemArtwork)

A graphical image, such as music album cover art, associated with a media item.

[`MPMediaItemAnimatedArtwork`](/documentation/MediaPlayer/MPMediaItemAnimatedArtwork)

An animated image, such as an animated music album cover art, for a media item.

[`MPMediaItemCollection`](/documentation/MediaPlayer/MPMediaItemCollection)

A sorted set of media items from the media library.

[`MPMediaPlaylist`](/documentation/MediaPlayer/MPMediaPlaylist)

A playable collection of related media items.

[`MPMediaPlaylistCreationMetadata`](/documentation/MediaPlayer/MPMediaPlaylistCreationMetadata)

A set of attributes for describing a playlist when creating it.

[`MPMediaEntity`](/documentation/MediaPlayer/MPMediaEntity)

The abstract superclass for media items, media item collections, and media playlist instances.

### Media player user interface

[Displaying a media picker from your app](/documentation/MediaPlayer/displaying-a-media-picker-from-your-app)

Let users choose the music they want to play by displaying a media picker interface from within your app.

[`MPMediaPickerController`](/documentation/MediaPlayer/MPMediaPickerController)

A specialized view controller that provides a graphical interface for selecting media items.

[`MPVolumeView`](/documentation/MediaPlayer/MPVolumeView)

A slider control for setting the system audio output volume, and a button for choosing the audio output route.

### Now Playing information

Provide information about the current track.

[Becoming a now playable app](/documentation/MediaPlayer/becoming-a-now-playable-app)

Ensure your app is eligible to become the Now Playing app by adopting best practices for providing Now Playing info and registering for remote command center actions.

[`MPNowPlayingSession`](/documentation/MediaPlayer/MPNowPlayingSession)

An object that manages Now Playing information and remote commands for multiple players.

[`MPNowPlayingInfoCenter`](/documentation/MediaPlayer/MPNowPlayingInfoCenter)

An object for setting the Now Playing information for media that your app plays.

[`MPNowPlayingInfoLanguageOption`](/documentation/MediaPlayer/MPNowPlayingInfoLanguageOption)

A set of interfaces for setting the language option for the Now Playing item.

[`MPNowPlayingInfoLanguageOptionGroup`](/documentation/MediaPlayer/MPNowPlayingInfoLanguageOptionGroup)

A grouped set of language options where only a single language option can be active at a time.

[Language option characteristic constants](/documentation/MediaPlayer/language-option-characteristic-constants)

The constants for defining language characteristics.

### External player and system event handling

Support playback controls on external media players or system-provided controls.

[Handling external player events notifications](/documentation/MediaPlayer/handling-external-player-events-notifications)

Handle events for external media players.

[Remote command center events](/documentation/MediaPlayer/remote-command-center-events)

Set up the remote command center to handle media player events.

[Track navigation events](/documentation/MediaPlayer/track-navigation-events)

Respond to requests to change which part of a media item plays.

[Media playback mode events](/documentation/MediaPlayer/media-playback-mode-events)

Respond to changes in the way media items play.

[Feedback and rating events](/documentation/MediaPlayer/feedback-and-rating-events)

Respond to incoming feedback and rating events.

### External media player items

Provide content and interact with external media players.

[`MPContentItem`](/documentation/MediaPlayer/MPContentItem)

An object that contains the information for a displayed media item.

### Media player errors

[`MPError`](/documentation/MediaPlayer/MPError)

A structure that represents a framework error.

### Deprecated

[Deprecated types](/documentation/MediaPlayer/deprecated-types)

Review deprecated symbols and avoid using them in your app.



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)