Media

Listen and control audio through Siri Intents or listen and watch media content from your app with shortcuts.

Overview

With the Media domain, users can play and control audio media in your app. Your Intents app extension directs any media-related requests to your app, which then handles the request.

Siri can suggest shortcuts to audio available in your app when the user wants to listen to the content. For example, Siri may suggest a playlist to the user after they connect headphones to their iPhone. These suggestions give the user a convenient way to play the media in your app.

In order for Siri to suggest media content, you should donate an INPlayMediaIntent object to Siri after the user plays the content (see Donating Shortcuts). To have Siri suggest new media that might be of interest to the user, save INPlayMediaIntent shortcuts for the new content to the INUpcomingMediaManager.

Topics

Essentials

Controlling Audio with SiriKit

Control audio playback and handle add media requests using SiriKit Media Intents

Playable Media Intents

Playing Media Through Siri Shortcuts

Play audio and video from your app using media intent shortcuts.

INPlayMediaIntentHandling

The interface an object implements to confirm and handle play media intents.

INPlayMediaIntent

An intent that contains information about media playable from your app.

INPlayMediaIntentResponse

Your response to a play media intent.

Add Media

INAddMediaIntentHandling

The handler interface that adds media.

INAddMediaIntent

A request to add a media item.

INAddMediaIntentResponse

Your app’s response to an add media intent.

Search for Media

INSearchForMediaIntentHandling

The interface that handles media search requests.

INSearchForMediaIntent

A request to search for a media item.

INSearchForMediaIntentResponse

Your app’s response to a search media intent.

Update Media Affinity

INUpdateMediaAffinityIntentHandling

The interface that handles requests to update the user’s preference for a media item.

INUpdateMediaAffinityIntent

A request to update the user’s affinity for a media item.

INUpdateMediaAffinityIntentResponse

Your app’s response to an update media affinity intent.

User Context

INUserContext

An object that provides user information to Siri.

INMediaUserContext

An object that provides user information to Siri.

Data Objects

INMediaItem

An object that describes a piece of media content, such as a song, TV show, artist, or podcast playlist.

INMediaSearch

An object that describes a media type to search for, such as a station name, song name, or album name.

Upcoming Media

INUpcomingMediaManager

The manager object you use to suggest media to the user.

Resolution Results

INAddMediaMediaDestinationResolutionResult

A resolution result for the types of destinations when adding media.

INAddMediaMediaItemResolutionResult

A resolution result for the media item to add.

INMediaDestinationResolutionResult

A resolution result for the media destination types.

INMediaItemResolutionResult

A resolution result for media item types.

INMediaAffinityTypeResolutionResult

A resolution result for the user’s affinity for a media item.

INPlayMediaMediaItemResolutionResult

A resolution result for the media item to play.

INPlayMediaPlaybackSpeedResolutionResult

A resolution result that determines the playback speed of a media item.

INPlaybackRepeatModeResolutionResult

A resolution result for the playback repeat modes of a media item.

INPlaybackQueueLocationResolutionResult

A resolution result for the requested playback queue location.

INSearchForMediaMediaItemResolutionResult

A resolution result for the media item for which to search.

INUpdateMediaAffinityMediaItemResolutionResult

A resolution result for updating the user’s affinity for a media item.

See Also

Siri Domains

Messaging

Send messages and search the user’s received messages.

Lists and Notes

Create and manage notes and to-do list items.

Workouts

Start, end, and manage fitness routines.

Payments

Send payments between users or pay bills.

VoIP Calling

Initiate calls and search the user’s call history.

Visual Codes

Convey contact and payment information using Quick Response (QR) codes.

Photos

Search for and display photos.

Ride Booking

Book rides and report their status.

Car Commands

Manage vehicle door locks and get the vehicle’s status.

CarPlay

Interact with a vehicle’s CarPlay system.

Restaurant Reservations

Create and manage restaurant reservations with help from the Maps app.