Class

MPNowPlayingInfoCenter

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

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.

When playing audio or video content, use the MPNowPlayingInfoCenter object to provide descriptive information about the content being played. The MPNowPlayingInfoCenter object contains a nowPlayingInfo dictionary whose contents describe the item being played. The system displays the information from that dictionary in appropriate places, such as on the lock screen of an iOS device.

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 Additional 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.

Topics

Working with the Default Now Playing Info Center

class func `default`()

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

Additional Metadata Properties

These properties for the now playing info center dictionary supplement the available media item properties, as described in the Overview in this document.

Relationships

Inherits From

Conforms To

See Also

Now Playing Information

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.