Closed omar94f closed 4 years ago
Your signalling code should be prepared for any number of signalling events from both peers. There’s more events than just the second offer that you may not be passing.
Also consider using a signalling library like signalhub or simple-signal.
This is the error I get when I signal back the new offer after the addStream. Any idea as to what can be wrong?
data
is the object or JSON string you passed into peer.signal()
. It’s undefined, which means you passed undefined
to peer.signal()
.
Make sure you’re passing signalling data and nothing else.
Wow it was as simple as that cant believe I missed that, it did the job. Thanks for the help man really appreciate it.
Hi, I am trying to dynamically add a stream after onConnect event has fired, this makes the peer fire another offer which I didnt know would happen. I tried to to signal this offer back to the receiving peer but that caused a crash. So what would be the proper way to handle dynamically adding a stream to an established connection. Im sure Im missing something which is not clear from the documentation.
this is how I am creating the initiating peer. On 'connect' I getUserMedia and call addStream(). Exactly how should I handle renegotiation for adding a stream? Thanks