<commit_before># react-native-webrtc

[![npm version](https://badge.fury.io/js/react-native-webrtc.svg)](https://badge.fury.io/js/react-native-webrtc)
[![npm downloads](https://img.shields.io/npm/dm/react-native-webrtc.svg?maxAge=2592000)](https://img.shields.io/npm/dm/react-native-webrtc.svg?maxAge=2592000)

A WebRTC module for React Native.

## Support
- Currently support for iOS and Android.  
- Support video and audio communication.  
- Supports data channels.  
- You can use it to build an iOS/Android app that can communicate with web browser.  
- The WebRTC Library is based on [webrtc-build-scripts](https://github.com/pristineio/webrtc-build-scripts)

## WebRTC Revision

please see [#79](https://github.com/oney/react-native-webrtc/issues/79) for discussions.

| react-native-webrtc | WebRTC(ios) | WebRTC(android)  | npm published |
| :-------------: | :-------------:| :-----: | :-----: |
| <= 0.9.0    | branch ~47 beta (11177)  | branch ~47 beta (11139)  | :heavy_check_mark: |
| 0.10.0      | branch 52 stable (13039) | branch 52 stable (13039) | :heavy_check_mark: |
| 0.11.0      | branch 52 stable (13039) | branch 52 stable (13039) | :heavy_check_mark: |
| 0.12.0      | branch 53 stable (13855) | branch 53 stable (13855) | :warning: |

## Installation

### prerequisite: Git Large File Storage ( Git LFS )
since 0.10.0, we upgrade webrtc library to branch 52 stable release, and store library on [Git Large File Storage](https://git-lfs.github.com/)  
you may need to install `git lfs` to automatically download library when `git clone` or `npm install`.  

belows are brief memo, please go to [Git LFS official website](https://git-lfs.github.com/) for details.  

**Linux:** download `git-lfs tar file` and execute `install.sh` inside it.  
**Mac:** `brew install git-lfs` or `port install git-lfs` then `git lfs install`  

### react-native-webrtc:

- [iOS](https://github.com/oney/react-native-webrtc/blob/master/Documentation/iOSInstallation.md)
- [Android](https://github.com/oney/react-native-webrtc/blob/master/Documentation/AndroidInstallation.md)

## Usage
Now, you can use WebRTC like in browser.
In your `index.ios.js`/`index.android.js`, you can require WebRTC to import RTCPeerConnection, RTCSessionDescription, etc.
```javascript
var WebRTC = require('react-native-webrtc');
var {
  RTCPeerConnection,
  RTCMediaStream,
  RTCIceCandidate,
  RTCSessionDescription,
  RTCView,
  MediaStreamTrack,
  getUserMedia,
} = WebRTC;<commit_msg>readme: fix mis-typed webrtc version<commit_after># react-native-webrtc

[![npm version](https://badge.fury.io/js/react-native-webrtc.svg)](https://badge.fury.io/js/react-native-webrtc)
[![npm downloads](https://img.shields.io/npm/dm/react-native-webrtc.svg?maxAge=2592000)](https://img.shields.io/npm/dm/react-native-webrtc.svg?maxAge=2592000)

A WebRTC module for React Native.

## Support
- Currently support for iOS and Android.  
- Support video and audio communication.  
- Supports data channels.  
- You can use it to build an iOS/Android app that can communicate with web browser.  
- The WebRTC Library is based on [webrtc-build-scripts](https://github.com/pristineio/webrtc-build-scripts)

## WebRTC Revision

please see [#79](https://github.com/oney/react-native-webrtc/issues/79) for discussions.

| react-native-webrtc | WebRTC(ios) | WebRTC(android)  | npm published |
| :-------------: | :-------------:| :-----: | :-----: |
| <= 0.9.0    | branch ~47 beta (11177)  | branch ~47 beta (11139)  | :heavy_check_mark: |
| 0.10.0      | branch 52 stable (12798) | branch 52 stable (12798) | :heavy_check_mark: |
| 0.11.0      | branch 52 stable (12798) | branch 52 stable (12798) | :heavy_check_mark: |
| 0.12.0      | branch 53 stable (13317) | branch 53 stable (13317) | :warning: |

## Installation

### prerequisite: Git Large File Storage ( Git LFS )
since 0.10.0, we upgrade webrtc library to branch 52 stable release, and store library on [Git Large File Storage](https://git-lfs.github.com/)  
you may need to install `git lfs` to automatically download library when `git clone` or `npm install`.  

belows are brief memo, please go to [Git LFS official website](https://git-lfs.github.com/) for details.  

**Linux:** download `git-lfs tar file` and execute `install.sh` inside it.  
**Mac:** `brew install git-lfs` or `port install git-lfs` then `git lfs install`  

### react-native-webrtc:

- [iOS](https://github.com/oney/react-native-webrtc/blob/master/Documentation/iOSInstallation.md)
- [Android](https://github.com/oney/react-native-webrtc/blob/master/Documentation/AndroidInstallation.md)

## Usage
Now, you can use WebRTC like in browser.
In your `index.ios.js`/`index.android.js`, you can require WebRTC to import RTCPeerConnection, RTCSessionDescription, etc.
```javascript
var WebRTC = require('react-native-webrtc');
var {
  RTCPeerConnection,
  RTCMediaStream,
  RTCIceCandidate,
  RTCSessionDescription,
  RTCView,
  MediaStreamTrack,
  getUserMedia,
} = WebRTC;
{'fraction_non_alphanumeric': 0.15282525638447617, 'fraction_numerical': 0.03820631409611904, 'mean_word_length': 3.86692759295499, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 20, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4342520', 'n_tokens_mistral': 1860, 'n_tokens_neox': 1654, 'n_words': 437}