srs-player
TypeScript icon, indicating that this package has built-in type declarations

0.1.3 • Public • Published

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

Readme

Keywords

Package Sidebar

Install

npm i srs-player

Weekly Downloads

1

Version

0.1.3

License

MIT

Unpacked Size

102 kB

Total Files

10

Last publish

Collaborators

  • xhy279