2016-12-17 10:03:10 +00:00
|
|
|
import {
|
|
|
|
MediaStream,
|
|
|
|
MediaStreamTrack,
|
|
|
|
RTCSessionDescription,
|
2017-04-23 16:55:36 +00:00
|
|
|
RTCIceCandidate,
|
2016-12-17 10:03:10 +00:00
|
|
|
getUserMedia
|
|
|
|
} 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 => {
|
2016-10-05 14:36:59 +00:00
|
|
|
if (typeof global.webkitMediaStream === 'undefined') {
|
|
|
|
global.webkitMediaStream = MediaStream;
|
|
|
|
}
|
|
|
|
if (typeof global.MediaStreamTrack === 'undefined') {
|
|
|
|
global.MediaStreamTrack = MediaStreamTrack;
|
|
|
|
}
|
|
|
|
if (typeof global.webkitRTCPeerConnection === '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;
|
|
|
|
}
|
2017-04-23 16:55:36 +00:00
|
|
|
if (typeof global.RTCIceCandidate === 'undefined') {
|
|
|
|
global.RTCIceCandidate = RTCIceCandidate;
|
|
|
|
}
|
2016-10-05 14:36:59 +00:00
|
|
|
|
|
|
|
const navigator = global.navigator;
|
|
|
|
|
|
|
|
if (navigator) {
|
|
|
|
if (typeof navigator.webkitGetUserMedia === 'undefined') {
|
|
|
|
navigator.webkitGetUserMedia = getUserMedia;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
})(global || window || this); // eslint-disable-line no-invalid-this
|