Coder Social home page Coder Social logo

aws-samples / amazon-ivs-ecommerce-ios-demo Goto Github PK

View Code? Open in Web Editor NEW
18.0 18.0 9.0 2.49 MB

A demo iPhone application intended as an educational tool for demonstrating how Amazon IVS can be used to build a compelling customer experience for eCommerce use-cases.

Home Page: https://aws.amazon.com/ivs/

License: MIT License

Ruby 2.11% Swift 97.89%
amazon-ivs ecommerce swift ios live-streaming live-video live-video-stream ivs-stream ivs-channel iphone-app iphone ivs-lowlatency lvl-200

amazon-ivs-ecommerce-ios-demo's Introduction

Amazon IVS eCommerce iOS Demo

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.

Amazon IVS eCommerce iOS demo screenshots

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.

Getting Started

To run this demo, you will need the following:

  1. Xcode 11 or greater. You can build this application for devices running iOS 10 or later.
  2. Cocoapods, installed and up-to-date. You can quickly install cocoapods from Terminal with sudo gem install cocoapods.
  3. Bundler, installed and up-to-date.
  4. 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:

  1. Clone the project from this repository
  2. Navigate to the project directory using Terminal
  3. Run pod install
  4. Open eCommerce.xcworkspace in Xcode.
  5. Click Run in the toolbar, or press Cmd(โŒ˜)-R

You should see the iOS Simulator boot up and launch the demo app. This may take a few moments to complete.

Modifying this Example

Prerequisites

IMPORTANT NOTE: Using your own stream will create and consume AWS resources, which will cost money.

  1. Create and set up an Amazon IVS channel. Getting started with Amazon IVS.

Using your own Live video

  1. Open the Amazon IVS Console and navigate to the channel you would like to use.
  2. 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).
  3. In Xcode, open eCommerce/Constants.swift.
  4. Replace the string on line 12 with the Playback URL from step 2.
  5. 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.

Using your own TimedMetadata events

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"
}

Additional Notes

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.

Documentation

Known Issues

  • 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.

License

This sample code is made available under a modified MIT license. See the LICENSE file.

amazon-ivs-ecommerce-ios-demo's People

Contributors

amazon-auto avatar coelhor avatar dependabot[bot] avatar mboulin avatar slee-aws avatar uldiszz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

amazon-ivs-ecommerce-ios-demo's Issues

Request: Picture in Picture

Hello,
I would like to know if the SDK support picture in picture?
I want to show the video across all the pages in the App, and show the video even switch to other Apps.

It seems that Apple only support any custom playerLayer which confirm to AVPlayerLayer. But the IVSPlayerLayer is confirm to CALayer instead of AVPlayerLayer. (see Doc)

Thank you.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.