aboutsummaryrefslogtreecommitdiff
path: root/files/zh-cn/web/api/rtcpeerconnection/icegatheringstate/index.html
blob: 844c6d70e26c9c41e283850b3e4e3f982b14ae32 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
---
title: RTCPeerConnection.iceGatheringState
slug: Web/API/RTCPeerConnection/iceGatheringState
translation_of: Web/API/RTCPeerConnection/iceGatheringState
---
<p>{{APIRef("WebRTC")}}{{SeeCompatTable}}</p>

<p>只读属性 <code><strong>RTCPeerConnection.iceGatheringState</strong></code> 返回一个描述连接的ICE收集状态的枚举值 <code>RTCIceGatheringState</code>。比如当ICE候选收集完成的时候,你可以通过该属性的变化侦测到。</p>

<p>通过监听 <code><a href="/en-US/docs/Web/API/RTCPeerConnection/icegatheringstatechange_event">icegatheringstatechange</a></code> 类型的事件,你可以侦测到该属性的变化。</p>

<h2 id="语法">语法</h2>

<pre class="syntaxbox"> var state = <em>RTCPeerConnection</em>.iceGatheringState;</pre>

<h3 id="值"></h3>

<p>可能的值是枚举类型 <code>RTCIceGatheringState</code> 的所有值。</p>

<p>{{page("/en-US/docs/Web/API/RTCPeerConnection", "RTCIceGatheringState enum", 0, 1)}}</p>

<h2 id="例子">例子</h2>

<pre>var pc = new RTCPeerConnection();
var state = pc.iceGatheringState;</pre>

<h2 id="Specifications" name="Specifications">规格说明书</h2>

<table class="standard-table" style="height: 49px; width: 1000px;">
 <thead>
  <tr>
   <th scope="col">规格</th>
   <th scope="col">状态</th>
   <th scope="col">说明</th>
  </tr>
 </thead>
 <tbody>
  <tr>
   <td>{{ SpecName('WebRTC 1.0', '#dom-peerconnection-ice-gathering-state', 'RTCPeerConnection.iceGatheringState') }}</td>
   <td>{{ Spec2('WebRTC 1.0') }}</td>
   <td>Initial specification.</td>
  </tr>
 </tbody>
</table>

<h2 id="浏览器兼容性说明">浏览器兼容性说明</h2>



<p>{{Compat("api.RTCPeerConnection.iceGatheringState")}}</p>

<h2 id="See_also">See also</h2>

<ul>
 <li>{{event("icegatheringstatechange")}}</li>
 <li><a href="/en-US/docs/Web/Guide/API/WebRTC">WebRTC</a></li>
</ul>