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

View in English Always switch to English

RTCPeerConnectionStats:type 属性

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 字典的 type 属性是一个值为 "peer-connection" 的字符串。

通过遍历调用 RTCPeerConnection.getStats() 所返回的 RTCStatsReport 对象,你可以获得不同的统计信息。这一类型即指示了在特定迭代步骤中通过对象可获得的统计信息集合。它的 "peer-connection" 取值则表示当前步骤中可用的统计信息即为 RTCPeerConnectionStats 中定义的数据。

值为 "peer-connection" 的字符串。

规范

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

浏览器兼容性