[RN] Update WebRTC polyfills

This commit is contained in:
Saúl Ibarra Corretgé 2018-08-16 14:27:31 +02:00 committed by Paweł Domas
parent 3ca704d81d
commit 1354731fc5
1 changed files with 6 additions and 6 deletions

View File

@ -3,14 +3,14 @@ import {
MediaStreamTrack,
RTCSessionDescription,
RTCIceCandidate,
getUserMedia
mediaDevices
} from 'react-native-webrtc';
import RTCPeerConnection from './RTCPeerConnection';
(global => {
if (typeof global.webkitMediaStream === 'undefined') {
global.webkitMediaStream = MediaStream;
if (typeof global.MediaStream === 'undefined') {
global.MediaStream = MediaStream;
}
if (typeof global.MediaStreamTrack === 'undefined') {
global.MediaStreamTrack = MediaStreamTrack;
@ -21,7 +21,7 @@ import RTCPeerConnection from './RTCPeerConnection';
if (typeof global.RTCPeerConnection === 'undefined') {
global.RTCPeerConnection = RTCPeerConnection;
}
if (typeof global.webkitRTCPeerConnection === 'undefined') {
if (typeof global.RTCPeerConnection === 'undefined') {
global.webkitRTCPeerConnection = RTCPeerConnection;
}
if (typeof global.RTCSessionDescription === 'undefined') {
@ -31,8 +31,8 @@ import RTCPeerConnection from './RTCPeerConnection';
const navigator = global.navigator;
if (navigator) {
if (typeof navigator.webkitGetUserMedia === 'undefined') {
navigator.webkitGetUserMedia = getUserMedia;
if (typeof navigator.mediaDevices === 'undefined') {
navigator.mediaDevices = mediaDevices;
}
}