Skip to content

Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.

[RN] Update react-native-webrtc and remove no longer needed polyfills

Saúl Ibarra Corretgé3ca704d81dc8
diff --git a/ios/Podfile.lock b/ios/Podfile.lock
index 3713b114bf..5c0e7e370b 100644
--- a/ios/Podfile.lock
+++ b/ios/Podfile.lock
@@ -22,7 +22,7 @@ PODS:
- React
- react-native-locale-detector (1.0.0):
- React
- - react-native-webrtc (1.58.2):
+ - react-native-webrtc (1.63.0):
- React
- React/Core (0.55.4):
- yoga (= 0.55.4.React)
diff --git a/package-lock.json b/package-lock.json
index 182a0afa74..2980432a99 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -12833,8 +12833,8 @@
}
},
"react-native-webrtc": {
- "version": "github:jitsi/react-native-webrtc#bed49210a51cf53081954028589d720381e7cf40",
- "from": "github:jitsi/react-native-webrtc#bed49210a51cf53081954028589d720381e7cf40",
+ "version": "github:jitsi/react-native-webrtc#81ffb72db7c2afd4eeb94cca1f3297950560ca11",
+ "from": "github:jitsi/react-native-webrtc#81ffb72db7c2afd4eeb94cca1f3297950560ca11",
"requires": {
"base64-js": "^1.1.2",
"event-target-shim": "^1.0.5",
diff --git a/package.json b/package.json
index a2b98aa321..d7735a2df7 100644
--- a/package.json
+++ b/package.json
@@ -73,7 +73,7 @@
"react-native-prompt": "1.0.0",
"react-native-sound": "0.10.9",
"react-native-vector-icons": "4.4.2",
- "react-native-webrtc": "github:jitsi/react-native-webrtc#bed49210a51cf53081954028589d720381e7cf40",
+ "react-native-webrtc": "github:jitsi/react-native-webrtc#81ffb72db7c2afd4eeb94cca1f3297950560ca11",
"react-redux": "5.0.7",
"redux": "4.0.0",
"redux-thunk": "2.2.0",
diff --git a/react/features/base/lib-jitsi-meet/native/RTCPeerConnection.js b/react/features/base/lib-jitsi-meet/native/RTCPeerConnection.js
index 30e765e395..bef9ee7094 100644
--- a/react/features/base/lib-jitsi-meet/native/RTCPeerConnection.js
+++ b/react/features/base/lib-jitsi-meet/native/RTCPeerConnection.js
@@ -73,14 +73,6 @@ export default function _RTCPeerConnection(...args: any[]) {
_RTCPeerConnection.prototype = Object.create(RTCPeerConnection.prototype);
_RTCPeerConnection.prototype.constructor = _RTCPeerConnection;
-_RTCPeerConnection.prototype.addIceCandidate
- = _makePromiseAware(RTCPeerConnection.prototype.addIceCandidate, 1, 0);
-
-_RTCPeerConnection.prototype.createAnswer
- = _makePromiseAware(RTCPeerConnection.prototype.createAnswer, 0, 1);
-_RTCPeerConnection.prototype.createOffer
- = _makePromiseAware(RTCPeerConnection.prototype.createOffer, 0, 1);
-
_RTCPeerConnection.prototype._invokeOnaddstream = function(...args) {
const onaddstream = this._onaddstream;
@@ -104,9 +96,6 @@ _RTCPeerConnection.prototype._queueOnaddstream = function(...args) {
this._onaddstreamQueue.push(Array.from(args));
};
-_RTCPeerConnection.prototype.setLocalDescription
- = _makePromiseAware(RTCPeerConnection.prototype.setLocalDescription, 1, 0);
-
_RTCPeerConnection.prototype.setRemoteDescription = function(
sessionDescription,
successCallback,
@@ -145,49 +134,6 @@ function _LOGE(...args) {
logger.error(...args);
}
-/**
- * Makes a {@code Promise}-returning function out of a specific void function
- * with {@code successCallback} and {@code failureCallback}.
- *
- * @param {Function} f - The (void) function with {@code successCallback} and
- * {@code failureCallback}.
- * @param {number} beforeCallbacks - The number of arguments before
- * {@code successCallback} and {@code failureCallback}.
- * @param {number} afterCallbacks - The number of arguments after
- * {@code successCallback} and {@code failureCallback}.
- * @returns {Promise}
- */
-function _makePromiseAware(
- f: Function,
- beforeCallbacks: number,
- afterCallbacks: number) {
- return function(...args) {
- return new Promise((resolve, reject) => {
- if (args.length <= beforeCallbacks + afterCallbacks) {
- args.splice(beforeCallbacks, 0, resolve, reject);
- }
-
- let fPromise;
-
- try {
- // eslint-disable-next-line no-invalid-this
- fPromise = f.apply(this, args);
- } catch (e) {
- reject(e);
- }
-
- // If the super implementation returns a Promise from the deprecated
- // invocation by any chance, try to make sense of it.
- if (fPromise) {
- const { then } = fPromise;
-
- typeof then === 'function'
- && then.call(fPromise, resolve, reject);
- }
- });
- };
-}
-
/**
* Adapts react-native-webrtc's {@link RTCPeerConnection#setRemoteDescription}
* implementation which uses the deprecated, callback-based version to the