# simple-webrtc

> A simple WebRTC and MediaRecorder wrapper.

Latest version **2.3.0** (published 2019-03-12) · MIT license · 0 weekly downloads

## Install

```sh
npm install simple-webrtc
pnpm add simple-webrtc
yarn add simple-webrtc
bun add simple-webrtc
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.3.0 |
| Published | 2019-03-12 |
| First published | 2016-05-30 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 10.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Benjamim Sonntag |
| Maintainers | danielmor, ksvitorsilva, ruimfernandes, sioslife |
| Keywords | webrtc, mediarecorder |

## Links

- npm: https://www.npmjs.com/package/simple-webrtc
- Repository: https://github.com/Hidepixel/simple-webrtc
- Homepage: https://github.com/Hidepixel/simple-webrtc#readme
- Issues: https://github.com/Hidepixel/simple-webrtc/issues
- npm.io page: https://npm.io/package/simple-webrtc

## Dependencies (2)

- [webrtc-adapter](https://npm.io/package/webrtc-adapter.md) ^1.3.0
- [stop-media-stream](https://npm.io/package/stop-media-stream.md) 0.0.0

## Recent versions

- 2.3.0 (latest) — 2019-03-12
- 2.2.3 — 2017-06-14
- 2.2.2 — 2017-05-05
- 2.2.1 — 2016-12-07
- 2.2.0 — 2016-10-24
- 2.1.0 — 2016-07-15
- 2.0.0 — 2016-06-08
- 1.0.2 — 2016-06-02
- 1.0.1 — 2016-05-30
- 1.0.0 — 2016-05-30

## README

# 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);
```

---
_Source: https://npm.io/package/simple-webrtc · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
