A demo mobile application intended as an educational tool for demonstrating how Amazon IVS can be used to build a compelling customer experience for eCommerce use-cases.
This project is intended for education purposes only and not for production usage.
This is a server-less Android application that uses only TimedMetadata to show products. The demo is written in Kotlin and showcases how customers can load and play an Amazon IVS stream and display browsable product information using TimedMetadata.
This demo uses a 24/7 looping stream which emits a TimedMetadata event every few seconds. These TimedMetadata events describe product information in json format, which is used by the app to show a carousel of products, and to highlight the product being shown on stream.
To run this demo, you will need the following:
- Android Studio, installed and up-to-date.
- An Android Virtual Device (AVD) Phone with API level 23 or later (Android 6.0). Learn more here: Run apps on the Android Emulator.
To run the demo in the Android emulator:
- Using the command line, navigate to a directory of your choice (like
~/Developer
). - Clone the project from this repository:
git clone git@github.com:aws-samples/amazon-ivs-ecommerce-android-demo.git
. - Open the project in Android Studio.
- Select an Android Virtual Device with API level 23 or later.
- Choose
Run app
in the toolbar, or pressCtrl-R
.
You should see the Android emulator boot up and launch the demo app. This may take a few moments to complete.
IMPORTANT NOTE: Using your own stream will create and consume AWS resources, which will cost money.
- Create and set up an Amazon IVS channel. Getting started with Amazon IVS.
- Open the Amazon IVS Console and navigate to the channel you would like to use.
- Copy the Playback URL for the channel. The URL should end in
.m3u8
. (For example:https://4da4a22026d3.us-west-2.playback.live-video.net/api/video/v1/us-west-2.298083573632.channel.WbhDQYgfYHoT.m3u8
). - In Android Studio, open the app
build.grade
(NOT the project build.gradle) file. - Replace the string between the escaped quotes on line
17
with the Playback URL from step 2. - Save the file and Android Studio should show a banner that prompts you to sync the project. Click "Sync Now" to sync.
- Save and build the application.
Amazon IVS TimedMetadata provides a way to embed metadata in an Amazon IVS stream. It ensures that your users receive the metadata at the same time as the video stream, regardless of stream latency or geographic location. Learn how to embed TimedMetadata in stream: Embedding Metadata within a Video Stream.
This example expects a productId
that represents the unique identifier for a project in the streams.json
file. A more scalable solution would be to store product information in Amazon DynamoDB. This approach is documented in the Amazon IVS eCommerce Web Demo.
"metadata" : {
"productId": "1000567892"
}
For production applications, we recommend using TimedMetadata alongside services like AWS Lambda, Amazon API Gateway, and Amazon DynamoDB. These services will let you store and retrieve product information in a more scalable way. See the Amazon IVS eCommerce Web Demo for example code using these services.
- Amazon IVS Amazon Interactive Video Service (Amazon IVS) is a managed live streaming solution that is quick and easy to set up, and ideal for creating interactive video experiences. Simply send your live streams to Amazon IVS and the service does everything you need to make ultra-low latency live video available to any viewer around the world, letting you focus on building interactive experiences alongside the live video. Learn more.
- Amazon IVS docs
- User Guide
- API Reference
- The application was written for demonstration purposes and not for production use.
- Currently only tested in the us-west-2 (Oregon) region. Additional regions may be supported depending on service availability.
This sample code is made available under a modified MIT license. See the LICENSE file.