An object that you use to set now-playing information for media being played by your app.


class MPNowPlayingInfoCenter : NSObject


If your app also provides Now Playing information containing information about the current track, use an MPNowPlayingInfoCenter object to update that information at appropriate times. The MPNowPlayingInfoCenter object contains a nowPlayingInfo dictionary whose contents describe the item being played.

The system displays now-playing information on the device lock screen and in the multimedia controls in the multitasking UI. If the user directs playback of your media to Apple TV via AirPlay, the now-playing information appears on the television screen. If the user connects a device to an iPod accessory, such as in a car, the accessory may display now-playing information.

The information you can specify includes a subset of the properties available in the media item class (MPMediaItem), as well as some properties specific to this class. Additional properties you can set are described in this document in Now Playing Metadata Properties.

You do not have direct control over which information is displayed, or its formatting. You set the values of the now playing info center dictionary according to the information you want to provide to the system. The system, or the connected accessory, handles the information’s display in a consistent manner for all apps.

You can ensure that your app interacts well with other apps providing now-playing information by following the best practices laid out in the Becoming a Now Playable App sample code project.


Working with the Default Now Playing Info Center

class func `default`() -> MPNowPlayingInfoCenter

Returns the singleton now playing info center.

var nowPlayingInfo: [String : Any]?

The current now-playing information for the default now playing info center.

enum MPNowPlayingInfoMediaType

The type of media currently playing.

Setting the Playback State on macOS

var playbackState: MPNowPlayingPlaybackState

The current playback state of the app.

enum MPNowPlayingPlaybackState

The states of the app.

Now Playing Metadata Properties

Provide specific details about the currently playing item.

let MPNowPlayingInfoCollectionIdentifier: String

The identifier of the collection the now playing item belongs to.

let MPNowPlayingInfoPropertyAvailableLanguageOptions: String

The available language option groups for the now playing item.

let MPNowPlayingInfoPropertyAssetURL: String

The URL pointing to the now playing item's underlying asset.

let MPNowPlayingInfoPropertyChapterCount: String

The total number of chapters in the now-playing item.

let MPNowPlayingInfoPropertyChapterNumber: String

The number corresponding to the chapter currently being played.

let MPNowPlayingInfoPropertyCurrentLanguageOptions: String

The currently active language options for the now playing item.

let MPNowPlayingInfoPropertyDefaultPlaybackRate: String

The default playback rate for the now playing item.

let MPNowPlayingInfoPropertyCurrentPlaybackDate: String

The date associated with the current elapsed playback time.

let MPNowPlayingInfoPropertyElapsedPlaybackTime: String

The elapsed time of the now playing item, in seconds.

let MPNowPlayingInfoPropertyExternalContentIdentifier: String

The opaque identifier that uniquely identifies the now playing item, even through app relaunches.

let MPNowPlayingInfoPropertyExternalUserProfileIdentifier: String

The opaque identifier that uniquely identifies the profile the now playing item is played from, even through app relaunches.

let MPNowPlayingInfoPropertyIsLiveStream: String

Denotes whether the now playing item is a live stream.

let MPNowPlayingInfoPropertyMediaType: String

The media type of the now playing item.

let MPNowPlayingInfoPropertyPlaybackProgress: String

The current progress of the now playing item.

let MPNowPlayingInfoPropertyPlaybackQueueCount: String

The total number of items in the app’s playback queue.

let MPNowPlayingInfoPropertyPlaybackQueueIndex: String

The index of the now-playing item in the app’s playback queue.

let MPNowPlayingInfoPropertyPlaybackRate: String

The playback rate of the now-playing item, with a value of 1.0 indicating the normal playback rate.

let MPNowPlayingInfoPropertyServiceIdentifier: String

The service provider associated with the now-playing item.


Inherits From

Conforms To

See Also

Now Playing Information

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.

class MPNowPlayingInfoLanguageOption

A set of interfaces used to set the language option for the now-playing item.

class MPNowPlayingInfoLanguageOptionGroup

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

Language Option Characteristic Constants

The constants used to define language characteristics.