WebRTC - sharing one stream with multiple peers

2019-03-02 10:42发布

问题:

I have three peers:

  • PeerA streams a local media to other peers
  • PeerB accepts the stream and is located on the same machine as PeerA.
  • PeerC accepts the stream and is located on a different machine.

All peers are Chrome latest. The signalling server is functioning - I see all descriptions being sent and received as I'd expect.

The issue I'm encountering is that PeerC's onTrack event is firing and I have access to the same stream (with the same id) that PeerB succesfully handles - but for some reason, the stream never appears in the DOM.

My code is based loosely on this: https://github.com/webrtc/samples/blob/gh-pages/src/content/peerconnection/multiple/js/main.js

What could be causing this?

标签: webrtc