Cross-everything WebRTC mega-project
Switch branches/tags
Nothing to show
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
examples docs Jan 20, 2016
lib options to override platform and platforms list Jan 2, 2016
platforms working on ms edge 🎉 Jan 3, 2016
test make the tests pass Dec 16, 2015
util working on ms edge 🎉 Jan 3, 2016
.editorconfig init Dec 3, 2015
.gitignore init Dec 3, 2015
.jshintrc fix a bunch of problems Dec 15, 2015
.npmignore init Dec 3, 2015
.travis.yml travis fix Dec 4, 2015
LICENSE license fix Dec 13, 2015
README.md reflect node limitations in our docs Apr 9, 2018
index.js options to override platform and platforms list Jan 2, 2016
package.json Add bulkify as a dependency Oct 31, 2016

README.md

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

💻 Desktop

  • Chrome
  • Firefox
  • MS Edge [Partial]
    • No data channels
  • Safari 7+
    • Requires Temasys Plugin
  • Internet Explorer 9+ [In Progress]
    • Requires Temasys Plugin

📱 Mobile

  • Android 5+
  • Cordova iOS
    • Requires install of cordova-iosrtc
  • Cordova Android
    • Requires install of cordova-crosswalk
  • react-native iOS/Android [In Progress]
    • Requires install of react-native-webrtc

Other

  • Node.js 0.10+
    • Requires install of wrtc
    • Only works on x64 Linux, Mac, and Windows
    • MediaStream APIs are not supported at this time
    • See wrtc for more info.

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)

🔮 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
  • constraints is optional (makes things easier)

    • Defaults to {video: true, audio: true}
  • cb is a node-style error first callback

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

attachStream(stream, element)

  • Attaches a stream to a given video element
  • Returns the element the video was attached to
  • In IE and Safari, the video element will be replaced by an object element
    • Elements will not be replaced or modified unless they exist on the DOM
    • Regardless of replacement, the new object element will be returned

Related Libraries