此页面由社区从英文翻译而来。了解更多并加入 MDN Web Docs 社区。

View in English Always switch to English

RTCPeerConnectionStats:id 属性

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since 2023年5月.

RTCPeerConnectionStats 字典的 id 属性是唯一标识该对象提供统计信息的对象的字符串。

通过使用 id,你可以将此统计对象与其他统计对象关联起来,从而监测指定 WebRTC 对象(例如 RTCPeerConnectionRTCDataChannel)在一段时间内的统计数据。

唯一标识该 RTCPeerConnectionStats 对象将提供统计信息的对象的字符串。

ID 字符串的格式并未由规范定义,因此你无法可靠地对字符串内容做出任何假设,也无法假设给定对象类型的字符串格式将保持不变。

规范

Specification
Identifiers for WebRTC's Statistics API
# dom-rtcstats-id

浏览器兼容性