simple-webrtc

2.3.0 • Public • Published

simple-webrtc

A simple WebRTC and MediaRecorder wrapper.

Installation

npm install --save simple-webrtc

Usage

Initialization

var SimpleWebRtc = require('simple-webrtc');

var webRtc = SimpleWebRtc(rtcConfiguration, mediaConstraints);

Checking if the browser supports getUserMedia

console.log(webRtc.hasUserMedia);
// true or false, depending on wether
// the browser supports any form of getUserMedia

Checking if the browser supports MediaRecorder

console.log(webRtc.hasMediaRecorder);
// true or false, depending on wether
// the browser supports MediaRecorder

Checking if there is a camera

webRtc.hasCamera()
  .then(function(hasCamera) {
    console.log(hasCamera);
    // true or false, depending on wether
    // there is a camera or not
  });

Creating a peer connection

var connection = webRtc.createConnection();

Creating a media recorder

var recorder = webRtc.createRecorder(constraints);

Readme

Keywords

Package Sidebar

Install

npm i simple-webrtc

Weekly Downloads

3

Version

2.3.0

License

MIT

Unpacked Size

10.4 kB

Total Files

7

Last publish

Collaborators

  • danielmor
  • ksvitorsilva
  • ruimfernandes
  • sioslife