Overview
RTConnect is an open-source React component library that enables live, real-time video/audio communications. It provides a downloadable npm package, VideoCall and LiveStream React components, and an importable signaling server module. RTConnect simplifies the implementation of WebRTC, WebSockets, and signaling, making it easier for developers to build low latency, real-time communication applications.
Features
- Supports video, voice, screen sharing, and generic data to be sent between peers.
- Importable, WebSockets-based signaling server module allows for rapid exchange of signaling messages.
- Rapidly set up live video calls in your React codebase without the hassle of implementing WebRTC.
Installation
To install RTConnect, follow these steps:
- Install the npm package:
npm install rtconnect
- Import the
VideoComponentcomponent in your React file:
import { VideoComponent } from 'rtconnect';
Set up your server. You can either use an http server or implement an https server for a more secure connection. (Instructions for setting up an https server are not provided in this document).
Import the
RTConnect Signaling Channelclass/module and instantiate it, passing your server as an argument:
import { RTConnectSignalingChannel } from 'rtconnect';
const signalingChannel = new RTConnectSignalingChannel(httpServer);
- Invoke the
initializeConnection()method of the signaling channel:
signalingChannel.initializeConnection();
- Import the
VideoCallcomponent in your desired .jsx file:
import { VideoCall } from 'rtconnect';
- Use the
VideoCallcomponent by passing the URL prop (e.g.,'ws://localhost:PORT') and optionalmediaOptionsprop:
<VideoCall URL={'ws://localhost:PORT'} mediaOptions={{/* controls: true, style: { width: '640px', height: '480px' */}}} />
Note: If you are using an https server, additional steps are required, but instructions are not provided in this document.
Summary
RTConnect is an open-source React component library that simplifies the implementation of real-time video/audio communications using WebRTC. It provides features such as support for video, voice, screen sharing, and generic data transmission between peers. With the help of RTConnect, developers can quickly set up live video calls in their React applications without worrying about the complexities of WebRTC implementation.