This repository contains a collection of plain JavaScript code samples, covering several basic Amazon IVS use cases. This project is intended for education purposes only and not for production usage.
💡 Custom Player Controls
Shows how to leverage Amazon IVS's playerSDK APIs to implement custom player controls (Play/Pause, Mute/Unmute, Quality selection).
💡 Simple Quiz
Shows how to leverage Amazon IVS's TimedMetadata API to display a basic Quiz interface. Read more about how to add live video to your apps and websites.
💡 Multiple Players
Shows how to instantiate multiple Amazon IVS players simultaneously.
💡 Minimal Player Setup
Shows a minimal way to implement the Amazon IVS PlayerSDK.
💡 Video.js Integration
Shows how to use the Amazon IVS PlayerSDK with Video.js.
💡 Ambiance Canvas
A demo showing how you can achieve an "ambilight" effect using Canvas and the Amazon IVS Player SDK.
- Open the
index.html
file of each folder in a modern web browser to test each demo. - Open any demo's
script.js
in your favorite code editor, and replace the value ofPlaybackUrl
with your own Amazon IVS Playback URL to play your own stream. - Some demos may require running a local server. Here are a few ways to start one:
- Mac/Linux (Python 3):
python3 -m http.server 8000
- Windows (Python 3):
python -m http.server 8000
First, install a package like http-server
globally:
npm install -g http-server
Then run:
http-server
The basic-custom-stream
demo must be run with HTTPS. HTTPS requires a certificate to be generated.
In the sample directory generate a certificate with the following command:
openssl req -newkey rsa:2048 -new -nodes -x509 -days 3650 -keyout key.pem -out cert.pem
Fill out the relevant details in the promote.
In the sample directory run http-server
with the generated certificate:
http-server ./ -S -C cert.pem --port 8000
In the browser navigate to the provided endpoint, ex https://127.0.0.1
. The page will load a warning "This connection Is Not Private" because the certificate is self-signed. Proceed to the page and the player sample will load.
After starting the server, visit http://localhost:8000
in your web browser to view the demos.
The port number (8000) can be changed to any available port on your system.
Note: Service Workers (used in the "basic-custom-stream" demo) require the page to be served over either localhost
or HTTPS
. For more information, see the IVS Low-Latency documentation.
- These code samples were written for demonstration purposes and not for production use.
- These code samples were only tested on recent Chrome and Firefox versions.
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. Learn more.
- Amazon IVS docs
- User Guide
- API Reference
- Setting Up for Streaming with Amazon Interactive Video Service
- Learn more about Amazon IVS on IVS.rocks
- View more demos like this
See CONTRIBUTING for more information.
This library is licensed under the MIT-0 License. See the LICENSE file.