Recent changes in lib-jitsi-meet probably led to (1) our RTCPeerConnection customizations on react-native not being used which is a problem because we need them for at least NAT64 on iOS in order to pass the review in Apple's App Store and (2) unexpected exceptions inside react-native-webrtc. The Promise-based WebRTC API should be merged from react-native-webrtc's upstream but I don't want to do it right now because last time we got multiple bugs in addition.
40 lines
1.2 KiB
JavaScript
40 lines
1.2 KiB
JavaScript
import {
|
|
MediaStream,
|
|
MediaStreamTrack,
|
|
RTCSessionDescription,
|
|
RTCIceCandidate,
|
|
getUserMedia
|
|
} from 'react-native-webrtc';
|
|
|
|
import RTCPeerConnection from './RTCPeerConnection';
|
|
|
|
(global => {
|
|
if (typeof global.webkitMediaStream === 'undefined') {
|
|
global.webkitMediaStream = MediaStream;
|
|
}
|
|
if (typeof global.MediaStreamTrack === 'undefined') {
|
|
global.MediaStreamTrack = MediaStreamTrack;
|
|
}
|
|
if (typeof global.RTCIceCandidate === 'undefined') {
|
|
global.RTCIceCandidate = RTCIceCandidate;
|
|
}
|
|
if (typeof global.RTCPeerConnection === 'undefined') {
|
|
global.RTCPeerConnection = RTCPeerConnection;
|
|
}
|
|
if (typeof global.webkitRTCPeerConnection === 'undefined') {
|
|
global.webkitRTCPeerConnection = RTCPeerConnection;
|
|
}
|
|
if (typeof global.RTCSessionDescription === 'undefined') {
|
|
global.RTCSessionDescription = RTCSessionDescription;
|
|
}
|
|
|
|
const navigator = global.navigator;
|
|
|
|
if (navigator) {
|
|
if (typeof navigator.webkitGetUserMedia === 'undefined') {
|
|
navigator.webkitGetUserMedia = getUserMedia;
|
|
}
|
|
}
|
|
|
|
})(global || window || this); // eslint-disable-line no-invalid-this
|