Files
jitsi-meet/react/features/base/lib-jitsi-meet/native/polyfills-webrtc.js
Saúl Ibarra Corretgé a327a5d804 [RN] Drop the react-native-permissions dependency
It causes false positives when submitting the app to the Store. Use the new
permissions API in react-native-webrtc instead.
2018-09-05 14:56:00 -05:00

44 lines
1.3 KiB
JavaScript

import {
MediaStream,
MediaStreamTrack,
RTCSessionDescription,
RTCIceCandidate,
mediaDevices,
permissions
} from 'react-native-webrtc';
import RTCPeerConnection from './RTCPeerConnection';
(global => {
if (typeof global.MediaStream === 'undefined') {
global.MediaStream = 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.RTCPeerConnection === 'undefined') {
global.webkitRTCPeerConnection = RTCPeerConnection;
}
if (typeof global.RTCSessionDescription === 'undefined') {
global.RTCSessionDescription = RTCSessionDescription;
}
const navigator = global.navigator;
if (navigator) {
if (typeof navigator.mediaDevices === 'undefined') {
navigator.mediaDevices = mediaDevices;
}
if (typeof navigator.permissions === 'undefined') {
navigator.permissions = permissions;
}
}
})(global || window || this); // eslint-disable-line no-invalid-this