npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

react-videoroom-janus

v0.0.72

Published

react-videoroom-janus

Downloads

112

Readme

react-videoroom-janus

The way to effortlessly embed video calls in your react application, package based upon video about scaling janus-gateway. Please do not hesitate to open an issue or ask a question, i will be more than happy to answer. Thank you. alt text

Getting Started

yarn add react-videoroom-janus  

These diagrams summarize behavior of packages mentioned below. alt text This is screenshot from video alt text react-videoroom-janus - contains thin wrapper around janus-gateway-client and should provide capability to add janus client functionality in form of react component. You just drop this into your app, attach callbacks and it works.

janus-gateway-client - logic related to signaling and negotiation between frontend and nodejs backend, this is separate package which you can install in your app.

janus-gateway-node - janus instances manager, receives messages from clients and dispatches them to correct janus instances (based on location of created room), sending back responses.

janus-gateway-videoroom-tests - tests.

janus-gateway-videoroom-demo - demo app which is making use of react-janus-videoroom.

Docker image herbert1947/janus-gateway-videoroom

docker pull herbert1947/janus-gateway-videoroom:latest 

Usage

Follow this link to find information on how to deploy backend part.

import { JanusVideoRoom } from 'react-videoroom-janus';

const Room = () => (
    <JanusVideoRoom
        server={this.props.server}
        user_id={this.props.user_id}
        room={this.state.selectedRoom}
        onPublisherDisconnected={(publisher) => {			
            console.log('publisher disconnected', publisher);        
	      }}
        onConnected={(publisher) => {
            console.log('publisher connected', publisher);
        }}
        onDisconnected={(error) => {
            console.log('disconnected', error);
        }}
        onRooms={(rooms) => {
            this.setState({ rooms });
        }}
        onError={(error) => {
            console.error(error);
        }}
        onParticipantJoined={(participant) => {
            console.log(participant);
        }}
        onParticipantLeft={(participant) => {
            console.log(participant);
        }}
    />
)

Props

server

string | required

websocket address of janus-gateway-node instance, should contain user id.
example:

const server = `ws://127.0.0.1:8080`;

room

string | required

id of the room to join, when this prop changes component will automatically perform cleanup and join different room.

user_id

string | required

id of the user.

onRooms

(rooms:JanusRoom[]) => void | required

called when connection established and response arrived for get available rooms request.

onError

(error:any) => void | required

in case error occurred this. function will be invoked to notify user about error.

onConnected

(publisher:JanusPublisher) => void | optional

called after publisher succesfully joined room.

onDisconnected

(error?:any) => void | optional

this function will be invoked in case connection was interrupted for some reason, first argument may contain information about possible reason for connection loss.

onPublisherDisconnected

(publisher:JanusPublisher) => void | optional

called when real time data transmission was interrupted or ice connection establishment has failed.

onParticipantJoined

(participant:JanusSubscriber) => void | optional

this function will notify user when new participant joined room in which user currently publishing media.

onParticipantLeft

(participant:JanusSubscriber) => void | optional

this function will notify user when new participant left room in which user currently publishing media.

renderContainer

(children:JSX.Element) => JSX.Element | optional

allows to modify appearance of room ui top level container by wrapping contents in custom react component.

renderStream

(subscriber:JanusSubscriber) => JSX.Element | optional

render stream directly (to improve customizability), stream property can be accessed through subscriber object (subscriber.stream).

renderLocalStream

(publisher:JanusPublisher) => JSX.Element | optional

customize rendering for publisher own video.

getCustomStyles

(nParticipants:number) => CustomStyles | optional

function which is going to return custom styles for each ui level depending on amount of participants in the room.

cameraId

string | optional

deviceId of selected video camera

logger

any | optional

customize logging

rtcConfiguration

any | optional

mediaConstraints

any | optional

DEMO

https://github.com/IG-88-2/janus-gateway-videoroom-demo

link

Contributing

Please consider to help by providing feedback on how this project can be improved or what is missing to make it useful for community. Thank you!

Authors

  • Anatoly Strashkevich

License

This project is licensed under the MIT License - see the LICENSE.md file for details