Amazon Developer

as

Settings
Sign out
Notifications
Alexa
Amazon Appstore
Ring
AWS
Documentation
Support
Contact Us
My Cases
Get started
Connect with Matter
Alexa Connect Kit
Add-ons
Certify
Resources
Skip to main content
Implement the Alexa.PlaybackController interface in your Alexa skill so that users can play, stop, and navigate playback for audio or video content. After the endpoint performs the requested action, your skill reports the playback state of the endpoint to Alexa by using the Alexa.PlaybackStateReporter interface. For the list of languages that the Alexa.PlaybackController and Alexa.PlaybackStateReporter interfaces support, see List of Alexa Interfaces and Supported Languages. For the definitions of the message properties, see Alexa Interface Message and Property Reference.

Utterances

The Alexa.PlaybackController interface uses the pre-built voice interaction model. After the user says one of the following utterances, Alexa sends a corresponding directive to your skill. The following examples show some user utterances:








Reportable properties

The Alexa.PlaybackController and Alexa.PlaybackStateReporter interfaces use the playbackState property as the primary property. You identify that you support the property in your discovery response. The playbackState defines the current state of the endpoint that performs the requested action. The following example shows that the endpoint is playing the requested content.
The following table shows the valid values for playbackState.
StateDescription
PLAYINGThe endpoint is playing the media.
PAUSEDThe endpoint paused the media.
STOPPEDThe endpoint isn’t playing the media.

Discovery

You describe endpoints that support Alexa.PlaybackController and Alexa.PlaybackStateReporter by using the standard discovery mechanism described in Alexa.Discovery. In the Alexa.PlaybackController interface, you indicate the operations that the endpoint supports by including a supportedOperations array. Include one or more operation values: Play, Pause, Stop, StartOver, Previous, Next, Rewind, FastForward. In the Alexa.PlaybackStateReporter interface, you indicate that you support the playbackState property. Use TV, STREAMING_DEVICE, GAME_CONSOLE, or another appropriate display category. For the full list of display categories, see display categories.

Discover response example

The following example shows an Alexa.Discover.Response message for a device that supports the Alexa.PlaybackController, Alexa.PlaybackStateReporter, and Alexa.EndpointHealth interfaces.

Directives

The Alexa.PlaybackController interface supports directives to navigate and play video and audio content. For video content, include the playbackState in the response.

FastForward directive

Support the FastForward directive so that users can request to fast-forward the current content.

FastForward directive example

After the user says, Alexa sends the following directive to your skill.

FastForward directive payload

The FastForward directive doesn’t define any payload parameters.

FastForward response

If you handle a FastForward directive successfully, respond with an Alexa.Response event. The following example shows a FastForward response.

FastForward error handling

If you can’t handle a FastForward directive successfully and the error is specific to video, respond with an Alexa.Video.ErrorResponse event. For general errors, respond with a generic Alexa.ErrorResponse event.

Next directive

Support the Next directive so that users can request to go to the next item in content playback.

Next directive example

After the user says, Alexa sends the following directive to your skill.

Next directive payload

The Next directive doesn’t define any payload parameters.

Next response

If you handle a Next directive successfully, respond with an Alexa.Response event. The following example shows a Next response.

Next error handling

If you can’t handle a Next directive successfully and the error is specific to video, respond with an Alexa.Video.ErrorResponse event. For general errors, respond with a generic Alexa.ErrorResponse event.

Pause directive

Support the Pause directive so that users can request to pause the playback of audio or video content.

Pause directive example

After the user says, Alexa sends the following directive to your skill.

Pause directive payload

The Pause directive doesn’t define any payload parameters.

Pause response

If you handle a Pause directive successfully, respond with an Alexa.Response event. The following example shows a Pause response.

Pause error handling

If you can’t handle a Pause directive successfully and the error is specific to video, respond with an Alexa.Video.ErrorResponse event. For general errors, respond with a generic Alexa.ErrorResponse event.

Play directive

Support the Play directive so that users can request to play or resume play of audio or video content.

Play directive example

After the user says, or Alexa sends the following directive to your skill.

Play directive payload

The Play directive doesn’t define any payload parameters.

Play response

If you handle a Play directive successfully, respond with an Alexa.Response event. The following example shows a Play response.

Play error handling

If you can’t handle a Play directive successfully and the error is specific to video, respond with an Alexa.Video.ErrorResponse event. For general errors, respond with a generic Alexa.ErrorResponse event.

Previous directive

Support the Previous directive so that users can request to go to the previous item in content playback.

Previous directive example

After the user says, Alexa sends the following directive to your skill.

Previous directive payload

The Previous directive doesn’t define any payload parameters.

Previous response

If you handle a Previous directive successfully, respond with an Alexa.Response event. The following example shows a Previous response.

Previous error handling

If you can’t handle a Previous directive successfully and the error is specific to video, respond with an Alexa.Video.ErrorResponse event. For general errors, respond with a generic Alexa.ErrorResponse event.

Rewind directive

Support the Rewind directive so that users can request to rewind the current content.

Rewind directive example

After the user says, Alexa sends the following directive to your skill.

Rewind directive payload

The Rewind directive doesn’t define any payload parameters.

Rewind response

If you handle a Rewind directive successfully, respond with an Alexa.Response event. The following example shows a Rewind response.

Rewind error handling

If you can’t handle a Rewind directive successfully and the error is specific to video, respond with an Alexa.Video.ErrorResponse event. For general errors, respond with a generic Alexa.ErrorResponse event.

StartOver directive

Support the StartOver directive so that users can request to start playback from the beginning of the audio or visual content.

StartOver directive example

After the user says, Alexa sends the following directive to your skill.

StartOver directive payload

The StartOver directive doesn’t define any payload parameters.

StartOver response

If you handle a StartOver directive successfully, respond with an Alexa.Response event. The following example shows a StartOver response.

StartOver error handling

If you can’t handle a StartOver directive successfully and the error is specific to video, respond with an Alexa.Video.ErrorResponse event. For general errors, respond with a generic Alexa.ErrorResponse event.

Stop directive

Support the Stop directive so that users can request to stop playback of audio or video content.

Stop directive example

After the user says, Alexa sends the following directive to your skill.

Stop directive payload

The Stop directive doesn’t define any payload parameters.

Stop response

If you handle a Stop directive successfully, respond with an Alexa.Response event. The following example shows a Stop response.

Stop error handling

If you can’t handle a Stop directive successfully and the error is specific to video, respond with an Alexa.Video.ErrorResponse event. For general errors, respond with a generic Alexa.ErrorResponse event.

State reporting

Alexa sends a ReportState directive to request information about the state of an endpoint. When Alexa sends a ReportState directive, you send a StateReport event in response. The response contains the current state of all the retrievable properties in the context object. You identify your retrievable properties in your discovery response. For details about state reports, see Understand State and Change Reporting.

StateReport response example

The following example shows the current state of the endpoint after a Play directive request to play content on the device.

Change reporting

You send an Alexa.ChangeReport event to report changes proactively in the state of an endpoint. You identify the properties that you proactively report in your discovery response. For details about change reports, see State Reporting for Video Skills.

ChangeReport event example

The following example shows that the playback state of the endpoint changed when the user stopped the content play.
Last modified on August 23, 2024