1234567891011121314151617181920212223242526272829303132 |
- import {
- MediaStream,
- MediaStreamTrack,
- RTCSessionDescription,
- 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.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
|