nakamura-to / joiny

Simple Multicast with WebRTC
MIT License
11 stars 2 forks source link

JoinyJS - Simple Multicast with WebRTC

JoinyJS simplifies WebRTC API and allows you to communicate with multiple peers transparently.

import { createWebRTC } from 'joiny';

// get a WebRTC object
const webRTC = createWebRTC({
    media: { video: true, audio: true }
    channels: [
        { chat: { reliable: false } },
        { file: { reliable: true } }
    ]
});

// get a local peer with a callback
webRTC.on('local', (peer) => { ... });

// get a remote peer with a callback
webRTC.on('remote', (peer) => { ... });

// get a chat channel bundle with a callback
webRTC.on('chat.channel', (channel) => { ... });

// get a file channel bundle with a callback
webRTC.on('file.channel', (channel) => { ... });

// start communication
webRTC.start();

Description

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