Class

INPlayMediaIntent

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

Declaration

class INPlayMediaIntent : INIntent

Overview

Use INPlayMediaIntent to donate shortcuts to songs, movies, and other media the user plays in your app, or to enable Siri to recommend upcoming media, such as new TV shows or podcast episodes.

The INPlayMediaIntent object supports background execution. To play audio in the background, your app must support background audio. See Enabling Background Audio for more information.

Additional Intent Attributes

Table 1 lists additional attributes of this intent object.

Table 1

Play media intent attributes

Attribute

Description

Supported by

Siri Intents (audio only)

Always requires unlocked device

No

Example Phrases

Users can ask Siri to play media in a variety of ways. Table 2 provides a few sample phrases in different languages. You can use these phrases during testing to trigger your intents. This list isn’t exhaustive and Siri may recognize many other phrases.

Table 2

Siri phrases that trigger playing media

Locale

Example 1

Example 2

Example 3

en

Play Queen on <appName>

Put on the Conan O’Brien Needs a Friend podcast from <appName>

Play Moby Dick by Herman Melville using <appName>

zh_CN

请在<appName>上播放周杰伦

在<appName>播放播客马力欧需要个朋友

用<appName>播放赫尔曼·梅尔维尔的白鲸

zh_HK

幫我喺<appName>播放Queen

我想喺<appName>度聽播客Conan O’Brien 嘅Needs a Friend

用<appName>播放Herman Melville嘅Moby Dick

zh_TW

在<appName>上播放周杰倫

從<appName>播放Podcast馬力歐陪你喝一杯

用<appName>播放赫爾曼·梅爾維爾的白鯨記

yue_CN

帮我喺<appName>播放Queen

我想喺<appName>度听播客Conan O’Brien 嘅Needs a Friend

用<appName>播放赫尔曼麦尔维尔嘅白鲸记

ar

شغل فيروز على <appName>

ضع بودكاست فنجان من <appName>

شغل حياة في الإدارة لغازي القصيبي باستخدام <appName>

da

Afspil Queen på <appName>

Afspil podcast Conan O'Brien Needs a Friend podcast fra <appName>

Afspil Moby Dick af Herman Melville på <appName>

de

Spiele Queen auf <appName>

Lege den ARD Radio Tatort podcast in <appName> auf

Spiele Moby Dick von Herman Melville über <appName>

es

Reproduce Queen en <appName>

Pon el podcast Mapa de Palabras en <appName>

Reproduce Moby Dick de Hayward Morse usando <appName>

fi

Soita Queeniä <appNamessa>

Toista <appNamella> podcast Conan O’Brien Needs a Friend

Toista <appNamella> Herman Melvillen Moby Dick

fr

joue Queen sur <appName>

mets le podcast les grosses têtes sur <appName>

Joue le mystère Henry Pick sur <appName>

he

תנגן מדונה ב-<appName>

שים את הפודקאסט קונאן צריך חברים ב-<appName>

שים מובי דיק של הסופר הרמן מלבין ב-<appName>

it

Suona i Queen su <appName>

Metti il podcast Il Ruggito del Coniglio su <appName>

Riproduci Moby Dick di Herman Mellville usando <appName>

ja

<appName>でクイーンをかけて

<appName>でConan O’Brien Needs A Friend podcastをかけて

<appName>でハーマン·メルヴィルの白鯨をかけて

ko

<appName>에서 Queen 틀어줘

<appName>에서 코난 오브라이언 의 니즈 프랜드 틀어 줘

<appName>에서 Moby Dick by Herman Melville 틀어줘

ms

mainkan Queen di <appName>

putarkan podcast Conan O'Brien Needs a Friend pada <appName>

mainkan Moby Dick oleh Herman Melville dengan <appName>

nb

Spill Queen på <appName>

Lytt til podkasten Conan O’Brien Needs a Friend i <appName>

Spill Moby Dick av Herman Melville i <appName>

nl

Speel Queen op <appName>

Zet de Nerdland podcast op van <appName>

Luister Moby Dick van Hermal Melville met <appName>

pt

Toca no <appName> Queen

Coloca no podcast da Jovem Pan no <appName>

Reproduza O Alquimista de Paulo Coelho usando <appName>

ru

Играй Qeen на Яндекс Музыке

Поставь подкаст заварили бизнес через overcast

Поставь аудио книгу Анна Каренина Лев Толстой в приложении Яндекс Музыка

sv

Spela Queen på <appName>

Spela podcasten Conan O’Brien Needs a Friend på <appName>

Spela Moby Dick av Herman Melville på <appName>

th

เปิดเพลงวง Queen บน <appName>

เปิดพ็อดคาสท์ Conan O’Brien Needs a Friend จาก <appName>

เปิด Moby Dick ของ Herman Melville ด้วย <appName>

tr

<appName>'de Queen çal

<appName>'den O Tarz Mı podcast'ini aç

<appName>'de Herman Melville'den Moby Dick oynat

In Table 2, <appName> represents the name of the app whose Intents extension handles the request.

Topics

Getting Media Items

var mediaContainer: INMediaItem?

The media item container.

Getting Playback Settings

var playShuffled: Bool?

A Boolean value that indicates whether the media plays in a shuffled order.

var resumePlayback: Bool?

The resume playback setting at the time the user plays the media item.

var playbackRepeatMode: INPlaybackRepeatMode

The repeat mode setting at the time the user plays the media item.

enum INPlaybackRepeatMode

The possible repeat modes at the time the user plays the media item.

var playbackSpeed: Double?

The playback speed for a media item.

var playbackQueueLocation: INPlaybackQueueLocation

The queue location for a media item during playback.

enum INPlaybackQueueLocation

Constants that describe the playback queue location for a media item.

var mediaSearch: INMediaSearch?

An object that contains the search parameters.

Relationships

Inherits From

Conforms To

See Also

Playable Media Intents

Playing Media Through Siri Shortcuts

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

protocol INPlayMediaIntentHandling

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

class INPlayMediaIntentResponse

Your response to a play media intent.