yocontra / rtc-everywhere

Cross-everything WebRTC mega-project
http://rtc.works
MIT License
651 stars 40 forks source link

rtc-everywhere NPM version Downloads Build Status

What is this?

Sick of the incompatible mess of vendor prefixes, adapters, plugins, extensions, and native modules? rtc-everywhere aims to provide a spec-compliant WebRTC implementation in as many environments as possible.

Supported Environments

:computer: Desktop

:iphone: Mobile

Other

Getting Started

npm install rtc-everywhere --save
var rtc = require('rtc-everywhere')();

// Available:
// rtc.RTCPeerConnection
// rtc.RTCIceCandidate
// rtc.RTCSessionDescription
// rtc.getUserMedia
// rtc.attachStream(stream, videoElement)

:crystal_ball: Want a more detailed example that uses these functions? Check out the loopback stream example!

API

RTCPeerConnection

Exactly the same as the specification. See the Specification Documentation!

RTCIceCandidate

Exactly the same as the specification. See the Specification Documentation!

RTCSessionDescription

Exactly the same as the specification. See the Specification Documentation!

getUserMedia(constraints, cb)

Similar to the specification, but slightly adjusted to have an easier API.

Modifications
// these are the same thing
rtc.getUserMedia(function(err, stream){});
rtc.getUserMedia({video: true, audio: true}, function(err, stream){});

attachStream(stream, element)

Related Libraries