Temasys / AdapterJS

AdapterJS Javascript Polyfill and Tools for WebRTC - Skylink WebRTC
http://skylink.io/web
Other
428 stars 100 forks source link

Different streams with equal stream.id #279

Closed zdila closed 7 years ago

zdila commented 7 years ago

If we use Janus Gateway and multiple peerConnections then every remote stream has same id janus and so we can't show two different remote videos.

zdila commented 7 years ago

Following SDP munging seems to help:

        const id = Math.random().toString().slice(2);
        sdp = sdp
          .replace(/\bmslabel:janus\b/g, `mslabel:${id}`)
          .replace(/\bmsid:janus\b/g, `mid:${id}`)
          .replace(/\bWMS janus\b/g, `WMS ${id}`);
johache commented 7 years ago

The plugin does rely on stream ids to know what to render. This is a know limitation. Munging the SDP is indeed a solution.