@pexip/peer-connection-stats 18.1.0 → 18.2.0
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.
- package/CHANGELOG.md +13 -0
- package/README.md +3 -3
- package/dist/statsCollector.d.ts +3 -1
- package/dist/statsCollector.js +3 -1
- package/dist/statsCollector.types.d.ts +6 -0
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 18.2.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 7f9df17: Expose `qualityLimitationDurations` and `qualityLimitationReason`.
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- 709232f: Correct typedoc comment to fix the document generation.
|
|
12
|
+
- Updated dependencies [6fddc11]
|
|
13
|
+
- @pexip/signal@16.9.0
|
|
14
|
+
- @pexip/utils@17.0.0
|
|
15
|
+
|
|
3
16
|
## 18.1.0
|
|
4
17
|
|
|
5
18
|
### Minor Changes
|
package/README.md
CHANGED
|
@@ -8,6 +8,6 @@ Helps with normalization of data from `RTCStats` and friends.
|
|
|
8
8
|
|
|
9
9
|
Related documentation:
|
|
10
10
|
|
|
11
|
-
-
|
|
12
|
-
-
|
|
13
|
-
-
|
|
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)
|
package/dist/statsCollector.d.ts
CHANGED
|
@@ -139,6 +139,8 @@ export declare const addDeltaStats: (newStats: NormalizedRTCStats, cache: CacheS
|
|
|
139
139
|
totalPacketSendDelay?: number;
|
|
140
140
|
averagePacketSendDelay?: number;
|
|
141
141
|
averageEncodeTime?: number;
|
|
142
|
+
qualityLimitationReason?: OutboundVideo["qualityLimitationReason"];
|
|
143
|
+
qualityLimitationDurations?: OutboundVideo["qualityLimitationDurations"];
|
|
142
144
|
}, Quality, CallQualityStats];
|
|
143
145
|
export declare const calculateQuality: (stats: number | [number, number]) => Quality;
|
|
144
146
|
/**
|
|
@@ -148,6 +150,6 @@ export declare const calculateQuality: (stats: number | [number, number]) => Qua
|
|
|
148
150
|
* @param signal - Signal which distributes stats
|
|
149
151
|
* @param interval - how often signal with fire with new stats
|
|
150
152
|
*
|
|
151
|
-
* @returns
|
|
153
|
+
* @returns {Object} function to reset stats window, cleanup func
|
|
152
154
|
*/
|
|
153
155
|
export declare const createStatsCollector: ({ input, signals: { onCallQuality, onCallQualityStats, onRtcStats }, interval, }: StatsCollectorOptions) => StatsCollector;
|
package/dist/statsCollector.js
CHANGED
|
@@ -224,6 +224,8 @@ export const outboundVideo = (statsData) => {
|
|
|
224
224
|
averageEncodeTime: statsData.framesEncoded && statsData.totalEncodeTime
|
|
225
225
|
? statsData.totalEncodeTime / statsData.framesEncoded
|
|
226
226
|
: 0,
|
|
227
|
+
qualityLimitationReason: statsData.qualityLimitationReason,
|
|
228
|
+
qualityLimitationDurations: statsData.qualityLimitationDurations,
|
|
227
229
|
};
|
|
228
230
|
};
|
|
229
231
|
const isInbound = (entry) => entry.type === 'inbound-rtp';
|
|
@@ -493,7 +495,7 @@ export const calculateQuality = (stats) => {
|
|
|
493
495
|
* @param signal - Signal which distributes stats
|
|
494
496
|
* @param interval - how often signal with fire with new stats
|
|
495
497
|
*
|
|
496
|
-
* @returns
|
|
498
|
+
* @returns {Object} function to reset stats window, cleanup func
|
|
497
499
|
*/
|
|
498
500
|
export const createStatsCollector = ({ input, signals: { onCallQuality, onCallQualityStats, onRtcStats }, interval = 1000, }) => {
|
|
499
501
|
const newCache = () => ({
|
|
@@ -86,6 +86,10 @@ export interface OutboundVideo extends RTCStats {
|
|
|
86
86
|
framesEncoded?: number;
|
|
87
87
|
bitrateMean?: number;
|
|
88
88
|
framerateMean?: number;
|
|
89
|
+
qualityLimitationReason?: 'cpu' | 'bandwidth' | 'other' | 'none';
|
|
90
|
+
qualityLimitationDurations?: {
|
|
91
|
+
[key in NonNullable<OutboundVideo['qualityLimitationReason']>]?: number;
|
|
92
|
+
};
|
|
89
93
|
}
|
|
90
94
|
export interface MediaSource extends RTCStats {
|
|
91
95
|
type: 'media-source';
|
|
@@ -132,6 +136,8 @@ export type OutboundVideoMetrics = VideoMetrics & {
|
|
|
132
136
|
totalPacketSendDelay?: number;
|
|
133
137
|
averagePacketSendDelay?: number;
|
|
134
138
|
averageEncodeTime?: number;
|
|
139
|
+
qualityLimitationReason?: OutboundVideo['qualityLimitationReason'];
|
|
140
|
+
qualityLimitationDurations?: OutboundVideo['qualityLimitationDurations'];
|
|
135
141
|
};
|
|
136
142
|
export type NormalizedRTCStats = InboundAudioMetrics | InboundVideoMetrics | OutboundAudioMetrics | OutboundVideoMetrics;
|
|
137
143
|
export type PacketsStats = [number, number][];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pexip/peer-connection-stats",
|
|
3
|
-
"version": "18.
|
|
3
|
+
"version": "18.2.0",
|
|
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",
|
|
@@ -40,11 +40,11 @@
|
|
|
40
40
|
"typecheck": "yarn tsc --noEmit -p ."
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@pexip/signal": "16.
|
|
43
|
+
"@pexip/signal": "16.9.0",
|
|
44
44
|
"@pexip/utils": "17.0.0"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
|
-
"@pexip/bundler": "18.1.
|
|
47
|
+
"@pexip/bundler": "18.1.1",
|
|
48
48
|
"@swc/core": "^1.10.12",
|
|
49
49
|
"@swc/jest": "^0.2.37",
|
|
50
50
|
"jest": "^29.5.12",
|