From 4ecce5d9931f0607606eff44abe863c7b00b505d Mon Sep 17 00:00:00 2001 From: x1shi <67677979+x1shi@users.noreply.github.com> Date: Sun, 22 Aug 2021 03:29:59 +0800 Subject: fix links --- .../zh-cn/web/api/webrtc_api/connectivity/index.html | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'files') diff --git a/files/zh-cn/web/api/webrtc_api/connectivity/index.html b/files/zh-cn/web/api/webrtc_api/connectivity/index.html index 647cce7449..7a9950be14 100644 --- a/files/zh-cn/web/api/webrtc_api/connectivity/index.html +++ b/files/zh-cn/web/api/webrtc_api/connectivity/index.html @@ -41,33 +41,33 @@ translation_of: Web/API/WebRTC_API/Connectivity
  1. 呼叫者通过 {{domxref("navigator.mediaDevices.getUserMedia()")}} 捕捉本地媒体。
  2. 呼叫者创建一个RTCPeerConnection 并调用 {{domxref("RTCPeerConnection.addTrack()")}} (注: addStream 已经过时。)
  3. -
  4. 呼叫者调用 ("RTCPeerConnection.createOffer()")来创建一个提议(offer).
  5. -
  6. 呼叫者调用 ("RTCPeerConnection.setLocalDescription()") 将提议(Offer)   设置为本地描述 (即,连接的本地描述).
  7. +
  8. 呼叫者调用 {{domxref("RTCPeerConnection.createOffer()")}} 来创建一个提议(offer).
  9. +
  10. 呼叫者调用 {{domxref("RTCPeerConnection.setLocalDescription()")}} 将提议(Offer) 设置为本地描述 (即,连接的本地描述).
  11. setLocalDescription()之后, 呼叫者请求 STUN 服务创建ice候选(ice candidates)
  12. 呼叫者通过信令服务器将提议(offer)传递至 本次呼叫的预期的接受者.
  13. -
  14. 接受者收到了提议(offer) 并调用 ("RTCPeerConnection.setRemoteDescription()") 将其记录为远程描述 (也就是连接的另一端的描述).
  15. +
  16. 接受者收到了提议(offer) 并调用 {{domxref("RTCPeerConnection.setRemoteDescription()")}} 将其记录为远程描述 (也就是连接的另一端的描述).
  17. 接受者做一些可能需要的步骤结束本次呼叫:捕获本地媒体,然后通过{{domxref("RTCPeerConnection.addTrack()")}}添加到连接中。
  18. -
  19. 接受者通过("RTCPeerConnection.createAnswer()")创建一个应答。
  20. -
  21. 接受者调用 ("RTCPeerConnection.setLocalDescription()") 将应答(answer)   设置为本地描述. 此时,接受者已经获知连接双方的配置了.
  22. +
  23. 接受者通过 {{domxref("RTCPeerConnection.createAnswer()")}} 创建一个应答。
  24. +
  25. 接受者调用 {{domxref("RTCPeerConnection.setLocalDescription()")}} 将应答(answer)   设置为本地描述. 此时,接受者已经获知连接双方的配置了.
  26. 接受者通过信令服务器将应答传递到呼叫者.
  27. 呼叫者接受到应答.
  28. -
  29. 呼叫者调用 ("RTCPeerConnection.setRemoteDescription()") 将应答设定为远程描述. 如此,呼叫者已经获知连接双方的配置了.
  30. +
  31. 呼叫者调用 {{domxref("RTCPeerConnection.setRemoteDescription()")}} 将应答设定为远程描述. 如此,呼叫者已经获知连接双方的配置了.

待定的和当前描述

进一步了解该过程,我们发现localDescription和remoteDescription(返回这两个描述的属性 )并不像外观那样简单。 因为在重新协商期间,提议可能会被拒绝,因为它提出了不兼容的格式,每个端点都有能力提出一种新的格式,但是实际上不会切换到另一个对等体,直到它被其他对等体接受为止。 因此,WebRTC使用待定和当前的描述。

-

当前描述(由 ("RTCPeerConnection.currentLocalDescription") 和 ("RTCPeerConnection.currentRemoteDescription") 属性返回 )表示连接实际使用的描述。 这是双方已经完全同意使用的最新连接。

+

当前描述(由 {{domxref("RTCPeerConnection.currentLocalDescription")}} 和 {{domxref("RTCPeerConnection.currentRemoteDescription")}} 属性返回 )表示连接实际使用的描述。 这是双方已经完全同意使用的最新连接。

-

待定的描述(由 ("RTCPeerConnection.pendingLocalDescription" ) 和 ("RTCPeerConnection.pendingRemoteDescription") 返回 )表示当 分别调用setLocalDescription( )或setRemoteDescription( )。

+

待定的描述(由 {{domxref("RTCPeerConnection.pendingLocalDescription")}} 和 {{domxref("RTCPeerConnection.pendingRemoteDescription")}} 返回 )表示当 分别调用setLocalDescription( )或setRemoteDescription( )。

-

当读取描述( ("RTCPeerConnection.localDescription" ) 和 ("RTCPeerConnection.remoteDescription" )  )返回时,返回的值是pendingLocalDescription / pendingRemoteDescription的值,如果有待处理的描述( 也就是说,待处理描述不为null ); 否则,返回当前描述(currentLocalDescription / currentRemoteDescription )。

+

当读取描述( {{domxref("RTCPeerConnection.localDescription")}} 和 {{domxref("RTCPeerConnection.remoteDescription")}} )返回时,返回的值是pendingLocalDescription / pendingRemoteDescription的值,如果有待处理的描述( 也就是说,待处理描述不为null ); 否则,返回当前描述(currentLocalDescription / currentRemoteDescription )。

通过调用setLocalDescription( )或setRemoteDescription( )更改描述时,将指定的描述设置为待定描述,WebRTC层开始评估是否可以接受。 一旦建议的描述已经达成一致,currentLocalDescription或currentRemoteDescription的值将更改为待处理描述,并且待处理的描述再次设置为null,表示没有待处理的描述。

-

pendingLocalDescription不仅包含正在考虑的提议或答案,而且自从提议或应答以来已经收集到的任何本地ICE候选人都被创建。 类似地,pendingRemoteDescription包括通过调用 ("RTCPeerConnection.addIceCandidate( )" ) 提供的任何远程ICE候选。

+

pendingLocalDescription不仅包含正在考虑的提议或答案,而且自从提议或应答以来已经收集到的任何本地ICE候选人都被创建。 类似地,pendingRemoteDescription包括通过调用 {{domxref("RTCPeerConnection.addIceCandidate()")}} 提供的任何远程ICE候选。

有关这些属性和方法的更多细节,请参阅各个文章。

-- cgit v1.2.3-54-g00ecf