react-rtc
react-rtc is a react component that uses firebase to establish webRTC connections.
Usage
/** @jsx React.DOM */var Firebase = ;var React = ; var Rtc = ; var myFirebaseRef = 'https://someFbApp.firebaseio.com'; var VideoComponent = React; // Then use it like this: <Rtc id="myId" fb=myFirebaseRef> <VideoComponent key="sharedKey"> <VideoComponent key="anotherKeySharedWithAnotherClient"></Rtc>
API
Rtc
requires id
and fb
props. It can also take a component
prop which decides what DOM element child components will render in. It will default to a DIV element. id
must be unique amongst all clients/browsers who share the same firebase ref.
Child components require a key
component. Whenever a child component in another browser has the same key, they will establish a webRTC connection, and the child will get two new props injected: localStream
and remoteStream
. These are webRTC media streams.