I'm trying to use react-native-webrtc in the constructor for simple peer
import wrtc from 'react-native-webrtc';
const peer = new SimplePeer({initiator: true, wrtc: wrtc});
the error I'm getting is
ExceptionsManager.js:179 Error: No WebRTC support: Not a supported browser
WebRTC is a powerful technology, and using react-native-webrtc we can build React Native applications with the same APIs available on browsers.
react-native-webrtc has brought WebRTC to React Native. PeerJS is a simple API to work with WebRTC in the Browser. I made it so that PeerJS works with react-native-webrtc in a React Native application.
currently this can be achieved using react-native-webrtc but expo does not support this package.
you have to import it like this
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
},
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With