Giter Site home page Giter Site logo

iamvajid / webrtc.io Goto Github PK

View Code? Open in Web Editor NEW

This project forked from webrtc-io/webrtc.io

1.0 2.0 0.0 3.65 MB

An abstraction layer for webRTC. Aim is to simplify the HTML5 web standard webRTC in a similar manner to socket.io w/ websockets. Highly experimental technology

JavaScript 100.00%

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 infantile 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 webrtc.io

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

To run the server in debug mode, append '-debug' to the node command

Example code

Client

<video id="local" autoplay="autoplay"></video>
<video id="remote" autoplay="autoplay"></video>

<script src="/webrtc.io.js"></script>
<script>

  // note: make sure hostname available to all connecting clients
  // (ie. probably not `localhost`)
  rtc.connect('ws://yourserveraddress:8001');

  rtc.createStream({"video": true, "audio":false}, function(stream){
    // get local stream for manipulation
    rtc.attachStream(stream, 'local');
  });

  rtc.on('add remote stream', function(stream){
    // show the remote video
    rtc.attachStream(stream, 'remote');
  });

  // more rtc callbacks are available
</script>

Server

var webRTC = require('webrtc.io').listen(8001);
//then a bunch of callbacks are available

Stumped?

#webrtc.io on freenode

License

Copyright (C) 2012 Ben Brittain, Dennis Mårtensson, David Peter

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

webrtc.io's People

Contributors

aeosynth avatar benbrittain avatar benfoxall avatar captn3m0 avatar danielkutik avatar dennismartensson avatar ignjat avatar mariusbutuc avatar sarenji avatar stanangeloff avatar

Stargazers

 avatar

Watchers

 avatar  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.