@pexip/peer-connection-stats 18.5.1 → 18.5.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/api-docs/README.mdx +83 -0
  3. package/api-docs/enumerations/Quality.mdx +8 -0
  4. package/api-docs/functions/addDeltaStats.mdx +152 -0
  5. package/api-docs/functions/calculateQuality.mdx +13 -0
  6. package/api-docs/functions/createResolver.mdx +26 -0
  7. package/api-docs/functions/createStatsCollector.mdx +17 -0
  8. package/api-docs/functions/createStatsSignals.mdx +26 -0
  9. package/api-docs/functions/getQuality.mdx +19 -0
  10. package/api-docs/functions/inboundAudio.mdx +21 -0
  11. package/api-docs/functions/inboundVideo.mdx +21 -0
  12. package/api-docs/functions/outboundAudio.mdx +21 -0
  13. package/api-docs/functions/outboundVideo.mdx +21 -0
  14. package/api-docs/functions/statsFrom.mdx +17 -0
  15. package/api-docs/functions/statsFromRTCPeer.mdx +27 -0
  16. package/api-docs/interfaces/CacheStats.mdx +9 -0
  17. package/api-docs/interfaces/CandidatePair.mdx +24 -0
  18. package/api-docs/interfaces/Codec.mdx +19 -0
  19. package/api-docs/interfaces/InboundAudio.mdx +25 -0
  20. package/api-docs/interfaces/InboundVideo.mdx +30 -0
  21. package/api-docs/interfaces/MediaSource.mdx +18 -0
  22. package/api-docs/interfaces/Metrics.mdx +22 -0
  23. package/api-docs/interfaces/OutboundAudio.mdx +23 -0
  24. package/api-docs/interfaces/OutboundVideo.mdx +40 -0
  25. package/api-docs/interfaces/RTCStats.mdx +28 -0
  26. package/api-docs/interfaces/Remote.mdx +23 -0
  27. package/api-docs/interfaces/StatsCollector.mdx +6 -0
  28. package/api-docs/interfaces/StatsCollectorOptions.mdx +8 -0
  29. package/api-docs/interfaces/StatsSignals.mdx +7 -0
  30. package/api-docs/interfaces/Stream.mdx +19 -0
  31. package/api-docs/interfaces/Track.mdx +19 -0
  32. package/api-docs/interfaces/Transport.mdx +19 -0
  33. package/api-docs/interfaces/VideoMetrics.mdx +27 -0
  34. package/api-docs/type-aliases/AnyStats.mdx +14 -0
  35. package/api-docs/type-aliases/AudioQualityStats.mdx +3 -0
  36. package/api-docs/type-aliases/CallPacketsStats.mdx +3 -0
  37. package/api-docs/type-aliases/CallQualityStats.mdx +5 -0
  38. package/api-docs/type-aliases/FPSStats.mdx +3 -0
  39. package/api-docs/type-aliases/InboundAudioMetrics.mdx +3 -0
  40. package/api-docs/type-aliases/InboundVideoMetrics.mdx +9 -0
  41. package/api-docs/type-aliases/NormalizedRTCStats.mdx +7 -0
  42. package/api-docs/type-aliases/OutboundAudioMetrics.mdx +3 -0
  43. package/api-docs/type-aliases/OutboundVideoMetrics.mdx +13 -0
  44. package/api-docs/type-aliases/PacketsStats.mdx +3 -0
  45. package/api-docs/type-aliases/VideoQualityStats.mdx +3 -0
  46. package/api-docs/variables/FPS_STATS_SIZE.mdx +3 -0
  47. package/api-docs/variables/STATS_SIZE.mdx +3 -0
  48. package/package.json +16 -9
package/CHANGELOG.md CHANGED
@@ -1,5 +1,16 @@
1
1
  # Changelog
2
2
 
3
+ ## 18.5.3
4
+
5
+ ### Patch Changes
6
+
7
+ - 13e3722: Generate the package documentation in a folder called doc-dist
8
+ - Updated dependencies [13e3722]
9
+ - @pexip/signal@16.9.3
10
+ - @pexip/utils@17.1.3
11
+
12
+ ## 18.5.2
13
+
3
14
  ## 18.5.1
4
15
 
5
16
  ### Patch Changes
