Multimedia Remote Control
Remote control events are a way for users to control your app’s multimedia. Remote control events originate from external accessories or from the transport controls displayed by the system and are delivered to your app through the classes of the Media Player framework. Apps that play audio or video content use these events to start and stop playback, change tracks, and even rate an item. All media apps should support these events.
In addition to supporting remote control events, apps can use the Media Player framework to provide playback information for tracks. The system displays playback information in appropriate places, such as the lock screen and in Control Center.
For more information about the classes of the Media Player framework, see .
Preparing Your App for Remote Control Events
To receive remote control events, do the following:
- Register handlers for each action you support. Use the shared object to register handlers for different types of events, as described in .
- Begin playing audio. Your app must be the “Now Playing” app. An app does not receive remote control events until it begins playing audio.
If your app also provides Now Playing information containing information about the current track, use an object to update that information at appropriate times. For more information about how to provide now playing information, see .
To handle a particular remote control event, register an action handler with the appropriate MPRemoteCommand object. The Media Player framework defines a standard set of objects for handling media-related events. When an accessory or iOS interface generates a remote control event, the system notifies the corresponding MPRemoteCommand object. That object responds by executing any attached handlers.