【问题标题】:Should I wait for RTCPeerConnection.setRemoteDescription() & RTCPeerConnection.addIceCandidate() Promises to settle?我应该等待 RTCPeerConnection.setRemoteDescription() 和 RTCPeerConnection.addIceCandidate() Promises 解决吗?
【发布时间】:2023-03-19 21:53:01
【问题描述】:
  1. RTCPeerConnection.setRemoteDescription() 返回一个 Promise,一旦连接的 remoteDescription 的值成功更改,该 Promise 就会解析。我是否需要等待这个 Promise 成功解决后再调用 RTCPeerConnection.addIceCandidate()?

  2. 此外,RTCPeerConnection.addIceCandidate() 返回一个 Promise,当 ICE 代理成功地将候选者添加到远程对等点的描述中时,该 Promise 就实现了。在通过RTCPeerConnection.addIceCandidate() 添加下一个可用候选人之前,我应该等待此 Promise 成功解决,还是可以并行添加 IceCandidates?

【问题讨论】:

    标签: webrtc rtcpeerconnection peer-connection


    【解决方案1】:

    这不是必须的,参见操作链in the specification 的描述,确保按顺序执行。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-02-24
      • 2019-01-12
      • 2018-04-01
      • 1970-01-01
      • 1970-01-01
      • 2021-05-10
      • 1970-01-01
      • 2014-04-20
      相关资源
      最近更新 更多