I want to send two video streams from Peer1 to Peer2 using WebRTC: let's use front and rear camera as an example.
Conceptually, how does Peer2 know which stream comes from which camera?
MediaStream documentation mentions that all MediaStream and MediaStreamTrack fields are read-only, so I can't attach any information directly to them. I cannot send a dictionary like {"stream1 id": "camera", "stream2 id": "screenshare"} over a signalling channel, because Peer2 will generate its own id for each stream and track.
https://datatracker.ietf.org/doc/html/draft-ietf-mmusic-msid-11
So it seems that this cannot be done until custom
msidis supported by browsers.