Class

MPNowPlayingInfoCenter

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

Declaration

@interface MPNowPlayingInfoCenter : NSObject

Overview

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.

Topics

Working with the Default Now Playing Info Center

+ defaultCenter

Returns the singleton now playing info center.

nowPlayingInfo

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

MPNowPlayingInfoMediaType

The type of media currently playing.

Setting the Playback State on macOS

playbackState

The current playback state of the app.

MPNowPlayingPlaybackState

The states of the app.

Now Playing Metadata Properties

Provide specific details about the currently playing item.

MPNowPlayingInfoCollectionIdentifier

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

MPNowPlayingInfoPropertyAvailableLanguageOptions

The available language option groups for the now playing item.

MPNowPlayingInfoPropertyAssetURL

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

MPNowPlayingInfoPropertyChapterCount

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

MPNowPlayingInfoPropertyChapterNumber

The number corresponding to the chapter currently being played.

MPNowPlayingInfoPropertyCurrentLanguageOptions

The currently active language options for the now playing item.

MPNowPlayingInfoPropertyDefaultPlaybackRate

The default playback rate for the now playing item.

MPNowPlayingInfoPropertyCurrentPlaybackDate

The date associated with the current elapsed playback time.

MPNowPlayingInfoPropertyElapsedPlaybackTime

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

MPNowPlayingInfoPropertyExternalContentIdentifier

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

MPNowPlayingInfoPropertyExternalUserProfileIdentifier

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

MPNowPlayingInfoPropertyIsLiveStream

Denotes whether the now playing item is a live stream.

MPNowPlayingInfoPropertyMediaType

The media type of the now playing item.

MPNowPlayingInfoPropertyPlaybackProgress

The current progress of the now playing item.

MPNowPlayingInfoPropertyPlaybackQueueCount

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

MPNowPlayingInfoPropertyPlaybackQueueIndex

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

MPNowPlayingInfoPropertyPlaybackRate

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

MPNowPlayingInfoPropertyServiceIdentifier

The service provider associated with the now-playing item.

Relationships

Inherits From

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.

MPNowPlayingInfoLanguageOption

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

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.