Coder Social home page Coder Social logo

koajs-streaming's Introduction

open in vscode

The video streaming server is available at http://localhost:3000/

.env

Below is the default .env file:

PORT=3000

You can change the streaming server port from PORT environment variable.

Videos

Before to run the server, you need to create videos folder and add a video in:

./videos/video.mp4

If you want to change the video, just update src attribute of <video> element in public/index.html.

Supported Formats

Here are the supported formats:

  • Theora (Ogg)
  • H.264 (MP4)
  • HEVC/H.265 (MP4)
  • VP8 (WebM)
  • VP9 (WebM)
  • AV1 (WebM)
  • Matroska (MKV)

Opus audio codec is also supported. This applies to mp4, ogg, and webm containers. AAC audio codec is supported as well.

Subtitles

It is possible to add subtitles through <track> element in <video> element in public/index.html as follows:

<video 
    src="http://localhost:3000/api/video/video.mp4"
    playsInline
    muted
    autoplay
    controls 
    controlsList="nodownload"
  >
  <track
    label="English"
    kind="subtitles"
    srclang="en"
    src="captions/vtt/video-en.vtt"
    default />
  <track
    label="Deutsch"
    kind="subtitles"
    srclang="de"
    src="captions/vtt/video-de.vtt" />
</video>

The files that contain subtitles data are simple text files that follow the Web Video Text Tracks (WebVTT) format.

Run

npm install
npm start

Dev

npm install
npm run dev

You can find out more about this project on this CodeProject article.

koajs-streaming's People

Contributors

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