A demo iOS 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 an iOS application that uses Amazon IVS TimedMetadata to show products. The demo is written in Swift 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:
- Xcode 11 or greater. You can build this application for devices running iOS 10 or later.
- Cocoapods, installed and up-to-date. You can quickly install cocoapods from Terminal with
sudo gem install cocoapods
. - Bundler, installed and up-to-date.
- Git installed and up-to-date. You can quickly install git from Terminal with
xcode-select --install
.
To run the demo in the iOS Simulator:
- Clone the project from this repository
- Navigate to the project directory using Terminal
- Run
pod install
- Open
eCommerce.xcworkspace
in Xcode. - Click
Run
in the toolbar, or pressCmd(⌘)-R
You should see the iOS Simulator 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://4c62a87c1810.us-west-2.playback.live-video.net/api/video/v1/us-west-2.049054135175.channel.onToXRHIurEP.m3u8
). - In Xcode, open
eCommerce/Constants.swift
. - Replace the string on line
12
with the Playback URL from step 2. - Save and build the application. Navigate to the leftmost image in the
LIVE
carousel to view landscape video, or the second-to-leftmost image to view portrait video.
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.
"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.