peer.addStream(stream) doesn't raise event one other peer

Author: GruskiCreated Sep 10, 2021Updated Jun 10, 2025

using: v9.11.0 library directly referenced:

peer.addStream(stream) call on the initiator peer doesn't raise peer.on('stream', ...) event on the other peer after successful data connection. When stream is passed through the initiator peer constructor, the event does get raised. I was expecting the same to happen when peer.addStream(stream) was called in situations where the stream is no yet known at peer construction time.

Also when inspecting the 'peer' object in the console, after the peer.addStream() is called, the "streams" prop, which is an array, still has a length of 0. No stream is added. Probably a regression bug.