0.1.3 • Published 1 year ago

srs-player v0.1.3

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

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 customized audio and video 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
0.1.2

1 year ago

0.1.3

1 year ago

0.1.1

1 year ago

0.1.0

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago