Skip to content

any chance to make it work with react-native? #944

Open

Description

@mushthak02

What version of this package are you using?

What operating system, Node.js, and npm version?

What happened?

What did you expect to happen?

Are you willing to submit a pull request to fix this bug?

Activity

  1. yahacom commented on Mar 6, 2025

    @yahacom

    @mushthak02 it works for React Native.
    you need to install react-native-webrtc and pass into wrtc config like:

    import { RTCIceCandidate, RTCPeerConnection, RTCSessionDescription } from 'react-native-webrtc';
    
    ...
    
    new Peer({
      wrtc: { RTCPeerConnection, RTCIceCandidate, RTCSessionDescription },
      ...
    });
    

    then use it as regular according to docs.

  2. mushthak02 commented on Mar 6, 2025

    @mushthak02
    Author

    @yahacom
    useEffect(()=>{
    const PeerConnection=new Peer({
    wrtc: { RTCPeerConnection, RTCIceCandidate, RTCSessionDescription },
    initiator: true,
    trickle: true,
    config: { iceServers: [{ urls: "stun:stun.l.google.com:19302" }] },
    });

          console.log("PeerConnection==>",PeerConnection)
    },[])
    

    error showing
    Warning: Error: Secure random number generation is not supported by this browser.
    Use Chrome, Firefox or Internet Explorer 11

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions