srs-player
v0.1.3
Published
srs player implemented in react
Downloads
8
Readme
SRS Player
Description
This is the SRS (Simple Realtime Server) whipwhep player implementation using react and bundled in umd and esm format.
Installation
bun add srs-player
Usage
import 'srs-player/lib/index.css';
import { SrsPlayer } from 'srs-player';
<SrsPlayer url={url} options={options} rtcOptions={rtcOptions}/>
Check more in the examples
folder for usage.
Props
url:
The
url
is the SRS WebRTC endpoint you want to connect to.
options
The
options
prop contains attributes for the HTML video tag.
The default options
:
{
autoPlay: true,
playsInline: true,
muted: true,
}
rtcOptions
The
rtcOptions
control the behavior of the WebRTC connection. You can provided customizedaudio
andvideo
options that will be recursively merged with the default options.
The default rtcOptions
:
{
audio: {
enable: true,
transceiverOptions: {
direction: 'recvonly',
},
},
video: {
enable: true,
transceiverOptions: {
direction: 'recvonly',
},
},
}
For example, to disable audio in the WebRTC connection:
{
audio: {
enable: false
}
}
Development
bun i
bun demo