peerjs
peerjs copied to clipboard
on("stream") event should receive a unique MediaStream from a peer
on("stream") event currently receives 2 MediaStream objects from a unique peer. Both of these streams contain the audio and video tracks. We should only receive the MediaStream once.
You do have the MediaStream object sent once. The MediaStream however contains two tracks of type MediaStreamTrack. An audio and a video track
Because we fire on('stream') when peerConnection.ontrack called, so it called twice per one MediaStream with two tracks.
https://github.com/peers/peerjs/blob/master/lib/negotiator.ts#L145-L154