我正在尝试在构造函数中使用 react-native-webrtc 来实现简单对等
import wrtc from 'react-native-webrtc';
const peer = new SimplePeer({initiator: true, wrtc: wrtc});
我得到的错误是
ExceptionsManager.js:179 Error: No WebRTC support: Not a supported browser
我正在尝试在构造函数中使用 react-native-webrtc 来实现简单对等
import wrtc from 'react-native-webrtc';
const peer = new SimplePeer({initiator: true, wrtc: wrtc});
我得到的错误是
ExceptionsManager.js:179 Error: No WebRTC support: Not a supported browser
你必须像这样导入它
import {
RTCPeerConnection,
RTCIceCandidate,
RTCSessionDescription,
RTCView,
MediaStream,
MediaStreamTrack,
mediaDevices,
registerGlobals
} from 'react-native-webrtc';
const peer = new SimplePeer(
{initiator: true,
wrtc: {
RTCPeerConnection,
RTCIceCandidate,
RTCSessionDescription,
RTCView,
MediaStream,
MediaStreamTrack,
mediaDevices,
registerGlobals
},
});