RTCPeerConnection: thuộc tính iceGatheringState

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since September 2017.

Thuộc tính chỉ đọc iceGatheringState của giao diện RTCPeerConnection trả về một chuỗi mô tả trạng thái thu thập ICE của kết nối. Điều này cho phép bạn phát hiện, chẳng hạn, khi quá trình thu thập ICE candidate đã hoàn tất. Các giá trị có thể là: new, gathering hoặc complete.

Giá trị

new

Bộ máy ICE đang bắt đầu, nhưng chưa thu thập candidate nào.

gathering

Bộ máy ICE đang thu thập candidate.

complete

Bộ máy ICE đã thu thập xong tất cả candidate có thể.

Ví dụ

js
const peerConnection = new RTCPeerConnection(configuration);

const iceGatheringState = peerConnection.iceGatheringState;

Thông số kỹ thuật

Specification
WebRTC: Real-Time Communication in Browsers
# dom-peerconnection-ice-gathering-state

Tương thích trình duyệt