Here you will find a sample implementation of integrating live linear content provided by your app with Amazon Fire TV. Find the full docs on Amazon's developer portal - https://developer.amazon.com/docs/fire-tv/introduction-linear-tv-integration.html.
This Sample TV App builds upon Google's Sample TV input.
If your application provides live content, you can surface it in the Fire TV's Channel Guide and the "On Now" row on Fire TV's home screen as well as make it searchable. The process for integrating live content into the Fire TV browse and search experience follows the same steps as outlined in the standard Android documentation. You need to create a TvInputService and provide channel information for Fire TV to consume. Optionally, you can implement a few shortcuts and alternative options in your app. For example, you can rely on Amazon services to surface programming metadata, and playback can be handled within your application and launched through deeplinks instead of being embedded within the Live TV player native to all Fire TV devices.
Note: to see these features in action, clone this repository then build with Android Studio and install the app on your Fire TV device.
These are the fields supported by Fire TV UI for channel metadata.
displayName
- The display name for the channeldisplayNumber
- Optional field to display a number for the channel. This field supports the Alexa tune to channel number featureinputId
- The Input ID of your TvInputServicebrowsable
- Boolean value to determine if the channel should be browseablesearchable
- Boolean value to determine if the channel should appear in search resultsinternalProviderData
- This field supports a JSON blob with specific keys used by Fire TV
playbackDeepLinkUri
- Field to support a URI to invoke when a customer selects the channel from Fire TV's UIexternalIdType
- Specifies the external metadata service type to provide channel and program metadata through Fire TV services. Talk to your Amazon contact to learn moreexternalIdValue
- The ID value for the external metadata providerThese are the fields currently supported in the Fire TV UI for Program objects if you are not using any external metadata source.
title
- the title for the programstartTimeUtcMillis
- the start time of the program, in format of millisecond in UTC timeendTimeUtcMillis
- the end time of the program, in format of millisecond in UTC timecontentRating
- the standard tv content rating. Ex: TV-PGepisodeTitle
- the title of the specific episode of the playing programshortDesciption
- the short description of the programlongDescription
- the long description of the program. If this field is provided, it will override the "shortDescription" above.thumbnailUri
- Small image for the programposterArtUri
- Poster art image for the programThis repository contains implementations of the Program object which represents data pushed to the TIF programs table as well as the Channel object which represents data pushed to the TIF channels table. Additionally the repository implements an InternalProviderData object to represent data stored in the InternalProviderData column on the programs and channels tables.
You may utilize these implementations within your own app or use Android library implementations. Android provides these models in two places:
com.google.android.libraries.tv:companionlibrary:0.4.1
and the AndroidX library
androidx.tvprovider:tvprovider:1.0.0
. The models in these libaries are equivalent to the implementations in this repository with the exception of accepting the InternalProviderData object. Instead those models will take the serialized blob instead.
If you have further questions, support or feedback needs please reach out to your Amazon contact who will be able to further assist you. If you have general feedback for the code examples here, feel free to raise a GitHub issue in this repository.
License under the Apache 2.0 license. See the LICENSE file for details.
Version 1.0
Images/videos used in this sample are courtesy of the Blender Foundation, shared under copyright or Creative Commons license.