Git Product home page Git Product logo

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

View Code? Open in Web Editor NEW
14.0 16.0 4.0 5.62 MB

A demo iPhone application intended as an educational tool for demonstrating how Amazon IVS can be used to build a scrolling feed of autoplaying live streams.

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

License: MIT License

Ruby 2.13% Swift 97.87%
live-streaming aws ios iphone swift autoplay-videos live-video live-video-stream amazon-ivs ivs-stream

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

Amazon IVS iOS Feed Demo

A demo iPhone application intended as an educational tool for demonstrating how Amazon IVS can be used to build a scrolling feed of live streams.

screenshot of the iOS app running on an iPhone

This project is intended for education purposes only and not for production usage.

This is a server-less iOS application that shows a list of Amazon IVS streams in a scrolling feed. The demo is written in Swift and showcases how customers can load and play Amazon IVS streams in a feed format.

This demo loads streams and stream metadata from a json file, which is used by the app to populate a scrolling list of streams.

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 ScrollingFeed.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. You can tap the heart icon (๐Ÿค) to spawn hearts, or the share icon (โ†—) to open the share sheet.

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 videos

This example loads streams and stream metadata from a file feed.json, which provides a json object containing an array of stream objects. Each stream object represents one video in the feed. To load your own Amazon IVS stream, you will need to create and stream to an Amazon IVS channel, and modify the included feed.json file to include the correct metadata for your stream.

/* Example feed.json markup */

{
  "streams": [
	{
	  "id": <unique-stream-id>,
	  "stream": {
		"channelArn": "<channel-ARN>",
		"health": "HEALTHY",
		"playbackUrl": "<channel-playback-url>.m3u8",
		"startTime": "<stream-start-time>",
		"state": "<live-status>",
		"viewerCount": <viewer-count>
	  },
	  "metadata": {
		"streamTitle": "<stream-title>",
		"userAvatar": "<streamer-avatar>",
		"userName": "<streamer-name>",
		"userColors": {
		  "primary": "<streamer-color-1-hex>",
		  "secondary": "<streamer-color-2-hex>"
		}
	  }
	},
	{
	  "id": 1,
	  "stream": {
		...
	  },
	  ...
	},
	...
  ]
}
  1. Open the Amazon IVS Console and navigate to the channel(s) you would like to use.
  2. Copy the Playback URL for the channel(s). The URL should end in .m3u8.(For example: https://fcc3ddae59ed.us-west-2.playback.live-video.net/api/video/v1/us-west-2.893648527354.channel.DmumNckWFTqz.m3u8).
  3. In Xcode, open ScrollingFeed/feed.json, and paste the .m3u8 URL(s) from step 2, into the appropriate playbackUrl key(s).
  4. Save and build the application.

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-feed-ios-demo's People

Contributors

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

Stargazers

 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

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

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.