diff options
author | MDN <actions@users.noreply.github.com> | 2022-03-17 00:12:44 +0000 |
---|---|---|
committer | MDN <actions@users.noreply.github.com> | 2022-03-17 00:12:45 +0000 |
commit | 4f4d511f3a78d7e3dc357e44481cf0a7eba99b9f (patch) | |
tree | 28270b34d9322e7f596cb231ff2b686caa651d4b /files/zh-cn/web/api | |
parent | 59bf61868acae62ff8d28f32f7c74008997646d5 (diff) | |
download | translated-content-4f4d511f3a78d7e3dc357e44481cf0a7eba99b9f.tar.gz translated-content-4f4d511f3a78d7e3dc357e44481cf0a7eba99b9f.tar.bz2 translated-content-4f4d511f3a78d7e3dc357e44481cf0a7eba99b9f.zip |
[CRON] sync translated content
Diffstat (limited to 'files/zh-cn/web/api')
-rw-r--r-- | files/zh-cn/web/api/rtcpeerconnection/addstream_event/index.html (renamed from files/zh-cn/web/api/rtcpeerconnection/onaddstream/index.html) | 3 | ||||
-rw-r--r-- | files/zh-cn/web/api/rtcpeerconnection/datachannel_event/index.html (renamed from files/zh-cn/web/api/rtcpeerconnection/ondatachannel/index.html) | 3 | ||||
-rw-r--r-- | files/zh-cn/web/api/rtcpeerconnection/onicecandidate/index.html | 65 | ||||
-rw-r--r-- | files/zh-cn/web/api/rtcpeerconnection/track_event/index.html (renamed from files/zh-cn/web/api/rtcpeerconnection/ontrack/index.html) | 3 | ||||
-rw-r--r-- | files/zh-cn/web/api/serviceworker/statechange_event/index.html (renamed from files/zh-cn/web/api/serviceworker/onstatechange/index.html) | 3 |
5 files changed, 8 insertions, 69 deletions
diff --git a/files/zh-cn/web/api/rtcpeerconnection/onaddstream/index.html b/files/zh-cn/web/api/rtcpeerconnection/addstream_event/index.html index a61e2f28c6..25483657c8 100644 --- a/files/zh-cn/web/api/rtcpeerconnection/onaddstream/index.html +++ b/files/zh-cn/web/api/rtcpeerconnection/addstream_event/index.html @@ -1,7 +1,8 @@ --- title: RTCPeerConnection.onaddstream -slug: Web/API/RTCPeerConnection/onaddstream +slug: Web/API/RTCPeerConnection/addstream_event translation_of: Web/API/RTCPeerConnection/onaddstream +original_slug: Web/API/RTCPeerConnection/onaddstream --- <p>{{APIRef("WebRTC")}}{{SeeCompatTable}}</p> diff --git a/files/zh-cn/web/api/rtcpeerconnection/ondatachannel/index.html b/files/zh-cn/web/api/rtcpeerconnection/datachannel_event/index.html index 73b9b136ed..921f9a0449 100644 --- a/files/zh-cn/web/api/rtcpeerconnection/ondatachannel/index.html +++ b/files/zh-cn/web/api/rtcpeerconnection/datachannel_event/index.html @@ -1,7 +1,8 @@ --- title: RTCPeerConnection.ondatachannel -slug: Web/API/RTCPeerConnection/ondatachannel +slug: Web/API/RTCPeerConnection/datachannel_event translation_of: Web/API/RTCPeerConnection/ondatachannel +original_slug: Web/API/RTCPeerConnection/ondatachannel --- <p>{{APIRef("WebRTC")}}{{SeeCompatTable}}</p> diff --git a/files/zh-cn/web/api/rtcpeerconnection/onicecandidate/index.html b/files/zh-cn/web/api/rtcpeerconnection/onicecandidate/index.html deleted file mode 100644 index a0efcfed3a..0000000000 --- a/files/zh-cn/web/api/rtcpeerconnection/onicecandidate/index.html +++ /dev/null @@ -1,65 +0,0 @@ ---- -title: RTCPeerConnection.onicecandidate -slug: Web/API/RTCPeerConnection/onicecandidate -translation_of: Web/API/RTCPeerConnection/onicecandidate ---- -<p>{{APIRef("WebRTC")}}</p> - -<p><span class="seoSummary"> <code>RTCPeerConnection</code> 的属性 <strong>{{domxref("RTCPeerConnection.onicecandidate", "onicecandidate")}}</strong> (是一个事件触发器 {{event("Event_handlers", "event handler")}}) 能够让函数在事件{{event("icecandidate")}}发生在实例 {{domxref("RTCPeerConnection")}} 上时被调用。 <strong>只要本地代理{{Glossary("ICE")}} 需要通过信令服务器传递信息给其他对等端时就会触发</strong>。</span> 这让本地代理与其他对等体相协商而浏览器本身在使用时无需知道任何详细的有关信令技术的细节,只需要简单地应用这种方法就可使用您选择的任何消息传递技术将ICE候选发送到远程对等方。</p> - -<h2 id="Syntax">Syntax</h2> - -<pre class="syntaxbox"><em>rtcPeerConnection</em>.onicecandidate = <em>eventHandler</em>; -</pre> - -<h3 id="Value">Value</h3> - -<p><font><font>这应该设置为您提供的函数,该函数接受</font></font><a href="https://developer.mozilla.org/en-US/docs/Web/API/RTCPeerConnectionIceEvent" title="RTCPeerConnectionIceEvent接口表示与具有目标的ICE候选相关的事件,通常是RTCPeerConnection。"><code>RTCPeerConnectionIceEvent</code></a><font><font>表示</font></font><code><a href="https://developer.mozilla.org/en-US/docs/Web/Events/icecandidate" title="/en-US/docs/Web/Events/icecandidate">icecandidate</a></code><font><font>事件</font><font>的</font><font>对象</font><font>作为输入</font><font>。</font><font>该功能应该</font><font>通过信令服务器</font><font>将可以在事件</font><font>属性中</font><font>找到</font><font>其</font></font><a href="https://developer.mozilla.org/en-US/docs/Glossary/SDP" title="SDP:SDP(会话描述协议)是描述对等连接的标准。 SDP包含音频和视频的编解码器,源地址和定时信息。"><font><font>SDP</font></font></a><font><font>的ICE候选者传递</font></font><a href="https://developer.mozilla.org/en-US/docs/Web/API/RTCPeerConnectionIceEvent/candidate" title="RTCPeerConnectionIceEvent接口的只读候选属性返回与事件关联的RTCIceCandidate。"><code>candidate</code></a><font><font>给远程对等体。</font></font></p> - -<p><font><font>如果事件的</font></font><code>candidate</code><font><font>属性是</font></font><code>null</code><font><font>,ICE收集已经完成。</font><font>不应将此消息发送到远程对等方。</font><font>发生这种情况时,连接</font></font><a href="https://developer.mozilla.org/en-US/docs/Web/API/RTCPeerConnection/iceGatheringState" title="只读属性RTCPeerConnection.iceGatheringState返回一个类型为RTCIceGatheringState的枚举,用于描述连接的ICE收集状态。 这使您可以检测,例如,ICE候选人的集合何时完成。"><code>iceGatheringState</code></a><font><font>也已更改为</font></font><code>complete</code><font><font>。</font><font>你不需要明确地注意这一点; </font><font>相反,如果你需要感知信令的结束,你应该注意一个</font></font><a href="https://developer.mozilla.org/en-US/docs/Web/API/RTCPeerConnection/icegatheringstatechange_event" title="当ICE候选者收集过程的状态发生变化时,icegatheringstatechange事件将被发送到RTCPeerConnection上的onicegatheringstatechange事件处理程序。"><code>icegatheringstatechange</code></a><font><font>事件,表明ICE协商已经转变为</font></font><code>complete</code><font><font>状态。</font></font></p> - -<h2 id="Example">Example</h2> - -<p><font><font>下面的示例基于文章</font></font><a href="https://developer.mozilla.org/en-US/docs/Web/API/WebRTC_API/Signaling_and_video_calling"><font><font>信令和视频调用中</font></font></a><font><font>的代码,</font><font>为</font></font><code><a href="https://developer.mozilla.org/en-US/docs/Web/Events/icecandidate" title="/en-US/docs/Web/Events/icecandidate">icecandidate</a></code><font><font>事件</font><font>设置处理程序,</font><font>以便将候选项发送到远程对等方。</font></font></p> - -<pre class="brush: js">pc.onicecandidate = function(event) { - if (event.candidate) { - // Send the candidate to the remote peer - } else { - // All ICE candidates have been sent - } -}</pre> - -<p><font><font>请注意,当检测到协议结束时</font></font>{{domxref("RTCPeerConnectionIceEvent.candidate", "candidate")}} 属性为 <code>null</code>.</p> - -<h2 id="Specifications">Specifications</h2> - -<table class="standard-table"> - <thead> - <tr> - <th scope="col">Specification</th> - <th scope="col">Status</th> - <th scope="col">Comment</th> - </tr> - </thead> - <tbody> - <tr> - <td><a href="https://w3c.github.io/webrtc-pc/#widl-RTCPeerConnection-onicecandidate" hreflang="en" lang="en" rel="noopener"><font><font>WebRTC 1.0:浏览器之间的实时通信</font></font><br> - <small lang="en-US"><font><font>该规范中“RTCPeerConnection.onicecandidate”的定义。</font></font></small></a></td> - <td>{{ Spec2('WebRTC 1.0') }}</td> - <td>Initial specification.</td> - </tr> - </tbody> -</table> - -<h2 id="浏览器兼容性"><font><font>浏览器兼容性</font></font></h2> - - - -<p>{{Compat("api.RTCPeerConnection.onicecandidate")}}</p> - -<h2 id="See_also">See also</h2> - -<ul> - <li>The {{event("icecandidate")}} event and its type, {{domxref("RTCPeerConnectionIceEvent")}}.</li> -</ul> diff --git a/files/zh-cn/web/api/rtcpeerconnection/ontrack/index.html b/files/zh-cn/web/api/rtcpeerconnection/track_event/index.html index 84c2b49cfe..0d121a93b6 100644 --- a/files/zh-cn/web/api/rtcpeerconnection/ontrack/index.html +++ b/files/zh-cn/web/api/rtcpeerconnection/track_event/index.html @@ -1,7 +1,8 @@ --- title: RTCPeerConnection.ontrack -slug: Web/API/RTCPeerConnection/ontrack +slug: Web/API/RTCPeerConnection/track_event translation_of: Web/API/RTCPeerConnection/ontrack +original_slug: Web/API/RTCPeerConnection/ontrack --- <p>{{APIRef("WebRTC")}}{{SeeCompatTable}}<code><strong>RTCPeerConnection.ontrack</strong></code> 属性是一个 {{event("Event_handlers", "event handler")}} 此属性指定了在{{domxref("RTCPeerConnection")}}接口上触发 {{event("track")}} 事件时调用的方法。该方法接收一个{{domxref("RTCTrackEvent")}}类型的event对象,该event对象将在{{domxref("MediaStreamTrack")}}被创建时或者是关联到已被添加到接收集合的{{domxref("RTCRtpReceiver")}}对象中时被发送。</p> diff --git a/files/zh-cn/web/api/serviceworker/onstatechange/index.html b/files/zh-cn/web/api/serviceworker/statechange_event/index.html index 94807435b2..c14f156198 100644 --- a/files/zh-cn/web/api/serviceworker/onstatechange/index.html +++ b/files/zh-cn/web/api/serviceworker/statechange_event/index.html @@ -1,7 +1,8 @@ --- title: ServiceWorker.onstatechange -slug: Web/API/ServiceWorker/onstatechange +slug: Web/API/ServiceWorker/statechange_event translation_of: Web/API/ServiceWorker/onstatechange +original_slug: Web/API/ServiceWorker/onstatechange --- <div>{{SeeCompatTable}}{{APIRef("Service Workers API")}}</div> |