Giter Club home page Giter Club logo

webrtc.io's Introduction

webRTC.io

An abstraction layer for webRTC. Aim is to simplify the HTML5 web standard webRTC in a similar manner to socket.io w/ websockets. This project is still in an infintile stage, please send feature requests (or pulls!) to us as well as bug reports.

What is webRTC?

webRTC is a new webstandard being developed for peer-to-peer communication on the web. This means that browsers will be able to send information, without sending information through the server. Server side this will reduce load dramatically.

Currently the webRTC standard is very focused on the video & audio aspects of the project. In the future (hopefully near future!) they will begin implementing the data channel, which will allow arbitrary data to be sent peer-to-peer. For now the webRTC team is focused on stabalizing and optimizing the video and audio channels.

Unfortunately, a server (or two) will still be required for two reasons, The media for the page must be initially supplied, and the server, in conjunction with a STUN server (abstracted away by the webRTC.io library), is required to synchronize the connections.

Browser Support

webRTC is supported in very few browsers. We recommend either chrome from either the dev channel or the canary release. After installation, go to About://flags. Enable

Enable Media Source API on <video> elements. (this may be unnecessary)
Enable MediaStream (this may be unnecessary)
Enable PeerConnection

Demo

This is a multi-person chat room demo written using our webRTC.io library. Example Site & Repository (browser support section still applies!)

Installation

 npm install 

for absurdly detailed instruction on setting up the demo, go to the demo repo.

Example code

Client

<video id="local" autoplay></video>
<script src="/socket.io/socket.io.js"></script>
<script src="/webrtc.io/webrtc.io.js"></script>
<script>
  rtc.createStream('local');
  rtc.connect('http://yourserveraddress');
  rtc.on('ready', function() {
    // all streams are loaded
  });
</script>

Server

var io = require('webrtc.io').listen(8000);
// this is a simple wrapper around socket.io, so you can define your own events
// like so:
io.sockets.on('connection', function(socket) {
  socket.on('chat', function(nick, message) {
    socket.broadcast.emit('chat', nick, message);
  });
});

Stumped?

#webrtc.io on freenode

We've done house calls in the past (also known as walking down the hall)... we'll totally do it again if you fly us out!

Collaborators

@dennismatensson @cavedweller @sarenji

webrtc.io's People

Contributors

benbrittain avatar sarenji avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.