The video streaming server is available at http://localhost:3000/
Below is the default .env
file:
PORT=3000
You can change the streaming server port from PORT
environment variable.
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.
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.
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.
npm install
npm start
npm install
npm run dev
You can find out more about this project on this CodeProject article.