Skip to content

Commit b1e1de2

Browse files
committed
Fix peer issue/cleanup things to reintroduce later
1 parent e9f9cf4 commit b1e1de2

40 files changed

+27
-14269
lines changed

.github/workflows/app.yml

Lines changed: 0 additions & 104 deletions
This file was deleted.

README.md

Lines changed: 25 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,30 @@
1-
# react-native-webrtc-web-shim
1+
[<img src="https://avatars.githubusercontent.com/u/42463376" alt="React Native WebRTC" style="height: 6em;" />](https://github.com/react-native-webrtc/react-native-webrtc-web-shim)
22

3-
![App Tests](https://github.com/ruddell/react-native-webrtc-web-shim/workflows/App%20Tests/badge.svg)
3+
# React-Native-WebRTC-Web-Shim
44

5-
> Add `react-native-web` support to a `react-native-webrtc` app.
5+
[![npm version](https://img.shields.io/npm/v/react-native-webrtc-web-shim)](https://www.npmjs.com/package/react-native-webrtc-web-shim)
6+
[![npm downloads](https://img.shields.io/npm/dm/react-native-webrtc-web-shim)](https://www.npmjs.com/package/react-native-webrtc-web-shim)
7+
[![Discourse topics](https://img.shields.io/discourse/topics?server=https%3A%2F%2Freact-native-webrtc.discourse.group%2F)](https://react-native-webrtc.discourse.group/)
68

7-
This library has interoperability tests for Safari, Firefox, and Chrome. View the [KITE Dashboard](http://jruddell.com/react-native-webrtc-web-shim).
9+
Add support for `react-native-web` to a `react-native-webrtc` app.
810

9-
## Requirements
11+
## Getting Started
1012

11-
This library assumes you have an existing React Native application using [`react-native-webrtc`](https://github.com/react-native-webrtc/react-native-webrtc).
13+
Use one of the following preferred package install methods to immediately get going.
1214

13-
## Installation
15+
**npm:** `npm install react-native-webrtc-web-shim --save`
16+
**yarn:** `yarn add react-native-webrtc-web-shim`
17+
**pnpm:** `pnpm install react-native-webrtc-web-shim`
1418

15-
Install via `npm` or `yarn`
16-
17-
```bash
18-
npm install react-native-webrtc-web-shim
19-
```
20-
21-
## Setup
22-
23-
### Replace Imports
19+
## Extra Required Steps
2420

2521
Replace the import statement of `react-native-webrtc` to import from `react-native-webrtc-web-shim` instead.
2622

2723
```javascript
2824
-import { RTCPeerConnection } from 'react-native-webrtc';
2925
+import { RTCPeerConnection } from 'react-native-webrtc-web-shim';
30-
3126
```
3227

33-
### Change WebRTC Code
34-
3528
#### RTCView
3629

3730
When displaying the `RTCView` component, pass it the `stream` object as a prop instead of `streamURL`. On Web, this component renders an HTML5 video tag.
@@ -45,37 +38,28 @@ When displaying the `RTCView` component, pass it the `stream` object as a prop i
4538

4639
#### Track Listener
4740

48-
Add an `ontrack` listener to your `RTCPeerConnection` object, similar to the `onaddstream` listener.
41+
Add the `ontrack` listener to your `RTCPeerConnection` object, similar to the `onaddstream` listener.
4942

5043
```javascript
5144
// existing code, keep this for native support
52-
webRtcPeer.onaddstream = async ({ stream }) =>
53-
await addVideo(sessionId, stream);
45+
webRtcPeer.onaddstream = async ({ stream }) => {
46+
await addVideo( sessionId, stream );
47+
};
5448

55-
// add an ontrack listener for web support
49+
// add the ontrack listener for web support
5650
webRtcPeer.ontrack = async ({ track, streams }) => {
57-
if (track.kind === 'video') {
58-
await addVideo(sessionId, streams[0]);
51+
if ( track.kind === 'video' ) {
52+
await addVideo( sessionId, streams[ 0 ] );
5953
}
6054
};
6155
```
6256

63-
### Contributing
57+
## Community
6458

65-
#### Local Build
59+
Come join our [Discourse Community](https://react-native-webrtc.discourse.group/) if you want to discuss any React Native and WebRTC related topics.
60+
Everyone is welcome and every little helps.
6661

67-
Fork and clone the repository and run:
62+
## Related Projects
6863

69-
```javascript
70-
npm link
71-
```
72-
73-
If you run `npm install`, it will install the peer-dependencies. Due to [this React issue](https://github.com/facebook/react/issues/13991), you will need to link `react` in this project and your application.
74-
75-
```bash
76-
cd node_modules/react
77-
npm link
78-
cd ../../MyApp
79-
npm link react
80-
81-
```
64+
Looking for extra functionality coverage?
65+
The [react-native-webrtc](https://github.com/react-native-webrtc) organization provides a number of packages which are more than useful when developing Real Time Communication applications.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-native-webrtc-web-shim",
3-
"version": "1.0.4",
3+
"version": "1.0.5",
44
"repository": {
55
"type": "git",
66
"url": "git+https://github.com/react-native-webrtc/react-native-webrtc-web-shim.git"
@@ -20,7 +20,7 @@
2020
"react": ">=16.x",
2121
"react-native": ">=0.x",
2222
"react-native-web": ">=0.12",
23-
"react-native-webrtc": "~1"
23+
"react-native-webrtc": "*"
2424
},
2525
"scripts": {
2626
"prepare": "install-peers",

test/kite/.gitignore

Lines changed: 0 additions & 5 deletions
This file was deleted.

test/kite/README.md

Lines changed: 0 additions & 135 deletions
This file was deleted.

0 commit comments

Comments
 (0)