Process a Play Media Intent
Interpret the user’s request to play a media item, and provide instructions to access a corresponding playback queue.
URL
POST https://cloudextension-testservice.local/api/intent/playMediaHeader Parameters
| Name | Type | Description |
|---|---|---|
Accept-Language Required | string | The client’s current user interface language. Respond with localized content for this language, if available. |
Request-Timeout Required | uint32 | An approximate deadline, in seconds, for processing this real-time user request. The Session object provides the exact deadline for handling an intent. |
User-Agent Required | string | The extension protocol running on the client. This is an RFC 7231-compliant string that contains the product name AppleCloudExtension and the SiriKit Extension library version running on the client. |
x-applecloudextension-retry-count Optional | uint32 | The number of previous requests from the client. The client omits this header on the first attempt. |
x-applecloudextension-session-id Required | string | A constant session identifier to include in each request and response. Respond to each request with the session ID the client sends in that request. |
Response Codes
| Status | Reason | Type | Description |
|---|---|---|---|
| 200 | OK Content-Type: application/json | [PlayMediaIntentHandlingInvocationResponse] | The request is successful. |
Discussion
Processing a play media request requires a few steps:
Resolve the intended media item.
Resolve any playback customizations, such as repeat mode.
Handle the intent.
Provide a playback queue.
You can improve the overall response time to the user’s request by providing a response for resolving any playback customizations, and handling the intent alongside your response to the request to resolve the intended media item. This allows the client to skip subsequent requests when you can resolve each parameter successfully. If your service responds with a disambiguation, confirmation, or failure, the client disregards the pre-emptive responses, and sends the subsequent intent-processing requests.
HTTP Body
An array of intents to play media.
Topics
Processing a Play Media Intent
Resolving a Media Item
PlayMediaIntentHandlingResolveMediaItemsInvocationResponsePlayMediaMediaItemResolutionResultPlayMediaMediaItemUnsupportedReason
Handling a Play Media Intent
Resolving the Intended Repeat Mode
PlayMediaIntentHandlingResolvePlaybackRepeatModeInvocationResponsePlayMediaIntentHandlingResolvePlaybackRepeatModeInvocationResponse.ResultPlaybackRepeatModeResolutionResultPlaybackRepeatMode
Resolving the Intended Queue Location
PlayMediaIntentHandlingResolvePlaybackQueueLocationInvocationResponsePlaybackQueueLocationResolutionResultPlaybackQueueLocation