Draft
This page is not complete.
The RTCStatsReport
dictionary is contains statistics data about WebRTC connections as returned by the RTCPeerConnection.getStats()
, RTCRtpReceiver.getStats()
, and RTCRtpSender.getStats()
methods. This object consists of a mapping of strings which identify a category of statistics to objects which contains the various measured values for each.
Calling getStats()
on an RTCPeerConnection
lets you specifiy whether you wish to obtain statistics for outbound, inbound, or all streams on the connection. The RTCRtpReceiver
and RTCRtpSender
versions of getStats()
specifically only return the incoming and outgoing streams, respectively.
The RTCStats subdictionaries
The full RTCStatsReport
interface is made up of a mapping of strings to subdictionaries which contain the statistics for each category, such as ICE candidate or media stream statistics. Each of these subdictionaries has in common the following values:
timestamp
- A
DOMHighResTimeStamp
object which indicates the time at which the data was handled by the local WebRTC layer; for example, for statistics related to received RCTP packets, this would indicate the time at which the data was received by the local endpoint (the remote timestamp is available as well in one of the fields defined within one of the other subdictionaries. The time is specified relative to the UNIX epoch (the first moment of January 1, 1970, UTC). type
- A string, taken from the enum type
RTCStatsType
, id
- A
DOMString
which uniquely identifies the object which was inspected to produce this object based onRTCStats
. This allows any twoRTCStats
-based objects which were produced from the same data to be correlated to one another. The format of this ID is not defined by the specification, so it cannot be relied upon to have any particular format, structure, or meaning beyond that.
From a definition standpoint, these values are defined in the RTCStats
dictionary in RTCStatsReport
's WebIDL file.
Using RTCStatsReport
Specifications
Specification | Status | Comment |
---|---|---|
WebRTC 1.0: Real-time Communication Between Browsers The definition of 'RTCStatsReport' in that specification. |
Candidate Recommendation | Initial specification. |
Browser compatibility
Desktop | Mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
RTCStatsReport | Chrome No support No | Edge ? | Firefox No support No | IE No support No | Opera No support No | Safari No support No | WebView Android No support No | Chrome Android No support No | Firefox Android No support No | Opera Android No support No | Safari iOS No support No | Samsung Internet Android No support No |
Legend
- No support
- No support
- Compatibility unknown
- Compatibility unknown