Alexa.PlaybackController Interface
The PlaybackController
interface describes messages that are used to play, stop, and navigate playback for audio or video content.
Discovery
You must specify the directives your endpoint supports when you describe it in your discovery response. You indicate the operations the endpoint supports by including a supportedOperations
array.
Supported operations values:
Example discovery response with supportedOperations
{
"event": {
"header": {
"namespace":"Alexa.Discovery",
"name":"Discover.Response",
"payloadVersion":"3",
"messageId":"ff746d98-ab02-4c9e-9d0d-b44711658414"
},
"payload":{
"endpoints":[
{
"capabilities":
[
{
"type": "AlexaInterface",
"interface": "Alexa.PlaybackController",
"version": "3",
"supportedOperations" : ["Play", "Pause", "Stop"]
}
]
...
}
]
}
}
}
Directives
The control and query directives in this interface have different language support depending on the skill type:
Skill type | Language Support |
---|---|
Video skills | English (U.K.), English (U.S), German |
Smart home skills | English, all locales |
See Develop Smart Home Skills in Multiple Languages for more information on language support for smart home skills.
FastForward
Request to fast forward the current content.
User: Alexa, fast forward on device
User: Alexa, spule auf dem gerät vor
Example Request:
{
"directive": {
"header": {
"namespace": "Alexa.PlaybackController",
"name": "FastForward",
"messageId": "c8d53423-b49b-48ee-9181-f50acedf2870",
"payloadVersion": "3"
},
"endpoint": {
"scope": {
"type": "BearerToken",
"token": "access-token-from-skill"
},
"endpointId": "device-001",
"cookie": {
}
},
"payload": {
}
}
}
Payload details
Field | Description | Type | Required |
---|---|---|---|
None | No required or optional fields in the payload. | N/A | N/A |
Next
Request to go to the next item in content playback.
User: Alexa, next song/video/photo on device
User: Alexa, nächstes lied/video/foto auf dem gerät
User: Alexa, go forward on device
User: Alexa, geh vorwärts auf dem gerät
Example Request:
{
"directive": {
"header": {
"namespace": "Alexa.PlaybackController",
"name": "Next",
"messageId": "c8d53423-b49b-48ee-9181-f50acedf2870",
"payloadVersion": "3"
},
"endpoint": {
"scope": {
"type": "BearerToken",
"token": "access-token-from-skill"
},
"endpointId": "device-001",
"cookie": {
}
},
"payload": {
}
}
}
Payload details
Field | Description | Type | Required |
---|---|---|---|
None | No required or optional fields in the payload. | N/A | N/A |
Pause
Request to pause the playback of audio or video content.
User: Alexa, pause device
User: Alexa, pausiere gerät
Example Request:
{
"directive": {
"header": {
"namespace": "Alexa.PlaybackController",
"name": "Pause",
"messageId": "c8d53423-b49b-48ee-9181-f50acedf2870",
"payloadVersion": "3"
},
"endpoint": {
"scope": {
"type": "BearerToken",
"token": "access-token-from-skill"
},
"endpointId": "device-001",
"cookie": {
}
},
"payload": {}
}
}
Payload details
Field | Description | Type | Required |
---|---|---|---|
None | No required or optional fields in the payload. | N/A | N/A |
Play
Request to play or resume play of audio or video content.
User: Alexa, resume device
User: Alexa, gerät fortsetzen
User: Alexa, play device
User: Alexa, gerät abspielen
Example Request:
{
"directive": {
"header": {
"namespace": "Alexa.PlaybackController",
"name": "Play",
"messageId": "5f8a426e-01e4-4cc9-8b79-65f8bd0fd8a4",
"payloadVersion": "3"
},
"endpoint": {
"scope": {
"type": "BearerToken",
"token": "access-token-from-skill"
},
"endpointId": "device-001",
"cookie": {
}
},
"payload": {
}
}
}
Payload details
Field | Description | Type | Required |
---|---|---|---|
None | No required or optional fields in the payload. | N/A | N/A |
Previous
Request to go to the previous item in content playback.
User: Alexa, go back on device
User: Alexa, geh zurück auf gerät
Example: Previous
{
"directive": {
"header": {
"namespace": "Alexa.PlaybackController",
"name": "Previous",
"messageId": "c8d53423-b49b-48ee-9181-f50acedf2870",
"payloadVersion": "3"
},
"endpoint": {
"scope": {
"type": "BearerToken",
"token": "access-token-from-skill"
},
"endpointId": "device-001",
"cookie": {
}
},
"payload": {
}
}
}
Payload details
Field | Description | Type | Required |
---|---|---|---|
None | No required or optional fields in the payload. | N/A | N/A |
Rewind
Request to rewind the current content.
User: Alexa, rewind on device
User: Alexa, spule auf Gerät zurück
Example: Rewind:
{
"directive": {
"header": {
"namespace": "Alexa.PlaybackController",
"name": "Rewind",
"messageId": "c8d53423-b49b-48ee-9181-f50acedf2870",
"payloadVersion": "3"
},
"endpoint": {
"scope": {
"type": "BearerToken",
"token": "access-token-from-skill"
},
"endpointId": "device-001",
"cookie": {
}
},
"payload": {
}
}
}
Payload details
Field | Description | Type | Required |
---|---|---|---|
None | No required or optional fields in the payload. | N/A | N/A |
StartOver
A request to start playback from the beginning of the audio or visual content.
User: Alexa, start over on device
User: Alexa, gerät neustarten
Example Request:
{
"directive": {
"header": {
"namespace": "Alexa.PlaybackController",
"name": "StartOver",
"messageId": "c8d53423-b49b-48ee-9181-f50acedf2870",
"payloadVersion": "3"
},
"endpoint": {
"scope": {
"type": "BearerToken",
"token": "access-token-from-skill"
},
"endpointId": "device-001",
"cookie": {
},
"payload": {}
}
}
}
Payload details
Field | Description | Type | Required |
---|---|---|---|
None | No required or optional fields in the payload. | N/A | N/A |
Stop
Request to stop playback of audio or video content.
User: Alexa, stop device
User: Alexa, stoppe gerät
Example Request:
{
"directive": {
"header": {
"namespace": "Alexa.PlaybackController",
"name": "Stop",
"messageId": "c8d53423-b49b-48ee-9181-f50acedf2870",
"payloadVersion": "3"
},
"endpoint": {
"scope": {
"type": "BearerToken",
"token": "access-token-from-skill"
},
"endpointId": "device-001",
"cookie": {
}
},
"payload": {
}
}
}
Payload details
Field | Description | Type | Required |
---|---|---|---|
None | No required or optional fields in the payload. | N/A | N/A |
Properties and Events
For this interface, you must reply:
- Synchronously, which means you send a Response to Alexa from the Lambda function.
When you send a Response
, you should include the state of the interface properties in the context
of the message.
Properties
The Alexa.PlaybackController
interface doesn't define any reportable properties at this time.
Response
If any of the directives in this interface successfully complete, you should send a response event.
Example Response
{
"context": {
"properties": []
},
"event": {
"header": {
"messageId": "30d2cd1a-ce4f-4542-aa5e-04bd0a6492d5",
"namespace": "Alexa",
"name": "Response",
"payloadVersion": "3"
},
"endpoint":{
"endpointId":"appliance-001"
},
"payload":{ }
}
}
ErrorResponse
You should reply with an error if you cannot complete the customer request for some reason. See Error.Response for more details.
Additional Sample Code
See the sample request and response messages in the Alexa smart home GitHub repo:
Related Interfaces
Interface | Description |
---|---|
Alexa.RemoteVideoPlayer | Provides directives for searching and playing content. |
Alexa.PlaybackStateReporter | Provides events for reporting the state of playback endpoints. |