peers / peerjs

Simple peer-to-peer with WebRTC.
https://peerjs.com
MIT License
12.17k stars 1.42k forks source link

this._negotiator.startConnection error #920

Open kisbalazs90 opened 2 years ago

kisbalazs90 commented 2 years ago

Hello

First, thanks for this WebRTC implementation. I'm using it (https://www.npmjs.com/package/peerjs 1.3.2) for video calls in an ionic 5 cross-platform app. Everything works fine in the first call, but when I would like to call again the partner, I got an error regarding the negotiator. It looks like this: I think the error occurred at the part of the answer.

[Error] ERROR TypeError: null is not an object (evaluating 'this._negotiator.startConnection')

I can't figure out what is happening. I tried everything to prevent it. I have no more idea.

Side A:
1. this.peer = new Peer(myId, options)
2. this.peer.call(partnerId, myStream)

Side B:
1. this.peer = new Peer(myId, options)
2.  this.peer.on('call', (call) => {
  this.inProgressCall = call;
  this.inProgressCall.answer(this.myStream);

  this.inProgressCall.on('stream', stream => {
     this.calleeEl.srcObject = stream;
  });
 })

I tried to unsubscribe from all events and back. Set the this.peer to null, and set again with new Peer(), close, reconnect, destroy. and tried many more things... but those are not helped me.

That's the only remaining thing in this project. Hope I get some help.

So it works, but only one time.

Thanks. Balazs

Update: I think It happens at the call.answer.

afrokick commented 2 years ago

Please, provide some example how to reproduce it. Without it it is hard to understand what go wrongs.