2016-12-17 10:03:10 +00:00
|
|
|
import {
|
|
|
|
MediaStream,
|
|
|
|
MediaStreamTrack,
|
2017-04-23 16:55:36 +00:00
|
|
|
RTCIceCandidate,
|
2022-09-27 07:10:28 +00:00
|
|
|
RTCSessionDescription,
|
2018-09-04 21:43:10 +00:00
|
|
|
mediaDevices,
|
|
|
|
permissions
|
2016-12-17 10:03:10 +00:00
|
|
|
} from 'react-native-webrtc';
|
|
|
|
|
|
|
|
import RTCPeerConnection from './RTCPeerConnection';
|
2016-10-05 14:36:59 +00:00
|
|
|
|
2016-12-17 10:03:10 +00:00
|
|
|
(global => {
|
2018-08-16 12:27:31 +00:00
|
|
|
if (typeof global.MediaStream === 'undefined') {
|
|
|
|
global.MediaStream = MediaStream;
|
2016-10-05 14:36:59 +00:00
|
|
|
}
|
|
|
|
if (typeof global.MediaStreamTrack === 'undefined') {
|
|
|
|
global.MediaStreamTrack = MediaStreamTrack;
|
|
|
|
}
|
2018-02-28 19:55:11 +00:00
|
|
|
if (typeof global.RTCIceCandidate === 'undefined') {
|
|
|
|
global.RTCIceCandidate = RTCIceCandidate;
|
|
|
|
}
|
|
|
|
if (typeof global.RTCPeerConnection === 'undefined') {
|
|
|
|
global.RTCPeerConnection = RTCPeerConnection;
|
|
|
|
}
|
2018-08-16 12:27:31 +00:00
|
|
|
if (typeof global.RTCPeerConnection === 'undefined') {
|
2016-12-17 10:03:10 +00:00
|
|
|
global.webkitRTCPeerConnection = RTCPeerConnection;
|
2016-10-05 14:36:59 +00:00
|
|
|
}
|
|
|
|
if (typeof global.RTCSessionDescription === 'undefined') {
|
|
|
|
global.RTCSessionDescription = RTCSessionDescription;
|
|
|
|
}
|
|
|
|
|
|
|
|
const navigator = global.navigator;
|
|
|
|
|
|
|
|
if (navigator) {
|
2018-08-16 12:27:31 +00:00
|
|
|
if (typeof navigator.mediaDevices === 'undefined') {
|
|
|
|
navigator.mediaDevices = mediaDevices;
|
2016-10-05 14:36:59 +00:00
|
|
|
}
|
2018-09-04 21:43:10 +00:00
|
|
|
if (typeof navigator.permissions === 'undefined') {
|
|
|
|
navigator.permissions = permissions;
|
|
|
|
}
|
2016-10-05 14:36:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
})(global || window || this); // eslint-disable-line no-invalid-this
|