- The Content Launcher API
- Vega Media Controls API
- Account Login API
Step 1: Update your App’s manifest file
In your app’s manifest.toml file, include Content Launcher support. This example assumes your package ID iscom.amazondeveloper.keplervideoapp. Replace this package ID with your app’s package ID.
Configure your app to interact with the Vega Media Content Launcher APIs.
Step 2: Include the necessary package dependencies in your app
In the package.json file, add the@amazon-devices/kepler-media-content-launcher package as a dependency.
Step 3: Implement the Content Launcher API
-
Define the Content Launcher handler.
Instantiate a new
ContentLauncherServerComponent. Develop a handler object that encapsulates the callback function.The handler should process the request, return a Promise toILauncherResponse, and create it with an instance of theContentLauncherServerComponent. Set the status ofcontentLauncherStatusforLauncherResponsetoContentLauncherStatusType.SUCCESSif your app successfully processed the request. Set the status toContentLauncherStatusType.AUTH_FAILEDif your app can’t process the request due to authorization issues. Set the status toContentLauncherStatusType.URL_NOT_AVAILABLEfor everything else. -
Implement the Vega Media Content Launcher in your interactive app.
To implement the Vega Media Content Launcher in your interactive app, start by obtaining a singleton instance of
IContentLauncherServerAsync. ImplementIContentLauncherServerAsyncby using thegetOrMakeServermethod on yourContentLauncherServerComponentinstance. Next, create a handler object implementing theIContentLauncherHandlerinterface to process content launch requests. Call the ‘setHandlerForComponent’ method for the ‘IContentLauncherServerAsync’ instance. This associates the handler with the correct component. Pass the handler and the appropriateIComponentInstance. In an interactive app, you can obtain theIComponentInstanceusing theuseComponentInstancemethod. For React Native apps, set up the handler within theuseEffecthook. It should initialize Content Launcher as soon as the component mounts and theIComponentInstanceare available. This tightly integrates Content Launcher functionality with your component’s lifecycle. It also lets your app to handle Vega Content Launcher commands efficiently from the moment it’s initialized. This setup is important for apps with multiple components, so that each component usesIComponentInstance, preventing confusion in callback routing.
Implementation details
TheIContentLauncherHandler handler takes one parameter that defines what content to play or show search results.
- Optional fields passed through a pointer to an object implementing the
ILaunchContentOptionalFieldsinterface.
Content Launcher request examples
The following examples explaincontentSearch parameter values for some key Content Launcher use cases. This example lists all supported use cases. Content Launcher is invoked and the app launches for every use case.
The following sample catalog for streamz_us includes example entries for the movie Seabound and the TV show The SeaShow: The Real Story.
Launch content through the remote
Launch the movie Seabound using a remote from the Vega TV Home screen.tv.streamz/movie/46720000 for the LaunchId, and play it directly.
Quickplay with voice
Play movie Seabound through voice. Use the utterance “Alexa, Play Seabound.”autoPlay will be true here. The following example includes the contentSearch: IContentSearch values. The app launches and it should play content directly using ID 1700000725.
Playing a specific episode with voice
The following catalog sample represents a TV Show SeaShow: The Real Story, its season, and an episode. The Alexa utterance “Alexa, Play Season 2 Episode 5 from The SeaShow: The Real Story,” invokes the app to play the specific episode.autoPlay will be true here. contentSearch includes the show ID, not the episode ID. The app must identify the exact episode using ID 1700000123, ContentSearchParamType::SEASON, and ContentSearchParamType::EPISODE values.

