0.1.3 • Published 2 years ago
srs-player v0.1.3
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-playerUsage
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
urlis the SRS WebRTC endpoint you want to connect to.
options
The
optionsprop contains attributes for the HTML video tag.
The default options:
{
autoPlay: true,
playsInline: true,
muted: true,
}rtcOptions
The
rtcOptionscontrol the behavior of the WebRTC connection. You can provided customizedaudioandvideooptions 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