Step 5: Report Your App's Static Capabilities (VSK Fire TV)
With the static capabilities integration, all content is searchable and playable for free, with no user authentication needed. As such, there's no need to dynamically report your capabilities based on a user login state, and you can indicate your app's capabilities directly in your app manifest. The VSK Agent will detect those capabilities as referenced in your manifest automatically.
The sample app already reports static capabilities, so you do not need to do any coding in this step. In the sample app, see the
AndroidManifest.xml
and raw/static_capabilities
files for details about how the static capabilities are declared.Declare Static Capabilities
The VSK Agent is an on-device routing agent on Fire TV that sends VSK directives to your application (through intents). The VSK Agent scans your app's AndroidManifest.xml
for static capabilities to see your app supports. Declare your app's static capabilities as follows:
-
Open your
AndroidManifest.xml
file and add the following resource inside theapplication
element.<meta-data android:name="com.amazon.alexa.vsk_app_agent_api.capabilities" android:resource="@raw/static_capabilities" />
-
This previous code references a resource at
@raw/static_capabilities
that lists details about the capabilities your app supports. Add this file (calledstatic_capabilities
— no file extension) insideapp/res/raw
in your project.This
static_capabilities
file lists capabilities that your app always supports. This file will be scanned by VSK Agent on app install or app update. This means the user can control your app by voice without opening it for the first time.Sample App Notes
The sample app also shows other capabilities files inside theraw
folder. You can disregard these other capabilities files, as they are used only for the dynamic capabilities integration. -
In the
static_capabilities
file, list the capabilities your app supports.The contents of
static_capabilities
must be a JSON object containing a singlecapabilities
array, with each object in the array listing a different capability. See Supported Capabilities with App-only Integration for a list of all possible capabilities you can add in the JSON file.For example, to declare support for the
RemoteVideoPlayer
capabilities, including bothSearchAndPlay
andSearchAndDisplayResults
directives that this interface sends, add the following code to yourstatic_capabilities
file:{ "capabilities": [ { "type": "AlexaInterface", "interface": "Alexa.RemoteVideoPlayer", "version": "3.1", "configurations": { "operations": [ "SearchAndDisplayResults", "SearchAndPlay" ], "catalogs": [ { "type": "VIDEO_INGESTION_IDENTIFIER", "sourceId": "<INSERT PARTNER ID>" }] } } ] }
To declare support for both
RemoteVideoPlayer
andPlaybackController
(not recommended), add the capability as another object in thecapabilities
array:{ "capabilities": [ { "type": "AlexaInterface", "interface": "Alexa.PlaybackController", "version": "3", "supportedOperations" : ["Play", "Pause", "Stop"] }, { "type": "AlexaInterface", "interface": "Alexa.RemoteVideoPlayer", "version": "3.1", "configurations": { "operations": [ "SearchAndPlay", "SearchAndDisplayResults" ], "catalogs": [ { "type": "VIDEO_INGESTION_IDENTIFIER", "sourceId": "<INSERT PARTNER ID>" }] } } ] }
In the code above, the app now supports Play, Pause, and Stop directives from the
Alexa.PlaybackController
too.Warning: Although you can declare support forPlaybackController
and other interfaces, such asSeekController
,ChannelController
, andKeypadController
, these other interfaces aren't recommended. OnlyRemoteVideoPlayer
(specifically,SearchAndPlay
andSearchAndDisplayResults
directives) are recommended for Fire TV VSK integrations. (The other interfaces are recommended for other types of integrations outside Fire TV.)Note that if you indicate capabilities like this in your
static_capabilities
file, your app must be able to handle these directives. If your app doesn't support these directives, don't list the capabilities here. Alexa sends you only the directives that your app declares it supports. For example, if you declarePlaybackController
, you'll get directives for this interface that you're expected to handle; if not, you won't.Sample App Notes
See thestatic_capabilities
file (inapp/res/raw
) in the sample app for an example. In the sample app, bothSearchAndPlay
andSearchAndDisplayResults
operations are supported (these are part of theRemoteVideoPlayer
interface), andPlay
,Pause
,Stop
operations are supported (part of thePlaybackController
interface). The catalog specified isontv
; however, the actual catalog used for this sample app is handled through a special backend mapping of thecom.example.vskfiretv
package prefix and the IMDb catalog — it doesn't matter what value you use (e.g.,ontv
or something else) for the catalog name in the sample app. -
In the
catalogs
property, update the value for thesourceId
with yourPartner
ID.Your Partner ID is the same value you report to Fire TV launcher during the catalog integration with the Fire TV launcher (see Universal Search and Browse). It's also the
Partner
field in your CDF file (which you submitted during catalog integration.) Your Amazon representative can provide this ID if you need it. See the RemoteVideoPlayer Capabilities section in "Supported Capabilities" for more details about thecatalogs
property.
Next Steps
Go to the next step: Step 6: Report Your App's Dynamic Capabilities.