瀏覽代碼

[RN] Update WebRTC polyfills

master
Saúl Ibarra Corretgé 7 年之前
父節點
當前提交
1354731fc5
共有 1 個檔案被更改,包括 6 行新增6 行删除
  1. 6
    6
      react/features/base/lib-jitsi-meet/native/polyfills-webrtc.js

+ 6
- 6
react/features/base/lib-jitsi-meet/native/polyfills-webrtc.js 查看文件

@@ -3,14 +3,14 @@ import {
3 3
     MediaStreamTrack,
4 4
     RTCSessionDescription,
5 5
     RTCIceCandidate,
6
-    getUserMedia
6
+    mediaDevices
7 7
 } from 'react-native-webrtc';
8 8
 
9 9
 import RTCPeerConnection from './RTCPeerConnection';
10 10
 
11 11
 (global => {
12
-    if (typeof global.webkitMediaStream === 'undefined') {
13
-        global.webkitMediaStream = MediaStream;
12
+    if (typeof global.MediaStream === 'undefined') {
13
+        global.MediaStream = MediaStream;
14 14
     }
15 15
     if (typeof global.MediaStreamTrack === 'undefined') {
16 16
         global.MediaStreamTrack = MediaStreamTrack;
@@ -21,7 +21,7 @@ import RTCPeerConnection from './RTCPeerConnection';
21 21
     if (typeof global.RTCPeerConnection === 'undefined') {
22 22
         global.RTCPeerConnection = RTCPeerConnection;
23 23
     }
24
-    if (typeof global.webkitRTCPeerConnection === 'undefined') {
24
+    if (typeof global.RTCPeerConnection === 'undefined') {
25 25
         global.webkitRTCPeerConnection = RTCPeerConnection;
26 26
     }
27 27
     if (typeof global.RTCSessionDescription === 'undefined') {
@@ -31,8 +31,8 @@ import RTCPeerConnection from './RTCPeerConnection';
31 31
     const navigator = global.navigator;
32 32
 
33 33
     if (navigator) {
34
-        if (typeof navigator.webkitGetUserMedia === 'undefined') {
35
-            navigator.webkitGetUserMedia = getUserMedia;
34
+        if (typeof navigator.mediaDevices === 'undefined') {
35
+            navigator.mediaDevices = mediaDevices;
36 36
         }
37 37
     }
38 38
 

Loading…
取消
儲存