简体   繁体   English

对等体之间的 Webrtc ICE 候选交换

[英]Webrtc ICE candidate exchange between peer

I have few doubt about webrtc peer to peer implementation.我对 webrtc 点对点实现几乎没有怀疑。

  1. Is it necessary to exchange ice candidate between peer.是否有必要在对等方之间交换冰候选者。

When I check sample code I found that当我检查示例代码时,我发现

// send any ice candidates to the other peer
pc.onicecandidate = ({candidate}) => signaling.send({candidate});

........................
........................
signaling.onmessage =...........
......................
if (candidate) {
  await pc.addIceCandidate(candidate);
  1. Does the onicecandidate triggered on both peer or in offer peer only ? onicecandidate 是否仅在对等方或在提供对等方触发?

I tested that without exchanging icecandidate the video stream works.我在不交换icecandidate的情况下测试了视频流的工作原理。

Does it create any problem in certain condition.它在某些条件下是否会产生任何问题。

ICE Candidate will help to find the shortest path to the peer. ICE Candidate 将帮助找到到对等方的最短路径。 Also onIceCandidate will trigger on both peer. onIceCandidate 也会在两个对等点上触发。

Note: I tried without sending candidate to other peer that is not works for me.注意:我试过没有将候选人发送给其他对我不起作用的同行。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM