Skip to content

Commit 1e9df50

Browse files
committed
add install-peers-cli to handle peer-dependencies, fix versions
1 parent 3f83dee commit 1e9df50

File tree

3 files changed

+1225
-7654
lines changed

3 files changed

+1225
-7654
lines changed

README.md

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
55
## Requirements
66

7-
This library assumes you have an existing `react-native` application using `react-native-webrtc`.
7+
This library assumes you have an existing React Native application using [`react-native-webrtc`](https://github.com/react-native-webrtc/react-native-webrtc).
88

99
## Installation
1010

@@ -30,7 +30,7 @@ Replace the import statement of `react-native-webrtc` to import from `react-nati
3030

3131
#### RTCView
3232

33-
When displaying the `RTCView` component, pass it the `stream` object as a prop instead of `streamURL`.
33+
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.
3434

3535
```javascript
3636
<RTCView
@@ -44,9 +44,11 @@ When displaying the `RTCView` component, pass it the `stream` object as a prop i
4444
Add an `ontrack` listener to your `RTCPeerConnection` object, similar to the `onaddstream` listener.
4545

4646
```javascript
47+
// existing code, keep this for native support
4748
webRtcPeer.onaddstream = async ({ stream }) =>
4849
await addVideo(sessionId, stream);
49-
// add an ontrack listener for Safari support
50+
51+
// add an ontrack listener for web support
5052
webRtcPeer.ontrack = async ({ track, streams }) => {
5153
if (track.kind === 'video') {
5254
await addVideo(sessionId, streams[0]);
@@ -58,7 +60,17 @@ webRtcPeer.ontrack = async ({ track, streams }) => {
5860

5961
#### Local Build
6062

61-
Due to [this React issue](https://github.com/facebook/react/issues/13991), it is not possible to use `npm link`. To run locally you will need to package the app and install the `.tgz` file in your React Native app:
63+
Due to [this React issue](https://github.com/facebook/react/issues/13991), to run locally you will need to link `react` in this project and your application.
64+
65+
```bash
66+
cd node_modules/react
67+
npm link
68+
cd ../../MyApp
69+
npm link react
70+
71+
```
72+
73+
Alternatively, you can package the app and install it directly. Note you will need to re-package the app to apply any changes.
6274

6375
```bash
6476
npm pack

0 commit comments

Comments
 (0)