Git Product home page Git Product logo

livestream's Introduction

LiveKit Livestreaming Demo

alt text

This is a demo app for livestreaming via RTMP or WHIP using LiveKit. One user is a broadcaster who gets an RTMP/WHIP for streaming (eg, via OBS). Other users can view their stream and chat. We also let you broadcast directly from your device from the "Host" page.

Today most livestreams experience a 5โ€“30 second lag, which is evident in the delay it takes for streamers to respond to chats. Those streams use HLS, which leverages existing CDNs by uploading 5โ€“30 second video chunks, which clients download one chunk at a time. HLS is hugely scalable, but it comes with latency.

LiveKit is a sort of WebRTC CDN, achieving sub-100ms latency for audiences of 1000 or 100,000 by streaming video over backbone Internet connections and only going over the public Internet for the last mile (that is, delivery to connected clients). This enables true real-time, large-scale events, where anyone and everyone can participate.

This sample app only leverages the following technologies:

Running locally

Clone the repo and install dependencies:

git clone [email protected]:livekit-examples/livestream.git
cd livestream
npm install

Create a new LiveKit project at https://cloud.livekit.io. Then create a new key in your project settings.

Create a new .env.development file and add your new API key and secret as well as your project's WebSocket URL (found at the top of https://cloud.livekit.io):

LIVEKIT_API_KEY=<your api key>
LIVEKIT_API_SECRET=<your api secret>
LIVEKIT_API_URL=https://<your-project>.livekit.cloud
NEXT_PUBLIC_LIVEKIT_WS_URL=wss://<your-project>.livekit.cloud

Then run the development server:

npm run dev
# or
yarn dev
# or
pnpm dev
# or
bun dev

You can test it by opening http://localhost:3000 in a browser.

Deploying

This demo is a Next.js app. You can deploy to your Vercel account with one click:

Deploy with Vercel

Refer to the Next.js deployment documentation for more about deploying to a production environment.

livestream's People

Contributors

cacheonly avatar davidzhao avatar noahlt avatar thesrs02 avatar mattherzog avatar keepingitneil avatar

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.