2.3.0 • Published 5 years ago

simple-webrtc v2.3.0

Weekly downloads
17
License
MIT
Repository
github
Last release
5 years ago

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);
2.3.0

5 years ago

2.2.3

7 years ago

2.2.2

7 years ago

2.2.1

7 years ago

2.2.0

8 years ago

2.1.0

8 years ago

2.0.0

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago