Article

Handling External Player Events Notifications

Handle events for external media players.

Overview

Apps that play audio or video content receive player events to start and stop playback, change tracks, and even rate an item. All iOS apps that create their own media player, macOS apps, and external media apps should support these events.

To receive player event notifications, do the following:

• Use the shared MPRemoteCommandCenter object to register handlers for the events you wish to handle and to disable the events you are not interested in receiving.

• Begin playing your content. Your app must be the Now Playing app. An app does not receive remote control events until it begins playing content. Test that your app is properly receiving and handling remote control events with Control Center, which you access by swiping up from the bottom edge of your screen. These controls send remote control events to the app that is currently or was most recently playing. You can also access the playback controls from the lock screen of the device.

You can ensure that your app interacts well with other apps handling remote control events by following the best practices laid out in the Becoming a Now Playable App sample code project.

See Also

External Player and System Event Handling

Remote Command Center Events

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

Track Navigation Events

Respond to requests to change what part of a media item is played.

Media Playback Mode Events

Respond to changes in how media items are played.

Feedback and Rating Events

Respond to incoming feedback and rating events.