将本地流发送到多个远程对等方

6

我应该如何将本地视频流发送给多个远程端点?我是否需要为每个远程端点实例化一个 PeerConnection?或者同一个 PeerConnection 可以同时用于所有远程端点吗?

1个回答

14
根据在irc.w3.org的 #webrtc 用户dom,每个 PeerConnection 与单个远程对等方相关联。开发者需要负责使用同一个流实例与多个 PeerConnections 进行共享:
<Cow_woC> Can a single PeerConnection connect to multiple remote peers, or only a single one at a time? If I want to stream the same video to multiple remote peers, what am I supposed to do?
<dom> Cow_woC, you need to manage several PeerConnection objects
<dom> and plug your video stream to each of them
<Cow_woC> dom: How do I share the camera feed with multiple PeerConnections? Is getUserMedia() allowed to return the same resource (and share it) multiple times?
<Cow_woC> dom: Or am I responsible for keeping the reference around and passing it to multiple PeerConnections?
<dom> the latter

非常有帮助!谢谢。 - gunjot singh

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接