1
votes

I am trying to use simple-peer with react-native-webrtc package to create a connection. I believe this is the issue here but couldn't find any solution yet. https://github.com/feross/simple-peer/issues/109#issuecomment-576302328

Here is my client side code when a new peer joins it'll send its information via socket.io, thus first peer can add it as a peer:

this.socketRef.on("user joined", payload => {
        const peer = this.addPeer(payload.signal, payload.callerID)
        this.peersRef.push({
          peerID: payload.callerID,
          peer,
        })

        const peerObj = {
          peer,
          peerID: payload.callerID
        }

        this.peers.push(peerObj)
      })
addPeer(incomingSignal, callerID) {
    const peer = new Peer({
      initiator: false,
      trickle: false,
      stream: this.stream
    })

    peer.on("signal", signal => {
        this.socketRef.emit("returning signal", {signal, callerID})
    })

    peer.signal(incomingSignal) 

    return peer
  }

but i'm getting this error:

Error: No WebRTC support: Not a supported browser

Any help is appreciated

1
Can you share the rest of your code?bsheps
sure, here it is ^^Utkucan Yıldırım

1 Answers

0
votes

you can call like this

const peer = new Peer(
 {initiator: true, 
 wrtc: { 
  RTCPeerConnection,
  RTCIceCandidate,
  RTCSessionDescription,
  RTCView,
  MediaStream,
  MediaStreamTrack,
  mediaDevices,
  registerGlobals
  },
});