1

I am developing a multiuser video chat application, where each user has a different role.

While listening for RTCPeerConnection.onAddStream event, I am not able to figure out the source of the mediaStream.

Is there an easy way to add metadata at the source of MediaStream, which can be helpful at the receiving end?

Presently I am solving this issue through 'signalling'. While creating the MediaStream, I share the id through socket, and at the receiving end, I figure out by comparing the ids from RTCPeerConnection.getRemoteStreams(). But the problem is, if someone joins in late, she misses the information.

Please let me know if you have any suggestion on this.

rethna2
  • 11
  • 3
  • You've already solved it. It's not clear why "joins in late" is a problem. – jib Jul 18 '19 at 05:01
  • Thank you @jib. I wanted to check whether there is any better option. – rethna2 Jul 19 '19 at 04:18
  • Well, you could use [data channels](https://developer.mozilla.org/en-US/docs/Web/API/RTCDataChannel) instead of your signaling channel, but same concept. – jib Jul 19 '19 at 23:44
  • If somebody "joins in late" you can probably try to send to them the same metadata that you previously stored somewhere. – bertonc96 Jun 23 '22 at 10:15

0 Answers0