AVS Device SDK Video Device Control
The following sections provide information to implement and use video device control (VDC) with the Alexa Voice Service (AVS) Device SDK. For code and full implementation details, see the AVS Device SDK on GitHub or the AVS Device SDK API references.
With VDC, Alexa users can control devices and consume video content without invoking a specific skill. For example, users can ask Alexa the following without specifying a video device or content provider:
Alexa, play Jack Ryan.
Alexa, start recording.
A VDC-enabled device supports the following actions:
- Search and play video content
- Control playback
- Navigate playback
- Record currently playing content
- Schedule a recording in the future
- Launch an application or a GUI shortcut
- Tune to a specific channel on an entertainment device
For details about the interfaces that enable control of a video experience, see the following Alexa Video Skill API topics:
Enable VDC in the IPC Server Sample Application
VDC is an optional feature in the IPC Server Sample Application, and is disabled by default.
To enable VDC capabilities, you should use the same set of CMake parameters as when you build the AVS Device SDK and the IPC Server Sample Application.
-DENABLE_ALL_VIDEO_CONTROLLERS=ON CMake parameter is a blanket parameter that adds all the VDC capabilities. You can also use CMake parameters individually to enable the
ChannelController capabilities. You can specify which capabilities to add by setting the appropriate parameters.
The following example shows how to use all controllers except the
-DENABLE_ALL_VIDEO_CONTROLLERS=ON \ -DVIDEO_CONTROLLERS_ALEXA_KEYPAD_CONTROLLER=OFF
The following example shows how to use
-DVIDEO_CONTROLLERS_ALEXA_LAUNCHER=ON \ -DVIDEO_CONTROLLERS_ALEXA_RECORD_CONTROLLER=ON
The following example shows the CMake command to build the AVS Device SDK and IPC Server Sample Application with all the VDC capabilities.
cmake [absolute path to source] ... -DENABLE_ALL_VIDEO_CONTROLLERS=ON
For each VDC controller capability agent, the AVS Device SDK provides an API contract. When you implement this interface in an endpoint handler, you can build a video device that performs actions when the corresponding capability agent invokes the device.
The endpoint handler is registered with the capability agent, and its methods are called from within the capability agent when your device receives a directive. Depending on the contract, the endpoint handler is also responsible for notifying the capability agent when a user interaction, such as using a remote control, changes the application state. The following diagram shows the role of the endpoint handler.
For example, when you implement the
RemoteVideoPlayerInterfaces, the video device can start to play a video when the
AlexaRemoteVideoPlayer capability agent receives the
SearchAndPlay directive. A sample stub implementation is available on Github.
In another example, you use the interface for a state change observer for the
AlexaLauncher. You can implement the
AlexaLauncherObserverInterface methods in the observer registered with the endpoint handler.
Integrate VDC with a video device
The following list shows how you can build a device that launches applications and handles video playback including search, play, pause, resume, and stop, by integrating the
- Use the
Launcherto open the device Settings or applications, such as Prime Video.
- Use the
RemoteVideoPlayerto search and play content.
- Use the
PlaybackControllerto pause, play, fast forward, rewind, stop, resume and start over content. By enabling the
PlaybackStateReporter, your device can report the current playback state (
STOPPED) of the video device to Alexa.
To integrate VDC with a video device, implement the
PlaybackController endpoint handler interfaces. For the
RemoteVideoPlayer, update the
getConfiguration method to return the appropriate configuration. This configuration consists of the supported directives, entity types and catalog information. For more details about the
RemoteVideoPlayer configuration, see the
Alexa.RemoteVideoPlayer Configurations object.