[RN] Update react-native-webrtc and remove no longer needed polyfills
This commit is contained in:
parent
3ad27961e5
commit
3ca704d81d
|
@ -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)
|
||||
|
|
|
@ -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",
|
||||
|
|
|
@ -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",
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue