Skip to content

Commit

Permalink
chore: update rn-webrtc to 104.0.0 and installation instructions (#71)
Browse files Browse the repository at this point in the history
* chore: update rn-webrtc to 104.0.0 and installation instructions

* Update README.md
  • Loading branch information
davidliu committed Jun 3, 2023
1 parent 26b4ce4 commit aa18b13
Show file tree
Hide file tree
Showing 5 changed files with 63 additions and 13 deletions.
60 changes: 55 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,69 @@
### NPM

```sh
npm install @livekit/react-native react-native-webrtc
npm install @livekit/react-native @livekit/react-native-webrtc
```

### Yarn

```sh
yarn add @livekit/react-native react-native-webrtc
yarn add @livekit/react-native @livekit/react-native-webrtc
```

This library depends on `react-native-webrtc`, which has additional installation instructions found here:
This library depends on `@livekit/react-native-webrtc`, which has additional installation instructions found here:

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

----

Once the `@livekit/react-native-webrtc` dependency is installed, one last step is needed to finish the installation:

### Android

In your [MainApplication.java](https://github.com/livekit/client-sdk-react-native/blob/main/example/android/app/src/main/java/com/example/livekitreactnative/MainApplication.java) file:

```
import com.livekit.reactnative.video.SimulcastVideoEncoderFactoryWrapper;
import com.oney.WebRTCModule.WebRTCModuleOptions;
import com.oney.WebRTCModule.webrtcutils.H264AndSoftwareVideoDecoderFactory;
import org.webrtc.*;
public class MainApplication extends Application implements ReactApplication {
@Override
public void onCreate() {
// Place this above any other RN related initialization
WebRTCModuleOptions options = WebRTCModuleOptions.getInstance();
options.videoEncoderFactory = new SimulcastVideoEncoderFactoryWrapper(null, true, true);
options.videoDecoderFactory = new H264AndSoftwareVideoDecoderFactory(null);
// ...
}
}
```

### iOS

In your [AppDelegate.m](https://github.com/livekit/client-sdk-react-native/blob/main/example/ios/LivekitReactNativeExample/AppDelegate.mm) file:

```
#import "WebRTCModule.h"
#import "WebRTCModuleOptions.h"
@implementation AppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
// Place this above any other RN related initialization
RTCDefaultVideoEncoderFactory *videoEncoderFactory = [[RTCDefaultVideoEncoderFactory alloc] init];
RTCVideoEncoderFactorySimulcast *simulcastVideoEncoderFactory =
[[RTCVideoEncoderFactorySimulcast alloc] initWithPrimary:videoEncoderFactory fallback:videoEncoderFactory];
WebRTCModuleOptions *options = [WebRTCModuleOptions sharedInstance];
options.videoEncoderFactory = simulcastVideoEncoderFactory;
//...
}
```

### Expo

Expand Down
4 changes: 2 additions & 2 deletions example/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ PODS:
- livekit-react-native (1.0.1):
- livekit-react-native-webrtc
- React-Core
- livekit-react-native-webrtc (104.0.0-beta.1):
- livekit-react-native-webrtc (104.0.0):
- React-Core
- WebRTC-SDK (= 104.5112.17)
- OpenSSL-Universal (1.1.1100)
Expand Down Expand Up @@ -626,7 +626,7 @@ SPEC CHECKSUMS:
hermes-engine: 47986d26692ae75ee7a17ab049caee8864f855de
libevent: 4049cae6c81cdb3654a443be001fb9bdceff7913
livekit-react-native: 91b95d5c60aaaa8d329e51348de600b56afb34c2
livekit-react-native-webrtc: 2d7910bc35002d16153446c82ebaeed03136f957
livekit-react-native-webrtc: eca15327553e9759bde4d6df3b9c09b97c51e212
OpenSSL-Universal: ebc357f1e6bc71fa463ccb2fe676756aff50e88c
RCT-Folly: 424b8c9a7a0b9ab2886ffe9c3b041ef628fd4fb1
RCTRequired: 8af6a32dfc2b65ec82193c2dee6e1011ff22ac2a
Expand Down
2 changes: 1 addition & 1 deletion example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"start": "react-native start"
},
"dependencies": {
"@livekit/react-native-webrtc": "^104.0.0",
"@react-native-async-storage/async-storage": "^1.17.10",
"@react-navigation/native": "^6.0.8",
"@react-navigation/native-stack": "^6.5.0",
Expand All @@ -22,7 +23,6 @@
"react-native-screens": "^3.19.0",
"react-native-toast-message": "^2.1.5",
"react-native-url-polyfill": "^1.3.0",
"@livekit/react-native-webrtc": "^104.0.0-beta.1",
"typescript": "4.8.4"
},
"devDependencies": {
Expand Down
8 changes: 4 additions & 4 deletions example/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1752,10 +1752,10 @@
"@jridgewell/resolve-uri" "3.1.0"
"@jridgewell/sourcemap-codec" "1.4.14"

"@livekit/react-native-webrtc@^104.0.0-beta.1":
version "104.0.0-beta.1"
resolved "https://registry.yarnpkg.com/@livekit/react-native-webrtc/-/react-native-webrtc-104.0.0-beta.1.tgz#640b05f728c7a89e60a491aa571fd8b28a540dcb"
integrity sha512-SHVNl5alhDsZ8vEiX3uR514MUWmc488u6TEHzbgnPRYWjQldeFsRnkHTQMSATFR5MwPw77f0X8rQJ8/puMHxKQ==
"@livekit/react-native-webrtc@^104.0.0":
version "104.0.0"
resolved "https://registry.yarnpkg.com/@livekit/react-native-webrtc/-/react-native-webrtc-104.0.0.tgz#07f0a5de7b69b8aa859089f1f5ec339aa437cca0"
integrity sha512-4+//X6RA2vF9fEYRKbAOj0ay3Mktcb0wh1fI0eOtOY+OSMpW9ni1+VRUdwt1yR2eP7d2O1pVYtj2VXpW3qu2tQ==
dependencies:
adm-zip "0.5.9"
base64-js "1.5.1"
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
"peerDependencies": {
"react": "*",
"react-native": "*",
"@livekit/react-native-webrtc": "^104.0.0-beta.1"
"@livekit/react-native-webrtc": "^104.0.0"
},
"scripts": {
"test": "jest",
Expand Down

0 comments on commit aa18b13

Please sign in to comment.