JoinyJS - Simple Multicast with WebRTC
JoinyJS simplifies WebRTC API and allows you to communicate with multiple peers transparently.
import { createWebRTC } from 'joiny';
const webRTC = createWebRTC({
media: { video: true, audio: true }
channels: [
{ chat: { reliable: false } },
{ file: { reliable: true } }
]
});
webRTC.on('local', (peer) => { ... });
webRTC.on('remote', (peer) => { ... });
webRTC.on('chat.channel', (channel) => { ... });
webRTC.on('file.channel', (channel) => { ... });
webRTC.start();
Description
- written in ES6.
- tested on Chrome 44.0.2403.125.
- uses WebSocket as a signaling channel.
- operates same kind of channels as a bundled channel for transparent multicast.
- detects entering and leaving of remote peers.
Example : Chat Room
$ cd examples/chat
$ npm install
$ npm start
Access http://localhost:3000
with some browsers.
Push the "Connect" Button on each browser.
Build
$ npm install
$ npm run build
License
The MIT License