mirror of
https://github.com/vdalex25/rtsp-to-web-player.git
synced 2025-09-26 21:01:42 +08:00
6eebec4834d649069ad67e6a7db79a334e62ac83
RTSPtoWEBPlayer
external video player for projects:
there is no GUI in this project, you can add your own GUI
Install
git clone https://github.com/vdalex25/RTSPtoWEBPlayer.git
cd RTSPtoWEBPlayer
npm install
npm run build
it's created compiled file dist/RTSPtoWEBPlayer.js
Usage
Add script to your page
<script src="dist/RTSPtoWEBPlayer.js"></script>
Create new player
const options={
parentElement: document.getElementById('player')
};
const player=new RTSPtoWEBPlayer(options);
player.load('ws://localhost:8083/stream/517fe9dbf4b244aaa0330cf582de9932/channel/0/mse?uuid=517fe9dbf4b244aaa0330cf582de9932&channel=0');
Options
options={
parentElement:null,
source:null,
controls:true,
muted:true,
autoplay:true,
loop:false,
hlsjsconfig: {
}
}
parentElement
default: null
HTMLElement
source
link to mediasource. requires explicit protocol http/https or ws/wss
controls
default: true
show/hide notive video control
muted
default: true
autoplay
default: true
loop
default: false
hlsjsconfig
default: empty;
full list of config you can see on API dicumentation hls.js
Methods
Description
Languages
JavaScript
90.7%
HTML
8.8%
CSS
0.5%