@@ -0,0 +1,83 @@
1
+ # `@pexip/peer-connection-stats`
2
+
3
+ Helps with normalization of data from `RTCStats` and friends.
4
+
5
+ ## Install
6
+
7
+ `npm install @pexip/peer-connection-stats`
8
+
9
+ Related documentation:
10
+
11
+ - [https://developer.mozilla.org/en-US/docs/Web/API/WebRTC_Statistics_API](https://developer.mozilla.org/en-US/docs/Web/API/WebRTC_Statistics_API)
12
+ - [https://developer.mozilla.org/en-US/docs/Web/API/RTCStatsReport](https://developer.mozilla.org/en-US/docs/Web/API/RTCStatsReport)
13
+ - [https://developer.mozilla.org/en-US/docs/Web/API/RTCStats](https://developer.mozilla.org/en-US/docs/Web/API/RTCStats)
14
+
15
+ ## Enumerations
16
+
17
+ | Enumeration | Description |
18
+ | ------ | ------ |
19
+ | [Quality](enumerations/Quality.mdx) | - |
20
+
21
+ ## Interfaces
22
+
23
+ | Interface | Description |
24
+ | ------ | ------ |
25
+ | [RTCStats](interfaces/RTCStats.mdx) | - |
26
+ | [Remote](interfaces/Remote.mdx) | - |
27
+ | [CandidatePair](interfaces/CandidatePair.mdx) | - |
28
+ | [Transport](interfaces/Transport.mdx) | - |
29
+ | [Codec](interfaces/Codec.mdx) | - |
30
+ | [InboundAudio](interfaces/InboundAudio.mdx) | - |
31
+ | [OutboundAudio](interfaces/OutboundAudio.mdx) | - |
32
+ | [InboundVideo](interfaces/InboundVideo.mdx) | - |
33
+ | [OutboundVideo](interfaces/OutboundVideo.mdx) | - |
34
+ | [MediaSource](interfaces/MediaSource.mdx) | - |
35
+ | [Track](interfaces/Track.mdx) | - |
36
+ | [Stream](interfaces/Stream.mdx) | - |
37
+ | [Metrics](interfaces/Metrics.mdx) | - |
38
+ | [VideoMetrics](interfaces/VideoMetrics.mdx) | - |
39
+ | [CacheStats](interfaces/CacheStats.mdx) | - |
40
+ | [StatsSignals](interfaces/StatsSignals.mdx) | - |
41
+ | [StatsCollectorOptions](interfaces/StatsCollectorOptions.mdx) | - |
42
+ | [StatsCollector](interfaces/StatsCollector.mdx) | - |
43
+
44
+ ## Type Aliases
45
+
46
+ | Type Alias | Description |
47
+ | ------ | ------ |
48
+ | [AnyStats](type-aliases/AnyStats.mdx) | - |
49
+ | [InboundAudioMetrics](type-aliases/InboundAudioMetrics.mdx) | - |
50
+ | [InboundVideoMetrics](type-aliases/InboundVideoMetrics.mdx) | - |
51
+ | [OutboundAudioMetrics](type-aliases/OutboundAudioMetrics.mdx) | - |
52
+ | [OutboundVideoMetrics](type-aliases/OutboundVideoMetrics.mdx) | - |
53
+ | [NormalizedRTCStats](type-aliases/NormalizedRTCStats.mdx) | - |
54
+ | [PacketsStats](type-aliases/PacketsStats.mdx) | - |
55
+ | [AudioQualityStats](type-aliases/AudioQualityStats.mdx) | - |
56
+ | [VideoQualityStats](type-aliases/VideoQualityStats.mdx) | - |
57
+ | [FPSStats](type-aliases/FPSStats.mdx) | - |
58
+ | [CallQualityStats](type-aliases/CallQualityStats.mdx) | - |
59
+ | [CallPacketsStats](type-aliases/CallPacketsStats.mdx) | - |
60
+
61
+ ## Variables
62
+
63
+ | Variable | Description |
64
+ | ------ | ------ |
65
+ | [STATS\_SIZE](variables/STATS_SIZE.mdx) | - |
66
+ | [FPS\_STATS\_SIZE](variables/FPS_STATS_SIZE.mdx) | - |
67
+
68
+ ## Functions
69
+
70
+ | Function | Description |
71
+ | ------ | ------ |
72
+ | [createResolver](functions/createResolver.mdx) | The WebRTC stats are given to us as a flat structure (an array of objects that contain id-fields pointing to other objects in the same array). |
73
+ | [inboundAudio](functions/inboundAudio.mdx) | Normalize inbound audio stats |
74
+ | [outboundAudio](functions/outboundAudio.mdx) | Normalize outbound audio stats |
75
+ | [inboundVideo](functions/inboundVideo.mdx) | Normalize inbound video stats |
76
+ | [outboundVideo](functions/outboundVideo.mdx) | Normalize outbound video stats |
77
+ | [statsFrom](functions/statsFrom.mdx) | Normalize stats into inbound and outbound video and audio stats |
78
+ | [statsFromRTCPeer](functions/statsFromRTCPeer.mdx) | Gets raw stats from peerConnection and normalized them |
79
+ | [getQuality](functions/getQuality.mdx) | - |
80
+ | [addDeltaStats](functions/addDeltaStats.mdx) | - |
81
+ | [calculateQuality](functions/calculateQuality.mdx) | - |
82
+ | [createStatsCollector](functions/createStatsCollector.mdx) | Creates stats collector |
83
+ | [createStatsSignals](functions/createStatsSignals.mdx) | Create and return all required and optional (if specified with `more`), signals for infinity client to work |
@@ -0,0 +1,8 @@
1
+ ## Enumeration Members
2
+
3
+ | Enumeration Member | Value |
4
+ | ------ | ------ |
5
+ | <a id="good"></a> `GOOD` | `0` |
6
+ | <a id="ok"></a> `OK` | `1` |
7
+ | <a id="bad"></a> `BAD` | `2` |
8
+ | <a id="terrible"></a> `TERRIBLE` | `3` |
@@ -0,0 +1,152 @@
1
+ ```ts
2
+ function addDeltaStats(newStats, cache): readonly [
3
+ | {
4
+ type: "inbound-rtp" | "outbound-rtp";
5
+ kind: "audio" | "video";
6
+ bitrate?: number;
7
+ bytesTransmitted?: number;
8
+ codec?: string;
9
+ jitter?: number;
10
+ packetsLost: number;
11
+ packetsTransmitted: number;
12
+ recentPercentageLost?: number;
13
+ roundTripTime?: number;
14
+ timestamp?: number;
15
+ totalPercentageLost?: number;
16
+ timeToCaptureStats?: number;
17
+ quality?: Quality;
18
+ }
19
+ | {
20
+ type: "inbound-rtp" | "outbound-rtp";
21
+ kind: "audio" | "video";
22
+ bitrate?: number;
23
+ bytesTransmitted?: number;
24
+ codec?: string;
25
+ jitter?: number;
26
+ packetsLost: number;
27
+ packetsTransmitted: number;
28
+ recentPercentageLost?: number;
29
+ roundTripTime?: number;
30
+ timestamp?: number;
31
+ totalPercentageLost?: number;
32
+ timeToCaptureStats?: number;
33
+ quality?: Quality;
34
+ framesPerSecond?: number;
35
+ resolution?: string;
36
+ resolutionHeight?: number;
37
+ resolutionWidth?: number;
38
+ fpsVolatility?: number;
39
+ averageDecodeTime?: number;
40
+ }
41
+ | {
42
+ type: "inbound-rtp" | "outbound-rtp";
43
+ kind: "audio" | "video";
44
+ bitrate?: number;
45
+ bytesTransmitted?: number;
46
+ codec?: string;
47
+ jitter?: number;
48
+ packetsLost: number;
49
+ packetsTransmitted: number;
50
+ recentPercentageLost?: number;
51
+ roundTripTime?: number;
52
+ timestamp?: number;
53
+ totalPercentageLost?: number;
54
+ timeToCaptureStats?: number;
55
+ quality?: Quality;
56
+ framesPerSecond?: number;
57
+ resolution?: string;
58
+ resolutionHeight?: number;
59
+ resolutionWidth?: number;
60
+ fpsVolatility?: number;
61
+ totalPacketSendDelay?: number;
62
+ averagePacketSendDelay?: number;
63
+ averageEncodeTime?: number;
64
+ qualityLimitationReason?: "cpu" | "bandwidth" | "other" | "none";
65
+ qualityLimitationDurations?: {
66
+ cpu?: number;
67
+ bandwidth?: number;
68
+ other?: number;
69
+ none?: number;
70
+ };
71
+ }, Quality, CallQualityStats];
72
+ ```
73
+
74
+ ## Parameters
75
+
76
+ | Parameter | Type |
77
+ | ------ | ------ |
78
+ | `newStats` | [`NormalizedRTCStats`](../type-aliases/NormalizedRTCStats.mdx) |
79
+ | `cache` | [`CacheStats`](../interfaces/CacheStats.mdx) |
80
+
81
+ ## Returns
82
+
83
+ readonly \[
84
+ \| \{
85
+ `type`: `"inbound-rtp"` \| `"outbound-rtp"`;
86
+ `kind`: `"audio"` \| `"video"`;
87
+ `bitrate?`: `number`;
88
+ `bytesTransmitted?`: `number`;
89
+ `codec?`: `string`;
90
+ `jitter?`: `number`;
91
+ `packetsLost`: `number`;
92
+ `packetsTransmitted`: `number`;
93
+ `recentPercentageLost?`: `number`;
94
+ `roundTripTime?`: `number`;
95
+ `timestamp?`: `number`;
96
+ `totalPercentageLost?`: `number`;
97
+ `timeToCaptureStats?`: `number`;
98
+ `quality?`: [`Quality`](../enumerations/Quality.mdx);
99
+ \}
100
+ \| \{
101
+ `type`: `"inbound-rtp"` \| `"outbound-rtp"`;
102
+ `kind`: `"audio"` \| `"video"`;
103
+ `bitrate?`: `number`;
104
+ `bytesTransmitted?`: `number`;
105
+ `codec?`: `string`;
106
+ `jitter?`: `number`;
107
+ `packetsLost`: `number`;
108
+ `packetsTransmitted`: `number`;
109
+ `recentPercentageLost?`: `number`;
110
+ `roundTripTime?`: `number`;
111
+ `timestamp?`: `number`;
112
+ `totalPercentageLost?`: `number`;
113
+ `timeToCaptureStats?`: `number`;
114
+ `quality?`: [`Quality`](../enumerations/Quality.mdx);
115
+ `framesPerSecond?`: `number`;
116
+ `resolution?`: `string`;
117
+ `resolutionHeight?`: `number`;
118
+ `resolutionWidth?`: `number`;
119
+ `fpsVolatility?`: `number`;
120
+ `averageDecodeTime?`: `number`;
121
+ \}
122
+ \| \{
123
+ `type`: `"inbound-rtp"` \| `"outbound-rtp"`;
124
+ `kind`: `"audio"` \| `"video"`;
125
+ `bitrate?`: `number`;
126
+ `bytesTransmitted?`: `number`;
127
+ `codec?`: `string`;
128
+ `jitter?`: `number`;
129
+ `packetsLost`: `number`;
130
+ `packetsTransmitted`: `number`;
131
+ `recentPercentageLost?`: `number`;
132
+ `roundTripTime?`: `number`;
133
+ `timestamp?`: `number`;
134
+ `totalPercentageLost?`: `number`;
135
+ `timeToCaptureStats?`: `number`;
136
+ `quality?`: [`Quality`](../enumerations/Quality.mdx);
137
+ `framesPerSecond?`: `number`;
138
+ `resolution?`: `string`;
139
+ `resolutionHeight?`: `number`;
140
+ `resolutionWidth?`: `number`;
141
+ `fpsVolatility?`: `number`;
142
+ `totalPacketSendDelay?`: `number`;
143
+ `averagePacketSendDelay?`: `number`;
144
+ `averageEncodeTime?`: `number`;
145
+ `qualityLimitationReason?`: `"cpu"` \| `"bandwidth"` \| `"other"` \| `"none"`;
146
+ `qualityLimitationDurations?`: \{
147
+ `cpu?`: `number`;
148
+ `bandwidth?`: `number`;
149
+ `other?`: `number`;
150
+ `none?`: `number`;
151
+ \};
152
+ \}, [`Quality`](../enumerations/Quality.mdx), [`CallQualityStats`](../type-aliases/CallQualityStats.mdx)\]
@@ -0,0 +1,13 @@
1
+ ```ts
2
+ function calculateQuality(stats): Quality;
3
+ ```
4
+
5
+ ## Parameters
6
+
7
+ | Parameter | Type |
8
+ | ------ | ------ |
9
+ | `stats` | `number` \| \[`number`, `number`\] |
10
+
11
+ ## Returns
12
+
13
+ [`Quality`](../enumerations/Quality.mdx)
@@ -0,0 +1,26 @@
1
+ ```ts
2
+ function createResolver(statsReport): object;
3
+ ```
4
+
5
+ The WebRTC stats are given to us as a flat structure (an array of objects
6
+ that contain id-fields pointing to other objects in the same array).
7
+
8
+ This class takes such an array as input and can expand an entry so that
9
+ references become nested objects.
10
+
11
+ https://www.w3.org/TR/webrtc-stats/#summary
12
+ https://www.w3.org/TR/webrtc-stats/#rtctatstype-*
13
+
14
+ ## Parameters
15
+
16
+ | Parameter | Type |
17
+ | ------ | ------ |
18
+ | `statsReport` | [`AnyStats`](../type-aliases/AnyStats.mdx)[] |
19
+
20
+ ## Returns
21
+
22
+ `object`
23
+
24
+ | Name | Type |
25
+ | ------ | ------ |
26
+ | `expand()` | \{ (`audioIn`): [`InboundAudio`](../interfaces/InboundAudio.mdx); (`audioOut`): [`OutboundAudio`](../interfaces/OutboundAudio.mdx); (`videoIn`): [`InboundVideo`](../interfaces/InboundVideo.mdx); (`videoOut`): [`OutboundVideo`](../interfaces/OutboundVideo.mdx); \} |
@@ -0,0 +1,17 @@
1
+ ```ts
2
+ function createStatsCollector(input): StatsCollector;
3
+ ```
4
+
5
+ Creates stats collector
6
+
7
+ ## Parameters
8
+
9
+ | Parameter | Type | Description |
10
+ | ------ | ------ | ------ |
11
+ | `input` | [`StatsCollectorOptions`](../interfaces/StatsCollectorOptions.mdx) | input to get stats from |
12
+
13
+ ## Returns
14
+
15
+ [`StatsCollector`](../interfaces/StatsCollector.mdx)
16
+
17
+ function to reset stats window, cleanup func
@@ -0,0 +1,26 @@
1
+ ```ts
2
+ function createStatsSignals(scope): StatsSignals;
3
+ ```
4
+
5
+ Create and return all required and optional (if specified with `more`),
6
+ signals for infinity client to work
7
+
8
+ ## Parameters
9
+
10
+ | Parameter | Type | Default value | Description |
11
+ | ------ | ------ | ------ | ------ |
12
+ | `scope` | `string` | `''` | any scope prefix for the generated signal name, |
13
+
14
+ ## Returns
15
+
16
+ [`StatsSignals`](../interfaces/StatsSignals.mdx)
17
+
18
+ ## See
19
+
20
+ - Signal
21
+ - InfinitySignalsOptional
22
+
23
+ The following signals created by default
24
+ - 'onConnected',
25
+ - 'onAnswer',
26
+ - REQUIRED_STATS_SIGNAL_KEYS
@@ -0,0 +1,19 @@
1
+ ```ts
2
+ function getQuality(stats): object;
3
+ ```
4
+
5
+ ## Parameters
6
+
7
+ | Parameter | Type |
8
+ | ------ | ------ |
9
+ | `stats` | [`CallQualityStats`](../type-aliases/CallQualityStats.mdx) |
10
+
11
+ ## Returns
12
+
13
+ `object`
14
+
15
+ | Name | Type |
16
+ | ------ | ------ |
17
+ | `quality` | [`Quality`](../enumerations/Quality.mdx) |
18
+ | `goodOrOkQuality` | `number` |
19
+ | `qualityOverTime` | [`Quality`](../enumerations/Quality.mdx)[] |
@@ -0,0 +1,21 @@
1
+ ```ts
2
+ function inboundAudio(statsData): Metrics;
3
+ ```
4
+
5
+ Normalize inbound audio stats
6
+
7
+ ## Parameters
8
+
9
+ | Parameter | Type | Description |
10
+ | ------ | ------ | ------ |
11
+ | `statsData` | [`InboundAudio`](../interfaces/InboundAudio.mdx) | Raw inbound audio stats |
12
+
13
+ ## Returns
14
+
15
+ [`Metrics`](../interfaces/Metrics.mdx)
16
+
17
+ normalized stats for inbound audio from PeerConnection
18
+
19
+ ## See
20
+
21
+ InboundAudio
@@ -0,0 +1,21 @@
1
+ ```ts
2
+ function inboundVideo(statsData): InboundVideoMetrics;
3
+ ```
4
+
5
+ Normalize inbound video stats
6
+
7
+ ## Parameters
8
+
9
+ | Parameter | Type | Description |
10
+ | ------ | ------ | ------ |
11
+ | `statsData` | [`InboundVideo`](../interfaces/InboundVideo.mdx) | Raw inbound video stats |
12
+
13
+ ## Returns
14
+
15
+ [`InboundVideoMetrics`](../type-aliases/InboundVideoMetrics.mdx)
16
+
17
+ normalized stats for inbound video from PeerConnection
18
+
19
+ ## See
20
+
21
+ InboundVideo
@@ -0,0 +1,21 @@
1
+ ```ts
2
+ function outboundAudio(statsData): Metrics;
3
+ ```
4
+
5
+ Normalize outbound audio stats
6
+
7
+ ## Parameters
8
+
9
+ | Parameter | Type | Description |
10
+ | ------ | ------ | ------ |
11
+ | `statsData` | [`OutboundAudio`](../interfaces/OutboundAudio.mdx) | Raw outbound audio stats |
12
+
13
+ ## Returns
14
+
15
+ [`Metrics`](../interfaces/Metrics.mdx)
16
+
17
+ normalized stats for outbound audio from PeerConnection
18
+
19
+ ## See
20
+
21
+ OutboundAudio
@@ -0,0 +1,21 @@
1
+ ```ts
2
+ function outboundVideo(statsData): OutboundVideoMetrics;
3
+ ```
4
+
5
+ Normalize outbound video stats
6
+
7
+ ## Parameters
8
+
9
+ | Parameter | Type | Description |
10
+ | ------ | ------ | ------ |
11
+ | `statsData` | [`OutboundVideo`](../interfaces/OutboundVideo.mdx) | Raw outbound video stats |
12
+
13
+ ## Returns
14
+
15
+ [`OutboundVideoMetrics`](../type-aliases/OutboundVideoMetrics.mdx)
16
+
17
+ normalized stats for outbound video from PeerConnection
18
+
19
+ ## See
20
+
21
+ OutboundVideo
@@ -0,0 +1,17 @@
1
+ ```ts
2
+ function statsFrom(statsReports): Metrics | undefined;
3
+ ```
4
+
5
+ Normalize stats into inbound and outbound video and audio stats
6
+
7
+ ## Parameters
8
+
9
+ | Parameter | Type | Description |
10
+ | ------ | ------ | ------ |
11
+ | `statsReports` | [`AnyStats`](../type-aliases/AnyStats.mdx)[] | reports to for mapping |
12
+
13
+ ## Returns
14
+
15
+ [`Metrics`](../interfaces/Metrics.mdx) \| `undefined`
16
+
17
+ normalized stats for inbound, outbound audio and video
@@ -0,0 +1,27 @@
1
+ ```ts
2
+ function statsFromRTCPeer(rtcPeer): Promise<NormalizedRTCStats>;
3
+ ```
4
+
5
+ Gets raw stats from peerConnection and normalized them
6
+
7
+ https://developer.mozilla.org/en-US/docs/Web/API/WebRTC_Statistics_API
8
+
9
+ A RTCPeerConnection has getStats()
10
+ - getStats() returns promise which resolve to a RTCStatsReport
11
+ - RTCStatsReport behaves like an array of RTCStats objects, or more
12
+ specific RTCRtpStreamStats objects
13
+
14
+ https://developer.mozilla.org/en-US/docs/Web/API/RTCStatsReport
15
+ https://developer.mozilla.org/en-US/docs/Web/API/RTCStats
16
+ https://developer.mozilla.org/en-US/docs/Web/API/RTCRtpStreamStats
17
+
18
+ ## Parameters
19
+
20
+ | Parameter | Type |
21
+ | ------ | ------ |
22
+ | `rtcPeer` | \{ `getStats`: (`selector?`) => `Promise`\<`RTCStatsReport`\>; \} |
23
+ | `rtcPeer.getStats` | (`selector?`) => `Promise`\<`RTCStatsReport`\> |
24
+
25
+ ## Returns
26
+
27
+ `Promise`\<[`NormalizedRTCStats`](../type-aliases/NormalizedRTCStats.mdx)\>
@@ -0,0 +1,9 @@
1
+ ## Properties
2
+
3
+ | Property | Type |
4
+ | ------ | ------ |
5
+ | <a id="previous"></a> `previous?` | [`NormalizedRTCStats`](../type-aliases/NormalizedRTCStats.mdx) |
6
+ | <a id="callpacketsstats"></a> `callPacketsStats` | [`PacketsStats`](../type-aliases/PacketsStats.mdx) |
7
+ | <a id="callquality"></a> `callQuality` | [`Quality`](../enumerations/Quality.mdx) |
8
+ | <a id="callqualitystats"></a> `callQualityStats` | [`CallQualityStats`](../type-aliases/CallQualityStats.mdx) |
9
+ | <a id="fpsstats"></a> `fpsStats` | [`FPSStats`](../type-aliases/FPSStats.mdx) |
@@ -0,0 +1,24 @@
1
+ ## Extends
2
+
3
+ - [`RTCStats`](RTCStats.mdx)
4
+
5
+ ## Indexable
6
+
7
+ ```ts
8
+ [key: string]: unknown
9
+ ```
10
+
11
+ ## Properties
12
+
13
+ | Property | Type | Overrides | Inherited from |
14
+ | ------ | ------ | ------ | ------ |
15
+ | <a id="id"></a> `id` | `string` | - | [`RTCStats`](RTCStats.mdx).[`id`](RTCStats.mdx#id) |
16
+ | <a id="kind"></a> `kind?` | `"audio"` \| `"video"` | - | [`RTCStats`](RTCStats.mdx).[`kind`](RTCStats.mdx#kind) |
17
+ | <a id="timestamp"></a> `timestamp?` | `number` | - | [`RTCStats`](RTCStats.mdx).[`timestamp`](RTCStats.mdx#timestamp) |
18
+ | <a id="type"></a> `type` | `"candidate-pair"` | [`RTCStats`](RTCStats.mdx).[`type`](RTCStats.mdx#type) | - |
19
+ | <a id="availableincomingbitrate"></a> `availableIncomingBitrate?` | `number` | - | - |
20
+ | <a id="availableoutgoingbitrate"></a> `availableOutgoingBitrate?` | `number` | - | - |
21
+ | <a id="currentroundtriptime"></a> `currentRoundTripTime?` | `number` | - | - |
22
+ | <a id="transport"></a> `transport?` | [`Transport`](Transport.mdx) | - | - |
23
+ | <a id="localcandidate"></a> `localCandidate?` | `CandidatePair` | - | - |
24
+ | <a id="remotecandidate"></a> `remoteCandidate?` | `CandidatePair` | - | - |
@@ -0,0 +1,19 @@
1
+ ## Extends
2
+
3
+ - [`RTCStats`](RTCStats.mdx)
4
+
5
+ ## Indexable
6
+
7
+ ```ts
8
+ [key: string]: unknown
9
+ ```
10
+
11
+ ## Properties
12
+
13
+ | Property | Type | Overrides | Inherited from |
14
+ | ------ | ------ | ------ | ------ |
15
+ | <a id="id"></a> `id` | `string` | - | [`RTCStats`](RTCStats.mdx).[`id`](RTCStats.mdx#id) |
16
+ | <a id="kind"></a> `kind?` | `"audio"` \| `"video"` | - | [`RTCStats`](RTCStats.mdx).[`kind`](RTCStats.mdx#kind) |
17
+ | <a id="timestamp"></a> `timestamp?` | `number` | - | [`RTCStats`](RTCStats.mdx).[`timestamp`](RTCStats.mdx#timestamp) |
18
+ | <a id="type"></a> `type` | `"codec"` | [`RTCStats`](RTCStats.mdx).[`type`](RTCStats.mdx#type) | - |
19
+ | <a id="mimetype"></a> `mimeType?` | `string` | - | - |
@@ -0,0 +1,25 @@
1
+ ## Extends
2
+
3
+ - [`RTCStats`](RTCStats.mdx)
4
+
5
+ ## Indexable
6
+
7
+ ```ts
8
+ [key: string]: unknown
9
+ ```
10
+
11
+ ## Properties
12
+
13
+ | Property | Type | Overrides | Inherited from |
14
+ | ------ | ------ | ------ | ------ |
15
+ | <a id="id"></a> `id` | `string` | - | [`RTCStats`](RTCStats.mdx).[`id`](RTCStats.mdx#id) |
16
+ | <a id="timestamp"></a> `timestamp?` | `number` | - | [`RTCStats`](RTCStats.mdx).[`timestamp`](RTCStats.mdx#timestamp) |
17
+ | <a id="type"></a> `type` | `"inbound-rtp"` | [`RTCStats`](RTCStats.mdx).[`type`](RTCStats.mdx#type) | - |
18
+ | <a id="kind"></a> `kind` | `"audio"` | [`RTCStats`](RTCStats.mdx).[`kind`](RTCStats.mdx#kind) | - |
19
+ | <a id="jitter"></a> `jitter?` | `number` | - | - |
20
+ | <a id="packetsreceived"></a> `packetsReceived?` | `number` | - | - |
21
+ | <a id="packetslost"></a> `packetsLost?` | `number` | - | - |
22
+ | <a id="bytesreceived"></a> `bytesReceived?` | `number` | - | - |
23
+ | <a id="track"></a> `track?` | [`Track`](Track.mdx) | - | - |
24
+ | <a id="transport"></a> `transport?` | [`Transport`](Transport.mdx) | - | - |
25
+ | <a id="codec"></a> `codec?` | [`Codec`](Codec.mdx) | - | - |
@@ -0,0 +1,30 @@
1
+ ## Extends
2
+
3
+ - [`RTCStats`](RTCStats.mdx)
4
+
5
+ ## Indexable
6
+
7
+ ```ts
8
+ [key: string]: unknown
9
+ ```
10
+
11
+ ## Properties
12
+
13
+ | Property | Type | Overrides | Inherited from |
14
+ | ------ | ------ | ------ | ------ |
15
+ | <a id="id"></a> `id` | `string` | - | [`RTCStats`](RTCStats.mdx).[`id`](RTCStats.mdx#id) |
16
+ | <a id="timestamp"></a> `timestamp?` | `number` | - | [`RTCStats`](RTCStats.mdx).[`timestamp`](RTCStats.mdx#timestamp) |
17
+ | <a id="type"></a> `type` | `"inbound-rtp"` | [`RTCStats`](RTCStats.mdx).[`type`](RTCStats.mdx#type) | - |
18
+ | <a id="kind"></a> `kind` | `"video"` | [`RTCStats`](RTCStats.mdx).[`kind`](RTCStats.mdx#kind) | - |
19
+ | <a id="packetsreceived"></a> `packetsReceived?` | `number` | - | - |
20
+ | <a id="packetslost"></a> `packetsLost?` | `number` | - | - |
21
+ | <a id="bytesreceived"></a> `bytesReceived?` | `number` | - | - |
22
+ | <a id="transport"></a> `transport?` | [`Transport`](Transport.mdx) | - | - |
23
+ | <a id="codec"></a> `codec?` | [`Codec`](Codec.mdx) | - | - |
24
+ | <a id="framewidth"></a> `frameWidth?` | `number` | - | - |
25
+ | <a id="frameheight"></a> `frameHeight?` | `number` | - | - |
26
+ | <a id="framespersecond"></a> `framesPerSecond?` | `number` | - | - |
27
+ | <a id="totaldecodetime"></a> `totalDecodeTime?` | `number` | - | - |
28
+ | <a id="framesdecoded"></a> `framesDecoded?` | `number` | - | - |
29
+ | <a id="bitratemean"></a> `bitrateMean?` | `number` | - | - |
30
+ | <a id="frameratemean"></a> `framerateMean?` | `number` | - | - |
@@ -0,0 +1,18 @@
1
+ ## Extends
2
+
3
+ - [`RTCStats`](RTCStats.mdx)
4
+
5
+ ## Indexable
6
+
7
+ ```ts
8
+ [key: string]: unknown
9
+ ```
10
+
11
+ ## Properties
12
+
13
+ | Property | Type | Overrides | Inherited from |
14
+ | ------ | ------ | ------ | ------ |
15
+ | <a id="id"></a> `id` | `string` | - | [`RTCStats`](RTCStats.mdx).[`id`](RTCStats.mdx#id) |
16
+ | <a id="timestamp"></a> `timestamp?` | `number` | - | [`RTCStats`](RTCStats.mdx).[`timestamp`](RTCStats.mdx#timestamp) |
17
+ | <a id="type"></a> `type` | `"media-source"` | [`RTCStats`](RTCStats.mdx).[`type`](RTCStats.mdx#type) | - |
18
+ | <a id="kind"></a> `kind` | `"audio"` \| `"video"` | [`RTCStats`](RTCStats.mdx).[`kind`](RTCStats.mdx#kind) | - |
@@ -0,0 +1,22 @@
1
+ ## Extended by
2
+
3
+ - [`VideoMetrics`](VideoMetrics.mdx)
4
+
5
+ ## Properties
6
+
7
+ | Property | Type |
8
+ | ------ | ------ |
9
+ | <a id="type"></a> `type` | `"inbound-rtp"` \| `"outbound-rtp"` |
10
+ | <a id="kind"></a> `kind` | `"audio"` \| `"video"` |
11
+ | <a id="bitrate"></a> `bitrate?` | `number` |
12
+ | <a id="bytestransmitted"></a> `bytesTransmitted?` | `number` |
13
+ | <a id="codec"></a> `codec?` | `string` |
14
+ | <a id="jitter"></a> `jitter?` | `number` |
15
+ | <a id="packetslost"></a> `packetsLost` | `number` |
16
+ | <a id="packetstransmitted"></a> `packetsTransmitted` | `number` |
17
+ | <a id="recentpercentagelost"></a> `recentPercentageLost?` | `number` |
18
+ | <a id="roundtriptime"></a> `roundTripTime?` | `number` |
19
+ | <a id="timestamp"></a> `timestamp?` | `number` |
20
+ | <a id="totalpercentagelost"></a> `totalPercentageLost?` | `number` |
21
+ | <a id="timetocapturestats"></a> `timeToCaptureStats?` | `number` |
22
+ | <a id="quality"></a> `quality?` | [`Quality`](../enumerations/Quality.mdx) |
@@ -0,0 +1,23 @@
1
+ ## Extends
2
+
3
+ - [`RTCStats`](RTCStats.mdx)
4
+
5
+ ## Indexable
6
+
7
+ ```ts
8
+ [key: string]: unknown
9
+ ```
10
+
11
+ ## Properties
12
+
13
+ | Property | Type | Overrides | Inherited from |
14
+ | ------ | ------ | ------ | ------ |
15
+ | <a id="id"></a> `id` | `string` | - | [`RTCStats`](RTCStats.mdx).[`id`](RTCStats.mdx#id) |
16
+ | <a id="timestamp"></a> `timestamp?` | `number` | - | [`RTCStats`](RTCStats.mdx).[`timestamp`](RTCStats.mdx#timestamp) |
17
+ | <a id="type"></a> `type` | `"outbound-rtp"` | [`RTCStats`](RTCStats.mdx).[`type`](RTCStats.mdx#type) | - |
18
+ | <a id="kind"></a> `kind` | `"audio"` | [`RTCStats`](RTCStats.mdx).[`kind`](RTCStats.mdx#kind) | - |
19
+ | <a id="packetssent"></a> `packetsSent?` | `number` | - | - |
20
+ | <a id="bytessent"></a> `bytesSent?` | `number` | - | - |
21
+ | <a id="remote"></a> `remote?` | [`Remote`](Remote.mdx) | - | - |
22
+ | <a id="transport"></a> `transport?` | [`Transport`](Transport.mdx) | - | - |
23
+ | <a id="codec"></a> `codec?` | [`Codec`](Codec.mdx) | - | - |
@@ -0,0 +1,40 @@
1
+ ## Extends
2
+
3
+ - [`RTCStats`](RTCStats.mdx)
4
+
5
+ ## Indexable
6
+
7
+ ```ts
8
+ [key: string]: unknown
9
+ ```
10
+
11
+ ## Properties
12
+
13
+ | Property | Type | Overrides | Inherited from |
14
+ | ------ | ------ | ------ | ------ |
15
+ | <a id="id"></a> `id` | `string` | - | [`RTCStats`](RTCStats.mdx).[`id`](RTCStats.mdx#id) |
16
+ | <a id="timestamp"></a> `timestamp?` | `number` | - | [`RTCStats`](RTCStats.mdx).[`timestamp`](RTCStats.mdx#timestamp) |
17
+ | <a id="type"></a> `type` | `"outbound-rtp"` | [`RTCStats`](RTCStats.mdx).[`type`](RTCStats.mdx#type) | - |
18
+ | <a id="kind"></a> `kind` | `"video"` | [`RTCStats`](RTCStats.mdx).[`kind`](RTCStats.mdx#kind) | - |
19
+ | <a id="packetssent"></a> `packetsSent?` | `number` | - | - |
20
+ | <a id="packetslost"></a> `packetsLost?` | `number` | - | - |
21
+ | <a id="bytessent"></a> `bytesSent?` | `number` | - | - |
22
+ | <a id="totalpacketsenddelay"></a> `totalPacketSendDelay?` | `number` | - | - |
23
+ | <a id="framewidth"></a> `frameWidth?` | `number` | - | - |
24
+ | <a id="frameheight"></a> `frameHeight?` | `number` | - | - |
25
+ | <a id="framespersecond"></a> `framesPerSecond?` | `number` | - | - |
26
+ | <a id="codec"></a> `codec?` | [`Codec`](Codec.mdx) | - | - |
27
+ | <a id="mediasource"></a> `mediaSource?` | [`MediaSource`](MediaSource.mdx) | - | - |
28
+ | <a id="remote"></a> `remote?` | [`Remote`](Remote.mdx) | - | - |
29
+ | <a id="track"></a> `track?` | [`Track`](Track.mdx) | - | - |
30
+ | <a id="transport"></a> `transport?` | [`Transport`](Transport.mdx) | - | - |
31
+ | <a id="totalencodetime"></a> `totalEncodeTime?` | `number` | - | - |
32
+ | <a id="framesencoded"></a> `framesEncoded?` | `number` | - | - |
33
+ | <a id="bitratemean"></a> `bitrateMean?` | `number` | - | - |
34
+ | <a id="frameratemean"></a> `framerateMean?` | `number` | - | - |
35
+ | <a id="qualitylimitationreason"></a> `qualityLimitationReason?` | `"cpu"` \| `"bandwidth"` \| `"other"` \| `"none"` | - | - |
36
+ | <a id="qualitylimitationdurations"></a> `qualityLimitationDurations?` | `object` | - | - |
37
+ | `qualityLimitationDurations.cpu?` | `number` | - | - |
38
+ | `qualityLimitationDurations.bandwidth?` | `number` | - | - |
39
+ | `qualityLimitationDurations.other?` | `number` | - | - |
40
+ | `qualityLimitationDurations.none?` | `number` | - | - |
@@ -0,0 +1,28 @@
1
+ ## Extended by
2
+
3
+ - [`Remote`](Remote.mdx)
4
+ - [`CandidatePair`](CandidatePair.mdx)
5
+ - [`Transport`](Transport.mdx)
6
+ - [`Codec`](Codec.mdx)
7
+ - [`InboundAudio`](InboundAudio.mdx)
8
+ - [`OutboundAudio`](OutboundAudio.mdx)
9
+ - [`InboundVideo`](InboundVideo.mdx)
10
+ - [`OutboundVideo`](OutboundVideo.mdx)
11
+ - [`MediaSource`](MediaSource.mdx)
12
+ - [`Track`](Track.mdx)
13
+ - [`Stream`](Stream.mdx)
14
+
15
+ ## Indexable
16
+
17
+ ```ts
18
+ [key: string]: unknown
19
+ ```
20
+
21
+ ## Properties
22
+
23
+ | Property | Type |
24
+ | ------ | ------ |
25
+ | <a id="id"></a> `id` | `string` |
26
+ | <a id="type"></a> `type` | `string` |
27
+ | <a id="kind"></a> `kind?` | `"audio"` \| `"video"` |
28
+ | <a id="timestamp"></a> `timestamp?` | `number` |
@@ -0,0 +1,23 @@
1
+ ## Extends
2
+
3
+ - [`RTCStats`](RTCStats.mdx)
4
+
5
+ ## Indexable
6
+
7
+ ```ts
8
+ [key: string]: unknown
9
+ ```
10
+
11
+ ## Properties
12
+
13
+ | Property | Type | Overrides | Inherited from |
14
+ | ------ | ------ | ------ | ------ |
15
+ | <a id="id"></a> `id` | `string` | - | [`RTCStats`](RTCStats.mdx).[`id`](RTCStats.mdx#id) |
16
+ | <a id="kind"></a> `kind?` | `"audio"` \| `"video"` | - | [`RTCStats`](RTCStats.mdx).[`kind`](RTCStats.mdx#kind) |
17
+ | <a id="timestamp"></a> `timestamp?` | `number` | - | [`RTCStats`](RTCStats.mdx).[`timestamp`](RTCStats.mdx#timestamp) |
18
+ | <a id="type"></a> `type` | `"remote-inbound-rtp"` | [`RTCStats`](RTCStats.mdx).[`type`](RTCStats.mdx#type) | - |
19
+ | <a id="jitter"></a> `jitter?` | `number` | - | - |
20
+ | <a id="packetslost"></a> `packetsLost?` | `number` | - | - |
21
+ | <a id="roundtriptime"></a> `roundTripTime?` | `number` | - | - |
22
+ | <a id="codec"></a> `codec?` | [`Codec`](Codec.mdx) | - | - |
23
+ | <a id="transport"></a> `transport?` | [`Transport`](Transport.mdx) | - | - |
@@ -0,0 +1,6 @@
1
+ ## Properties
2
+
3
+ | Property | Type |
4
+ | ------ | ------ |
5
+ | <a id="resetstats"></a> `resetStats` | () => () => `void` |
6
+ | <a id="cleanup"></a> `cleanup` | () => `void` |
@@ -0,0 +1,8 @@
1
+ ## Properties
2
+
3
+ | Property | Type |
4
+ | ------ | ------ |
5
+ | <a id="input"></a> `input` | `object` |
6
+ | `input.getStats` | (`selector?`) => `Promise`\<`RTCStatsReport`\> |
7
+ | <a id="signals"></a> `signals` | [`StatsSignals`](StatsSignals.mdx) |
8
+ | <a id="interval"></a> `interval?` | `number` |
@@ -0,0 +1,7 @@
1
+ ## Properties
2
+
3
+ | Property | Type |
4
+ | ------ | ------ |
5
+ | <a id="onrtcstats"></a> `onRtcStats` | `Signal`\<[`NormalizedRTCStats`](../type-aliases/NormalizedRTCStats.mdx)\> |
6
+ | <a id="oncallquality"></a> `onCallQuality` | `Signal`\<[`Quality`](../enumerations/Quality.mdx)\> |
7
+ | <a id="oncallqualitystats"></a> `onCallQualityStats` | `Signal`\<[`CallQualityStats`](../type-aliases/CallQualityStats.mdx)\> |
@@ -0,0 +1,19 @@
1
+ ## Extends
2
+
3
+ - [`RTCStats`](RTCStats.mdx)
4
+
5
+ ## Indexable
6
+
7
+ ```ts
8
+ [key: string]: unknown
9
+ ```
10
+
11
+ ## Properties
12
+
13
+ | Property | Type | Overrides | Inherited from |
14
+ | ------ | ------ | ------ | ------ |
15
+ | <a id="id"></a> `id` | `string` | - | [`RTCStats`](RTCStats.mdx).[`id`](RTCStats.mdx#id) |
16
+ | <a id="kind"></a> `kind?` | `"audio"` \| `"video"` | - | [`RTCStats`](RTCStats.mdx).[`kind`](RTCStats.mdx#kind) |
17
+ | <a id="timestamp"></a> `timestamp?` | `number` | - | [`RTCStats`](RTCStats.mdx).[`timestamp`](RTCStats.mdx#timestamp) |
18
+ | <a id="type"></a> `type` | `"stream"` | [`RTCStats`](RTCStats.mdx).[`type`](RTCStats.mdx#type) | - |
19
+ | <a id="tracks"></a> `tracks?` | [`Track`](Track.mdx)[] | - | - |
@@ -0,0 +1,19 @@
1
+ ## Extends
2
+
3
+ - [`RTCStats`](RTCStats.mdx)
4
+
5
+ ## Indexable
6
+
7
+ ```ts
8
+ [key: string]: unknown
9
+ ```
10
+
11
+ ## Properties
12
+
13
+ | Property | Type | Overrides | Inherited from |
14
+ | ------ | ------ | ------ | ------ |
15
+ | <a id="id"></a> `id` | `string` | - | [`RTCStats`](RTCStats.mdx).[`id`](RTCStats.mdx#id) |
16
+ | <a id="timestamp"></a> `timestamp?` | `number` | - | [`RTCStats`](RTCStats.mdx).[`timestamp`](RTCStats.mdx#timestamp) |
17
+ | <a id="type"></a> `type` | `"track"` | [`RTCStats`](RTCStats.mdx).[`type`](RTCStats.mdx#type) | - |
18
+ | <a id="kind"></a> `kind` | `"audio"` \| `"video"` | [`RTCStats`](RTCStats.mdx).[`kind`](RTCStats.mdx#kind) | - |
19
+ | <a id="mediasource"></a> `mediaSource?` | [`MediaSource`](MediaSource.mdx) | - | - |
@@ -0,0 +1,19 @@
1
+ ## Extends
2
+
3
+ - [`RTCStats`](RTCStats.mdx)
4
+
5
+ ## Indexable
6
+
7
+ ```ts
8
+ [key: string]: unknown
9
+ ```
10
+
11
+ ## Properties
12
+
13
+ | Property | Type | Overrides | Inherited from |
14
+ | ------ | ------ | ------ | ------ |
15
+ | <a id="id"></a> `id` | `string` | - | [`RTCStats`](RTCStats.mdx).[`id`](RTCStats.mdx#id) |
16
+ | <a id="kind"></a> `kind?` | `"audio"` \| `"video"` | - | [`RTCStats`](RTCStats.mdx).[`kind`](RTCStats.mdx#kind) |
17
+ | <a id="timestamp"></a> `timestamp?` | `number` | - | [`RTCStats`](RTCStats.mdx).[`timestamp`](RTCStats.mdx#timestamp) |
18
+ | <a id="type"></a> `type` | `"transport"` | [`RTCStats`](RTCStats.mdx).[`type`](RTCStats.mdx#type) | - |
19
+ | <a id="selectedcandidatepair"></a> `selectedCandidatePair?` | [`CandidatePair`](CandidatePair.mdx) | - | - |
@@ -0,0 +1,27 @@
1
+ ## Extends
2
+
3
+ - [`Metrics`](Metrics.mdx)
4
+
5
+ ## Properties
6
+
7
+ | Property | Type | Inherited from |
8
+ | ------ | ------ | ------ |
9
+ | <a id="type"></a> `type` | `"inbound-rtp"` \| `"outbound-rtp"` | [`Metrics`](Metrics.mdx).[`type`](Metrics.mdx#type) |
10
+ | <a id="kind"></a> `kind` | `"audio"` \| `"video"` | [`Metrics`](Metrics.mdx).[`kind`](Metrics.mdx#kind) |
11
+ | <a id="bitrate"></a> `bitrate?` | `number` | [`Metrics`](Metrics.mdx).[`bitrate`](Metrics.mdx#bitrate) |
12
+ | <a id="bytestransmitted"></a> `bytesTransmitted?` | `number` | [`Metrics`](Metrics.mdx).[`bytesTransmitted`](Metrics.mdx#bytestransmitted) |
13
+ | <a id="codec"></a> `codec?` | `string` | [`Metrics`](Metrics.mdx).[`codec`](Metrics.mdx#codec) |
14
+ | <a id="jitter"></a> `jitter?` | `number` | [`Metrics`](Metrics.mdx).[`jitter`](Metrics.mdx#jitter) |
15
+ | <a id="packetslost"></a> `packetsLost` | `number` | [`Metrics`](Metrics.mdx).[`packetsLost`](Metrics.mdx#packetslost) |
16
+ | <a id="packetstransmitted"></a> `packetsTransmitted` | `number` | [`Metrics`](Metrics.mdx).[`packetsTransmitted`](Metrics.mdx#packetstransmitted) |
17
+ | <a id="recentpercentagelost"></a> `recentPercentageLost?` | `number` | [`Metrics`](Metrics.mdx).[`recentPercentageLost`](Metrics.mdx#recentpercentagelost) |
18
+ | <a id="roundtriptime"></a> `roundTripTime?` | `number` | [`Metrics`](Metrics.mdx).[`roundTripTime`](Metrics.mdx#roundtriptime) |
19
+ | <a id="timestamp"></a> `timestamp?` | `number` | [`Metrics`](Metrics.mdx).[`timestamp`](Metrics.mdx#timestamp) |
20
+ | <a id="totalpercentagelost"></a> `totalPercentageLost?` | `number` | [`Metrics`](Metrics.mdx).[`totalPercentageLost`](Metrics.mdx#totalpercentagelost) |
21
+ | <a id="timetocapturestats"></a> `timeToCaptureStats?` | `number` | [`Metrics`](Metrics.mdx).[`timeToCaptureStats`](Metrics.mdx#timetocapturestats) |
22
+ | <a id="quality"></a> `quality?` | [`Quality`](../enumerations/Quality.mdx) | [`Metrics`](Metrics.mdx).[`quality`](Metrics.mdx#quality) |
23
+ | <a id="framespersecond"></a> `framesPerSecond?` | `number` | - |
24
+ | <a id="resolution"></a> `resolution?` | `string` | - |
25
+ | <a id="resolutionheight"></a> `resolutionHeight?` | `number` | - |
26
+ | <a id="resolutionwidth"></a> `resolutionWidth?` | `number` | - |
27
+ | <a id="fpsvolatility"></a> `fpsVolatility?` | `number` | - |
@@ -0,0 +1,14 @@
1
+ ```ts
2
+ type AnyStats =
3
+ | CandidatePair
4
+ | Codec
5
+ | InboundAudio
6
+ | InboundVideo
7
+ | OutboundAudio
8
+ | OutboundVideo
9
+ | RTCStats
10
+ | Remote
11
+ | Stream
12
+ | Track
13
+ | Transport;
14
+ ```
@@ -0,0 +1,3 @@
1
+ ```ts
2
+ type AudioQualityStats = [number, number][];
3
+ ```
@@ -0,0 +1,3 @@
1
+ ```ts
2
+ type CallPacketsStats = PacketsStats;
3
+ ```
@@ -0,0 +1,5 @@
1
+ ```ts
2
+ type CallQualityStats =
3
+ | AudioQualityStats
4
+ | VideoQualityStats;
5
+ ```
@@ -0,0 +1,3 @@
1
+ ```ts
2
+ type FPSStats = number[];
3
+ ```
@@ -0,0 +1,3 @@
1
+ ```ts
2
+ type InboundAudioMetrics = Metrics;
3
+ ```
@@ -0,0 +1,9 @@
1
+ ```ts
2
+ type InboundVideoMetrics = VideoMetrics & object;
3
+ ```
4
+
5
+ ## Type Declaration
6
+
7
+ | Name | Type |
8
+ | ------ | ------ |
9
+ | `averageDecodeTime?` | `number` |
@@ -0,0 +1,7 @@
1
+ ```ts
2
+ type NormalizedRTCStats =
3
+ | InboundAudioMetrics
4
+ | InboundVideoMetrics
5
+ | OutboundAudioMetrics
6
+ | OutboundVideoMetrics;
7
+ ```
@@ -0,0 +1,3 @@
1
+ ```ts
2
+ type OutboundAudioMetrics = Metrics;
3
+ ```
@@ -0,0 +1,13 @@
1
+ ```ts
2
+ type OutboundVideoMetrics = VideoMetrics & object;
3
+ ```
4
+
5
+ ## Type Declaration
6
+
7
+ | Name | Type |
8
+ | ------ | ------ |
9
+ | `totalPacketSendDelay?` | `number` |
10
+ | `averagePacketSendDelay?` | `number` |
11
+ | `averageEncodeTime?` | `number` |
12
+ | `qualityLimitationReason?` | [`OutboundVideo`](../interfaces/OutboundVideo.mdx)\[`"qualityLimitationReason"`\] |
13
+ | `qualityLimitationDurations?` | [`OutboundVideo`](../interfaces/OutboundVideo.mdx)\[`"qualityLimitationDurations"`\] |
@@ -0,0 +1,3 @@
1
+ ```ts
2
+ type PacketsStats = [number, number][];
3
+ ```
@@ -0,0 +1,3 @@
1
+ ```ts
2
+ type VideoQualityStats = number[];
3
+ ```
@@ -0,0 +1,3 @@
1
+ ```ts
2
+ const FPS_STATS_SIZE: 8 = 8;
3
+ ```
@@ -0,0 +1,3 @@
1
+ ```ts
2
+ const STATS_SIZE: 60 = 60;
3
+ ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pexip/peer-connection-stats",
3
- "version": "18.5.1",
3
+ "version": "18.5.3",
4
4
  "description": "Normalizer of RTCStats and related",
5
5
  "homepage": "https://gitlab.com/pexip/zoo",
6
6
  "bugs": "https://gitlab.com/pexip/zoo/issues",
@@ -23,13 +23,17 @@
23
23
  "import": "./dist/*.js"
24
24
  }
25
25
  },
26
+ "directories": {
27
+ "doc": "api-docs"
28
+ },
26
29
  "files": [
27
- "dist"
30
+ "dist",
31
+ "api-docs"
28
32
  ],
29
33
  "scripts": {
30
- "build": "pexip-bundler build",
31
- "build:sourcemap": "pexip-bundler build --sourcemap",
32
- "clean": "rm -fr dist",
34
+ "build": "pexip-bundler build && yarn docs",
35
+ "build:sourcemap": "pexip-bundler build --sourcemap && yarn docs",
36
+ "clean": "rm -fr dist api-docs",
33
37
  "dev": "pexip-bundler dev",
34
38
  "prepack": "yarn clean && yarn build",
35
39
  "test": "jest",
@@ -37,19 +41,22 @@
37
41
  "check-format": "prettier --ignore-path=../../.prettierignore --check .",
38
42
  "format": "prettier --ignore-path=../../.prettierignore --write .",
39
43
  "lint": "yarn run -T biome lint",
40
- "typecheck": "yarn tsc --noEmit -p ."
44
+ "typecheck": "yarn tsc --noEmit -p .",
45
+ "docs": "typedoc"
41
46
  },
42
47
  "dependencies": {
43
- "@pexip/signal": "16.9.2",
44
- "@pexip/utils": "17.1.2"
48
+ "@pexip/signal": "16.9.3",
49
+ "@pexip/utils": "17.1.3"
45
50
  },
46
51
  "devDependencies": {
47
- "@pexip/bundler": "18.1.2",
52
+ "@pexip/bundler": "18.2.0",
48
53
  "@swc/core": "^1.10.12",
49
54
  "@swc/jest": "^0.2.39",
50
55
  "jest": "^29.5.12",
51
56
  "jest-junit": "^16.0.0",
52
57
  "prettier": "^3.2.5",
58
+ "typedoc": "^0.28.15",
59
+ "typedoc-plugin-markdown": "^4.9.0",
53
60
  "typescript": "~5.7.3"
54
61
  },
55
62
  "publishConfig": {