RTCStatsReport: get() method

Baseline Widely available

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

The get() method of the RTCStatsReport interface returns a specified element from an RTCStatsReport.

Elements in the RTCStatsReport are identified by unique id values, which represent the monitored statistics objects from which the statistics are derived. The element returned will be an instance of one of the statistics dictionary objects, and it will contain statistics for the object with the given id. The fetched value is a reference to the statistics dictionary, and any change made to that object will effectively modify it inside the RTCStatsReport object.

The method is otherwise the same as Map.prototype.get().

Syntax

js
get(id)

Parameters

id

A string indicating the ID of the element to return from the RTCStatsReport object. IDs are unique strings that identify the monitored object from which the corresponding statistics are derived.

Return value

The element associated with the specified id key, or undefined if the key can't be found in the Map object.

Specifications

Specification
WebRTC: Real-Time Communication in Browsers
# dom-rtcstatsreport

Browser compatibility

Report problems with this compatibility data on GitHub
desktopmobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
get

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support

See also