Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

is this lib still alive ? on stream not fireing at all . no event after calling #37

Open
veeyka opened this issue Feb 4, 2023 · 7 comments

Comments

@veeyka
Copy link

veeyka commented Feb 4, 2023

is this lib still working correct ?
im using it . every thing is ok . just call.on("stream is not fireing at all . my code is simple like docs every where .

React.useEffect(()=>{
socket.clientSocket.on("connect", ()=>{
console.log("----- - - --- - - socket connection")
});

const start = async () => {
    let s;
    try {
      s = await mediaDevices.getUserMedia({ video: true});

      peer.peerServer.on("open" , (peerId)=>{
        socket.clientSocket.emit("join-room" , {peerId , userId: pageStates.userId , roomId: pageStates.roomId});
      });

      // user entered
      socket.clientSocket.on("a-user-entered" , ({newUserPeerId , newUserId})=>{
            const call = peer.peerServer.call(newUserPeerId, s);
             call.on("stream" , (remoteVideoStream)=>{
                  if(remoteVideoStream){
                         console.log("stream" , remoteVideoStream)
                  }
            });
      });

      peer.peerServer.on("call" , (call)=>{
    
        call.answer(s);
        call.on("stream" , (remoteS)=>{
          console.log("and we got " + remoteS)
        });
      });
     
    } 
};
start();

},[])

@matallui
Copy link

matallui commented Apr 29, 2023

@veeyka did you manage to get it working? I've built a couple of demos last year where this still worked, but now I'm having no luck anymore. I think this package is just not compatible with later versions of react-native-webrtc anymore.

I'd love to fork this and maintain a package for RN that works with the latest versions or peerjs and react-native-webrtc, but would probably need some help. I've tried a couple of times in the past but without success. If anyone wants to team up, I'm all down for it.

@matallui
Copy link

What I ended up doing was to copy peerjs's .ts source files into my RN app (which contains react-native-webrtc) and then made some small adjustments to the code to get it working and that worked for me.

I just needed a quick win cause I have a demo in a few days, but once I find the time I'd love to figure out a better way of maintaining a React Native PeerJS package.

@alihaxan020
Copy link

@matallui
Do you have open source repo where you imlemented peerjs with react-native webtrc? I am interested to implement in my learning project.

@matallui
Copy link

matallui commented May 3, 2023

@alihaxan020 I don't right now, but once I find some time I'll try to put something together to share.

@savaliyap
Copy link

@alihaxan020 I don't right now, but once I find some time I'll try to put something together to share.

Hey mate, I'm also learning and if you made any advancement than please let me know

@matallui
Copy link

matallui commented Apr 9, 2024

@savaliyap @alihaxan020 Check out my new project Artico. It works both in web and React Native and has working examples for both apps in Github. It provides the same functionality as PeerJS and more. If you find any bugs or that anything is missing, feel free to open an Issue and I'll work on it. Cheers!

@alihaxan020
Copy link

alihaxan020 commented Jun 4, 2024

@matallui Thank you so much for your effort. It is working . Waiting for expo react native documentation for absolute beginner

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants