Skip to content

Commit 2d153e1

Browse files
davidliusaghulomertsbrkkykBurak KIYAK
authored
Merge upstream and update webrtc to M125 (#9)
* webrtc: update WebRTC to M124 * api: allow sdpMid / sdpLineIndex to be null in RTCIceCandidate Having both as null is still an error. Fixes: react-native-webrtc#1518 * ios: refactor rendering in RTCVideoView The way the renderer is implemented is as follows: there is a UIView which holds on to a RTCMTLVideoView, which does the actual rendering in metal. Rather than using our own home-grown mechanism to layout the views, just make sure the Metal view takes 100% of the space of our view, and then use the `videoContentMode` property to set it to cover or contain, matching the way a browser would do it. This greatly simplifies the code because we lonnger care about the video size, the Metal renderer makes the adjustments autmagically. In addition, the mirror and object-fit properties are only applied once, when they change, not on every layout change, which is unnecessary. * ios: add all available camera device types * preserve order * release 124.0.1 20cf1d5 preserve order ( Burak KIYAK 2024-05-03 13:41:59 +0200) 64e8298 ios: add all available camera device types ( Burak KIYAK 2024-04-30 12:30:38 +0200) f36b6b8 ios: refactor rendering in RTCVideoView ( Saúl Ibarra Corretgé 2024-06-11 09:35:36 +0200) * build(deps-dev): bump braces from 3.0.2 to 3.0.3 (react-native-webrtc#1578) Bumps [braces](https://github.com/micromatch/braces) from 3.0.2 to 3.0.3. - [Changelog](https://github.com/micromatch/braces/blob/master/CHANGELOG.md) - [Commits](micromatch/braces@3.0.2...3.0.3) --- updated-dependencies: - dependency-name: braces dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * mark for beta release --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: Saúl Ibarra Corretgé <saghul@jitsi.org> Co-authored-by: omerts <omerts3@gmail.com> Co-authored-by: Saúl Ibarra Corretgé <s@saghul.net> Co-authored-by: Burak KIYAK <brkkyk@gmail.com> Co-authored-by: Burak KIYAK <bkiyak@turnitin.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
1 parent cde6b51 commit 2d153e1

16 files changed

Lines changed: 101 additions & 241 deletions

File tree

.github/workflows/android_ci.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,10 @@ jobs:
1414
runs-on: ubuntu-latest
1515
steps:
1616
- uses: actions/checkout@v3
17-
17+
- uses: actions/setup-java@v4
18+
with:
19+
distribution: 'temurin'
20+
java-version: '17'
1821
- uses: actions/setup-node@v3
1922
with:
2023
node-version: '16.x'

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,12 @@ Software encode/decode factories have been enabled by default.
3939

4040
## WebRTC Revision
4141

42-
* Currently used revision: [M114](https://github.com/webrtc-sdk/webrtc/tree/m114_release)
42+
* Currently used revision: [M125](https://github.com/webrtc-sdk/webrtc/tree/m125_release)
4343
* Supported architectures
4444
* Android: armeabi-v7a, arm64-v8a, x86, x86_64
4545
* iOS: arm64, x86_64
4646
* tvOS: arm64
47-
* macOS: (temporarily disabled)
47+
* macOS: arm64, x86_64
4848

4949
## Getting Started
5050

android/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,5 @@ android {
3030

3131
dependencies {
3232
implementation 'com.facebook.react:react-native:+'
33-
api 'io.github.webrtc-sdk:android:114.5735.11'
33+
api 'io.github.webrtc-sdk:android:125.6422.02'
3434
}

android/src/main/java/com/oney/WebRTCModule/WebRTCModule.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1270,16 +1270,16 @@ public void peerConnectionAddICECandidate(int pcId, ReadableMap candidateMap, Pr
12701270
return;
12711271
}
12721272

1273-
if (!(candidateMap.hasKey("sdpMid") && candidateMap.hasKey("sdpMLineIndex")
1274-
&& candidateMap.hasKey("sdpMid"))) {
1273+
if (!candidateMap.hasKey("sdpMid") && !candidateMap.hasKey("sdpMLineIndex")) {
12751274
promise.reject("E_TYPE_ERROR", "Invalid argument");
12761275
return;
12771276
}
12781277

1279-
IceCandidate candidate = new IceCandidate(candidateMap.getString("sdpMid"),
1280-
candidateMap.getInt("sdpMLineIndex"),
1281-
candidateMap.getString("candidate"));
1282-
1278+
IceCandidate candidate = new IceCandidate(
1279+
candidateMap.hasKey("sdpMid") && !candidateMap.isNull("sdpMid") ? candidateMap.getString("sdpMid") : "",
1280+
candidateMap.hasKey("sdpMLineIndex") && !candidateMap.isNull("sdpMLineIndex") ? candidateMap.getInt("sdpMLineIndex") : 0,
1281+
candidateMap.getString("candidate"));
1282+
12831283
peerConnection.addIceCandidate(candidate, new AddIceObserver() {
12841284
@Override
12851285
public void onAddSuccess() {

examples/GumTestApp/App.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import {
1515
StatusBar,
1616
} from 'react-native';
1717
import { Colors } from 'react-native/Libraries/NewAppScreen';
18-
import { mediaDevices, RTCView } from 'react-native-webrtc';
18+
import { mediaDevices, RTCView } from '@livekit/react-native-webrtc';
1919

2020

2121
const App = () => {

examples/GumTestApp/ios/GumTestApp.xcodeproj/project.pbxproj

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@
359359
);
360360
runOnlyForDeploymentPostprocessing = 0;
361361
shellPath = /bin/sh;
362-
shellScript = "export NODE_BINARY=node\n../node_modules/react-native/scripts/react-native-xcode.sh";
362+
shellScript = "# Fix for machines using nvm\nif [[ -s \"$HOME/.nvm/nvm.sh\" ]]; then\n. \"$HOME/.nvm/nvm.sh\"\nelif [[ -x \"$(command -v brew)\" && -s \"$(brew --prefix nvm)/nvm.sh\" ]]; then\n. \"$(brew --prefix nvm)/nvm.sh\"\nfi\n\nexport NODE_BINARY=node\n../node_modules/react-native/scripts/react-native-xcode.sh\n";
363363
};
364364
2D02E4CB1E0B4B27006451C7 /* Bundle React Native Code And Images */ = {
365365
isa = PBXShellScriptBuildPhase;
@@ -400,18 +400,12 @@
400400
);
401401
inputPaths = (
402402
"${PODS_ROOT}/Target Support Files/Pods-GumTestApp/Pods-GumTestApp-frameworks.sh",
403-
"${PODS_XCFRAMEWORKS_BUILD_DIR}/Flipper-DoubleConversion/double-conversion.framework/double-conversion",
404-
"${PODS_XCFRAMEWORKS_BUILD_DIR}/Flipper-Glog/glog.framework/glog",
405-
"${PODS_XCFRAMEWORKS_BUILD_DIR}/JitsiWebRTC/WebRTC.framework/WebRTC",
406-
"${PODS_XCFRAMEWORKS_BUILD_DIR}/OpenSSL-Universal/OpenSSL.framework/OpenSSL",
403+
"${PODS_XCFRAMEWORKS_BUILD_DIR}/WebRTC-SDK/WebRTC.framework/WebRTC",
407404
"${PODS_XCFRAMEWORKS_BUILD_DIR}/hermes-engine/Pre-built/hermes.framework/hermes",
408405
);
409406
name = "[CP] Embed Pods Frameworks";
410407
outputPaths = (
411-
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/double-conversion.framework",
412-
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/glog.framework",
413408
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/WebRTC.framework",
414-
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/OpenSSL.framework",
415409
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/hermes.framework",
416410
);
417411
runOnlyForDeploymentPostprocessing = 0;
@@ -466,18 +460,12 @@
466460
);
467461
inputPaths = (
468462
"${PODS_ROOT}/Target Support Files/Pods-GumTestApp-GumTestAppTests/Pods-GumTestApp-GumTestAppTests-frameworks.sh",
469-
"${PODS_XCFRAMEWORKS_BUILD_DIR}/Flipper-DoubleConversion/double-conversion.framework/double-conversion",
470-
"${PODS_XCFRAMEWORKS_BUILD_DIR}/Flipper-Glog/glog.framework/glog",
471-
"${PODS_XCFRAMEWORKS_BUILD_DIR}/JitsiWebRTC/WebRTC.framework/WebRTC",
472-
"${PODS_XCFRAMEWORKS_BUILD_DIR}/OpenSSL-Universal/OpenSSL.framework/OpenSSL",
463+
"${PODS_XCFRAMEWORKS_BUILD_DIR}/WebRTC-SDK/WebRTC.framework/WebRTC",
473464
"${PODS_XCFRAMEWORKS_BUILD_DIR}/hermes-engine/Pre-built/hermes.framework/hermes",
474465
);
475466
name = "[CP] Embed Pods Frameworks";
476467
outputPaths = (
477-
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/double-conversion.framework",
478-
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/glog.framework",
479468
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/WebRTC.framework",
480-
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/OpenSSL.framework",
481469
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/hermes.framework",
482470
);
483471
runOnlyForDeploymentPostprocessing = 0;
@@ -657,7 +645,7 @@
657645
"-ObjC",
658646
"-lc++",
659647
);
660-
PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)";
648+
PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.example.lk.--PRODUCT-NAME-rfc1034identifier-";
661649
PRODUCT_NAME = GumTestApp;
662650
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
663651
SWIFT_VERSION = 5.0;
@@ -680,7 +668,7 @@
680668
"-ObjC",
681669
"-lc++",
682670
);
683-
PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)";
671+
PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.example.lk.--PRODUCT-NAME-rfc1034identifier-";
684672
PRODUCT_NAME = GumTestApp;
685673
SWIFT_VERSION = 5.0;
686674
VERSIONING_SYSTEM = "apple-generic";

examples/GumTestApp/ios/Podfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
require_relative '../node_modules/react-native/scripts/react_native_pods'
22
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'
33

4-
platform :ios, min_ios_version_supported
4+
platform :ios, 13.0
55
prepare_react_native_project!
66

77
# If you are using a `react-native-flipper` your iOS build will fail when `NO_FLIPPER=1` is set.

ios/RCTWebRTC/RCTConvert+WebRTC.m

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,8 @@ + (RTCIceCandidate *)RTCIceCandidate:(id)json {
4343
return nil;
4444
}
4545

46-
if (json[@"sdpMid"] == nil) {
47-
RCTLogConvertError(json, @".sdpMid must not be null");
48-
return nil;
49-
}
50-
51-
if (json[@"sdpMLineIndex"] == nil) {
52-
RCTLogConvertError(json, @".sdpMLineIndex must not be null");
46+
if (json[@"sdpMid"] == nil && json[@"sdpMLineIndex"] == nil) {
47+
RCTLogConvertError(json, @".sdpMid and .sdpMLineIndex must not be both null");
5348
return nil;
5449
}
5550

0 commit comments

Comments
 (0)