Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

zh-cn(update): remove page from rtc.icegatheringstate #10506

Merged
merged 2 commits into from
Dec 6, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 15 additions & 16 deletions files/zh-cn/web/api/rtcpeerconnection/icegatheringstate/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,28 @@ title: RTCPeerConnection.iceGatheringState
slug: Web/API/RTCPeerConnection/iceGatheringState
---

{{APIRef("WebRTC")}}{{SeeCompatTable}}
{{APIRef("WebRTC")}}

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

通过监听 [`icegatheringstatechange`](/zh-CN/docs/Web/API/RTCPeerConnection/icegatheringstatechange_event) 类型的事件,你可以侦测到该属性的变化。
通过监听 {{DOMxRef("RTCPeerConnection/icegatheringstatechange_event", "icegatheringstatechange")}} 类型的事件,你可以侦测到该属性的变化。

## 语法
##

```plain
var state = RTCPeerConnection.iceGatheringState;
```

### 值

可能的值是枚举类型 `RTCIceGatheringState` 的所有值。
可能的值是:

{{page("/en-US/docs/Web/API/RTCPeerConnection", "RTCIceGatheringState enum", 0, 1)}}
- `new`
- : 对等连接刚刚创建,尚未进行任何网络连接。
- `gathering`
- : ICE 代理正在收集候选的连接。
- `complete`
- : ICE 代理完成了候选的收集。如果发生了需要收集的新候选,例如一个新接口的增加或者一个新的 ICE 服务器的增加,状态将恢复到 `gathering`,并去收集这些候选。

## 示例

```plain
var pc = new RTCPeerConnection();
var state = pc.iceGatheringState;
```js
const pc = new RTCPeerConnection();
const state = pc.iceGatheringState;
```

## 规范
Expand All @@ -39,4 +38,4 @@ var state = pc.iceGatheringState;
## 参见

- {{DOMxRef("RTCPeerConnection/icegatheringstatechange_event", "icegatheringstatechange")}}
- [WebRTC](/zh-CN/docs/Web/Guide/API/WebRTC)
- [WebRTC](/zh-CN/docs/Web/API/WebRTC_API)