const mobPeer = new Peer({
host: ipv4, secure: false, port: 8090, path: '/peer',
});
mobPeer.on('error', function(err) {
console.log("MOB CONN ERROR", err);
})
mobPeer.on('open', function(id) {
console.log("mobile id", id)
// I send ID to database here for electron app to find
});
mobPeer.on('call', function(call) {
console.log("Web calling"); // this works fine
call.answer(null);
call.on('stream', function(stream) {
console.log('stream from desktop') // this never runs
});
});
Thanks for this awesome bit of work you've put together.
I have an electron/node app running on localhost (laptop) and a react native app running on my mobile (using this)
Both can get an ID from either your server or one that I run locally, no problems there.
Using
peer.call(mobileId, stream);
on my laptop. This ends up triggering themobPeer.on('call', function(call) {
as expected.However, the
call.on('stream', function(stream) {
never gets executed, no matter what I seem to do. Any help would be appreciated.Electron Project (laptop):
React Native code: