@pexip/peer-connection-stats 17.7.0 → 17.9.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 +22 -0
- package/dist/index.d.ts +3 -325
- package/dist/index.js +3 -0
- package/dist/statsCollector.d.ts +145 -0
- package/dist/statsCollector.js +497 -0
- package/dist/statsCollector.types.d.ts +160 -0
- package/dist/statsCollector.types.js +7 -0
- package/dist/tests/statsCollector.chrome-inbound-presentation.fixtures.d.ts +2 -0
- package/dist/tests/statsCollector.chrome-inbound-presentation.fixtures.js +972 -0
- package/dist/tests/statsCollector.chrome-multiple.fixtures.d.ts +7 -0
- package/dist/tests/statsCollector.chrome-multiple.fixtures.js +2640 -0
- package/dist/tests/statsCollector.chrome-outbound-presentation.fixtures.d.ts +2 -0
- package/dist/tests/statsCollector.chrome-outbound-presentation.fixtures.js +907 -0
- package/dist/tests/statsCollector.firefox.fixtures.d.ts +2 -0
- package/dist/tests/statsCollector.firefox.fixtures.js +471 -0
- package/dist/utils.d.ts +15 -0
- package/dist/utils.js +30 -0
- package/package.json +6 -6
- package/dist/index.mjs +0 -478
|
@@ -0,0 +1,471 @@
|
|
|
1
|
+
export const statsData = [
|
|
2
|
+
{
|
|
3
|
+
id: '70df0599',
|
|
4
|
+
timestamp: 1607359512685,
|
|
5
|
+
type: 'candidate-pair',
|
|
6
|
+
bytesReceived: 0,
|
|
7
|
+
bytesSent: 0,
|
|
8
|
+
lastPacketReceivedTimestamp: 0,
|
|
9
|
+
lastPacketSentTimestamp: 0,
|
|
10
|
+
localCandidateId: '32ac0d0c',
|
|
11
|
+
nominated: false,
|
|
12
|
+
priority: 8774140172997362000,
|
|
13
|
+
readable: true,
|
|
14
|
+
remoteCandidateId: '6479453f',
|
|
15
|
+
selected: false,
|
|
16
|
+
state: 'inprogress',
|
|
17
|
+
transportId: 'transport_0',
|
|
18
|
+
writable: true,
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
id: 'cb3ebd3b',
|
|
22
|
+
timestamp: 1607359512685,
|
|
23
|
+
type: 'candidate-pair',
|
|
24
|
+
bytesReceived: 0,
|
|
25
|
+
bytesSent: 0,
|
|
26
|
+
lastPacketReceivedTimestamp: 0,
|
|
27
|
+
lastPacketSentTimestamp: 0,
|
|
28
|
+
localCandidateId: 'eab7c196',
|
|
29
|
+
nominated: false,
|
|
30
|
+
priority: 8774140172997231000,
|
|
31
|
+
readable: true,
|
|
32
|
+
remoteCandidateId: '6479453f',
|
|
33
|
+
selected: false,
|
|
34
|
+
state: 'inprogress',
|
|
35
|
+
transportId: 'transport_0',
|
|
36
|
+
writable: true,
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
id: '747cde3e',
|
|
40
|
+
timestamp: 1607359512685,
|
|
41
|
+
type: 'candidate-pair',
|
|
42
|
+
bytesReceived: 5555374,
|
|
43
|
+
bytesSent: 12060851,
|
|
44
|
+
lastPacketReceivedTimestamp: 1607468216444,
|
|
45
|
+
lastPacketSentTimestamp: 1607468216464,
|
|
46
|
+
localCandidateId: '8f940ef2',
|
|
47
|
+
nominated: true,
|
|
48
|
+
priority: 7962083765516764000,
|
|
49
|
+
readable: true,
|
|
50
|
+
remoteCandidateId: '6479453f',
|
|
51
|
+
selected: true,
|
|
52
|
+
state: 'succeeded',
|
|
53
|
+
transportId: 'transport_0',
|
|
54
|
+
writable: true,
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
id: '53941a10',
|
|
58
|
+
timestamp: 1607359512685,
|
|
59
|
+
type: 'candidate-pair',
|
|
60
|
+
bytesReceived: 0,
|
|
61
|
+
bytesSent: 0,
|
|
62
|
+
lastPacketReceivedTimestamp: 0,
|
|
63
|
+
lastPacketSentTimestamp: 0,
|
|
64
|
+
localCandidateId: '8f940ef2',
|
|
65
|
+
nominated: true,
|
|
66
|
+
priority: 7961802290540054000,
|
|
67
|
+
readable: true,
|
|
68
|
+
remoteCandidateId: '6479453f',
|
|
69
|
+
selected: false,
|
|
70
|
+
state: 'succeeded',
|
|
71
|
+
transportId: 'transport_0',
|
|
72
|
+
writable: true,
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
id: 'f95809af',
|
|
76
|
+
timestamp: 1607359512685,
|
|
77
|
+
type: 'candidate-pair',
|
|
78
|
+
bytesReceived: 0,
|
|
79
|
+
bytesSent: 0,
|
|
80
|
+
lastPacketReceivedTimestamp: 0,
|
|
81
|
+
lastPacketSentTimestamp: 0,
|
|
82
|
+
localCandidateId: '85c269b',
|
|
83
|
+
nominated: false,
|
|
84
|
+
priority: 3676066494292132400,
|
|
85
|
+
readable: true,
|
|
86
|
+
remoteCandidateId: '62b88a85',
|
|
87
|
+
selected: false,
|
|
88
|
+
state: 'cancelled',
|
|
89
|
+
transportId: 'transport_0',
|
|
90
|
+
writable: true,
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
id: 'fbd8e264',
|
|
94
|
+
timestamp: 1607359512685,
|
|
95
|
+
type: 'candidate-pair',
|
|
96
|
+
bytesReceived: 0,
|
|
97
|
+
bytesSent: 0,
|
|
98
|
+
lastPacketReceivedTimestamp: 0,
|
|
99
|
+
lastPacketSentTimestamp: 0,
|
|
100
|
+
localCandidateId: 'c715fb9b',
|
|
101
|
+
nominated: false,
|
|
102
|
+
priority: 3676066494292001300,
|
|
103
|
+
readable: true,
|
|
104
|
+
remoteCandidateId: '62b88a85',
|
|
105
|
+
selected: false,
|
|
106
|
+
state: 'cancelled',
|
|
107
|
+
transportId: 'transport_0',
|
|
108
|
+
writable: true,
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
id: '92d8e29c',
|
|
112
|
+
timestamp: 1607359512685,
|
|
113
|
+
type: 'candidate-pair',
|
|
114
|
+
bytesReceived: 0,
|
|
115
|
+
bytesSent: 0,
|
|
116
|
+
lastPacketReceivedTimestamp: 0,
|
|
117
|
+
lastPacketSentTimestamp: 0,
|
|
118
|
+
localCandidateId: 'efec9d54',
|
|
119
|
+
nominated: false,
|
|
120
|
+
priority: 8774140172997362000,
|
|
121
|
+
readable: true,
|
|
122
|
+
remoteCandidateId: '4af8c58e',
|
|
123
|
+
selected: false,
|
|
124
|
+
state: 'inprogress',
|
|
125
|
+
transportId: 'transport_1',
|
|
126
|
+
writable: true,
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
id: 'd4d8f4af',
|
|
130
|
+
timestamp: 1607359512685,
|
|
131
|
+
type: 'candidate-pair',
|
|
132
|
+
bytesReceived: 0,
|
|
133
|
+
bytesSent: 0,
|
|
134
|
+
lastPacketReceivedTimestamp: 0,
|
|
135
|
+
lastPacketSentTimestamp: 0,
|
|
136
|
+
localCandidateId: '93fefccb',
|
|
137
|
+
nominated: false,
|
|
138
|
+
priority: 8774140172997231000,
|
|
139
|
+
readable: true,
|
|
140
|
+
remoteCandidateId: '4af8c58e',
|
|
141
|
+
selected: false,
|
|
142
|
+
state: 'cancelled',
|
|
143
|
+
transportId: 'transport_1',
|
|
144
|
+
writable: true,
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
id: '367faebf',
|
|
148
|
+
timestamp: 1607359512685,
|
|
149
|
+
type: 'candidate-pair',
|
|
150
|
+
bytesReceived: 415969,
|
|
151
|
+
bytesSent: 163308,
|
|
152
|
+
lastPacketReceivedTimestamp: 1607468216459,
|
|
153
|
+
lastPacketSentTimestamp: 1607468216456,
|
|
154
|
+
localCandidateId: '8f940ef2',
|
|
155
|
+
nominated: true,
|
|
156
|
+
priority: 7962083765516764000,
|
|
157
|
+
readable: true,
|
|
158
|
+
remoteCandidateId: '4af8c58e',
|
|
159
|
+
selected: true,
|
|
160
|
+
state: 'succeeded',
|
|
161
|
+
transportId: 'transport_1',
|
|
162
|
+
writable: true,
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
id: 'd43ca551',
|
|
166
|
+
timestamp: 1607359512685,
|
|
167
|
+
type: 'candidate-pair',
|
|
168
|
+
bytesReceived: 0,
|
|
169
|
+
bytesSent: 0,
|
|
170
|
+
lastPacketReceivedTimestamp: 0,
|
|
171
|
+
lastPacketSentTimestamp: 0,
|
|
172
|
+
localCandidateId: 'ec5c247d',
|
|
173
|
+
nominated: false,
|
|
174
|
+
priority: 3676066494292132400,
|
|
175
|
+
readable: true,
|
|
176
|
+
remoteCandidateId: '53c089e',
|
|
177
|
+
selected: false,
|
|
178
|
+
state: 'cancelled',
|
|
179
|
+
transportId: 'transport_1',
|
|
180
|
+
writable: true,
|
|
181
|
+
},
|
|
182
|
+
{
|
|
183
|
+
id: '5f7cb429',
|
|
184
|
+
timestamp: 1607359512685,
|
|
185
|
+
type: 'candidate-pair',
|
|
186
|
+
bytesReceived: 0,
|
|
187
|
+
bytesSent: 0,
|
|
188
|
+
lastPacketReceivedTimestamp: 0,
|
|
189
|
+
lastPacketSentTimestamp: 0,
|
|
190
|
+
localCandidateId: '465c49cb',
|
|
191
|
+
nominated: false,
|
|
192
|
+
priority: 3676066494292001300,
|
|
193
|
+
readable: true,
|
|
194
|
+
remoteCandidateId: '53c089e',
|
|
195
|
+
selected: false,
|
|
196
|
+
state: 'cancelled',
|
|
197
|
+
transportId: 'transport_1',
|
|
198
|
+
writable: true,
|
|
199
|
+
},
|
|
200
|
+
{
|
|
201
|
+
id: 'eab7c196',
|
|
202
|
+
timestamp: 1607359512685,
|
|
203
|
+
type: 'local-candidate',
|
|
204
|
+
address: '192.168.1.23',
|
|
205
|
+
candidateType: 'host',
|
|
206
|
+
port: 40524,
|
|
207
|
+
priority: 2122187007,
|
|
208
|
+
protocol: 'udp',
|
|
209
|
+
},
|
|
210
|
+
{
|
|
211
|
+
id: '32ac0d0c',
|
|
212
|
+
timestamp: 1607359512685,
|
|
213
|
+
type: 'local-candidate',
|
|
214
|
+
address: '192.168.122.1',
|
|
215
|
+
candidateType: 'host',
|
|
216
|
+
port: 35588,
|
|
217
|
+
priority: 2122252543,
|
|
218
|
+
protocol: 'udp',
|
|
219
|
+
},
|
|
220
|
+
{
|
|
221
|
+
id: 'c715fb9b',
|
|
222
|
+
timestamp: 1607359512685,
|
|
223
|
+
type: 'local-candidate',
|
|
224
|
+
address: '192.168.1.23',
|
|
225
|
+
candidateType: 'host',
|
|
226
|
+
port: 51647,
|
|
227
|
+
priority: 2105458943,
|
|
228
|
+
protocol: 'tcp',
|
|
229
|
+
},
|
|
230
|
+
{
|
|
231
|
+
id: '85c269b',
|
|
232
|
+
timestamp: 1607359512685,
|
|
233
|
+
type: 'local-candidate',
|
|
234
|
+
address: '192.168.122.1',
|
|
235
|
+
candidateType: 'host',
|
|
236
|
+
port: 49524,
|
|
237
|
+
priority: 2105524479,
|
|
238
|
+
protocol: 'tcp',
|
|
239
|
+
},
|
|
240
|
+
{
|
|
241
|
+
id: '8f940ef2',
|
|
242
|
+
timestamp: 1607359512685,
|
|
243
|
+
type: 'local-candidate',
|
|
244
|
+
address: '45.152.51.102',
|
|
245
|
+
candidateType: 'prflx',
|
|
246
|
+
port: 55186,
|
|
247
|
+
priority: 1853817087,
|
|
248
|
+
protocol: 'udp',
|
|
249
|
+
},
|
|
250
|
+
{
|
|
251
|
+
id: '6479453f',
|
|
252
|
+
timestamp: 1607359512685,
|
|
253
|
+
type: 'remote-candidate',
|
|
254
|
+
address: '34.91.46.168',
|
|
255
|
+
candidateType: 'host',
|
|
256
|
+
port: 40166,
|
|
257
|
+
priority: 2042888703,
|
|
258
|
+
protocol: 'udp',
|
|
259
|
+
},
|
|
260
|
+
{
|
|
261
|
+
id: '62b88a85',
|
|
262
|
+
timestamp: 1607359512685,
|
|
263
|
+
type: 'remote-candidate',
|
|
264
|
+
address: '34.91.46.168',
|
|
265
|
+
candidateType: 'host',
|
|
266
|
+
port: 40166,
|
|
267
|
+
priority: 855900927,
|
|
268
|
+
protocol: 'tcp',
|
|
269
|
+
},
|
|
270
|
+
{
|
|
271
|
+
id: 'fbec0791',
|
|
272
|
+
timestamp: 1607359512685,
|
|
273
|
+
type: 'remote-candidate',
|
|
274
|
+
address: '34.91.46.168',
|
|
275
|
+
candidateType: 'host',
|
|
276
|
+
port: 40166,
|
|
277
|
+
priority: 864289791,
|
|
278
|
+
protocol: 'tcp',
|
|
279
|
+
},
|
|
280
|
+
{
|
|
281
|
+
id: '93fefccb',
|
|
282
|
+
timestamp: 1607359512685,
|
|
283
|
+
type: 'local-candidate',
|
|
284
|
+
address: '192.168.1.23',
|
|
285
|
+
candidateType: 'host',
|
|
286
|
+
port: 37715,
|
|
287
|
+
priority: 2122187007,
|
|
288
|
+
protocol: 'udp',
|
|
289
|
+
},
|
|
290
|
+
{
|
|
291
|
+
id: 'efec9d54',
|
|
292
|
+
timestamp: 1607359512685,
|
|
293
|
+
type: 'local-candidate',
|
|
294
|
+
address: '192.168.122.1',
|
|
295
|
+
candidateType: 'host',
|
|
296
|
+
port: 55186,
|
|
297
|
+
priority: 2122252543,
|
|
298
|
+
protocol: 'udp',
|
|
299
|
+
},
|
|
300
|
+
{
|
|
301
|
+
id: '465c49cb',
|
|
302
|
+
timestamp: 1607359512685,
|
|
303
|
+
type: 'local-candidate',
|
|
304
|
+
address: '192.168.1.23',
|
|
305
|
+
candidateType: 'host',
|
|
306
|
+
port: 53452,
|
|
307
|
+
priority: 2105458943,
|
|
308
|
+
protocol: 'tcp',
|
|
309
|
+
},
|
|
310
|
+
{
|
|
311
|
+
id: 'ec5c247d',
|
|
312
|
+
timestamp: 1607359512685,
|
|
313
|
+
type: 'local-candidate',
|
|
314
|
+
address: '192.168.122.1',
|
|
315
|
+
candidateType: 'host',
|
|
316
|
+
port: 60325,
|
|
317
|
+
priority: 2105524479,
|
|
318
|
+
protocol: 'tcp',
|
|
319
|
+
},
|
|
320
|
+
{
|
|
321
|
+
id: '4af8c58e',
|
|
322
|
+
timestamp: 1607359512685,
|
|
323
|
+
type: 'remote-candidate',
|
|
324
|
+
address: '34.91.46.168',
|
|
325
|
+
candidateType: 'host',
|
|
326
|
+
port: 40186,
|
|
327
|
+
priority: 2042888703,
|
|
328
|
+
protocol: 'udp',
|
|
329
|
+
},
|
|
330
|
+
{
|
|
331
|
+
id: '53c089e',
|
|
332
|
+
timestamp: 1607359512685,
|
|
333
|
+
type: 'remote-candidate',
|
|
334
|
+
address: '34.91.46.168',
|
|
335
|
+
candidateType: 'host',
|
|
336
|
+
port: 40186,
|
|
337
|
+
priority: 855900927,
|
|
338
|
+
protocol: 'tcp',
|
|
339
|
+
},
|
|
340
|
+
{
|
|
341
|
+
id: '58f0027f',
|
|
342
|
+
timestamp: 1607359512685,
|
|
343
|
+
type: 'remote-candidate',
|
|
344
|
+
address: '34.91.46.168',
|
|
345
|
+
candidateType: 'host',
|
|
346
|
+
port: 40186,
|
|
347
|
+
priority: 864289791,
|
|
348
|
+
protocol: 'tcp',
|
|
349
|
+
},
|
|
350
|
+
{
|
|
351
|
+
id: '8adcb9ce',
|
|
352
|
+
timestamp: 1607359512687,
|
|
353
|
+
type: 'inbound-rtp',
|
|
354
|
+
kind: 'video',
|
|
355
|
+
mediaType: 'video',
|
|
356
|
+
ssrc: 840745016,
|
|
357
|
+
discardedPackets: 0,
|
|
358
|
+
jitter: 0.014,
|
|
359
|
+
packetsLost: 0,
|
|
360
|
+
packetsReceived: 4666,
|
|
361
|
+
bitrateMean: 789199.2641509434,
|
|
362
|
+
bitrateStdDev: 172342.0917917606,
|
|
363
|
+
bytesReceived: 5215634,
|
|
364
|
+
firCount: 0,
|
|
365
|
+
framerateMean: 24.03773584905661,
|
|
366
|
+
framerateStdDev: 4.823668665074425,
|
|
367
|
+
framesDecoded: 1263,
|
|
368
|
+
nackCount: 0,
|
|
369
|
+
pliCount: 1,
|
|
370
|
+
remoteId: '7b317e3f',
|
|
371
|
+
},
|
|
372
|
+
{
|
|
373
|
+
id: 'b7b8198b',
|
|
374
|
+
timestamp: 1607359512687,
|
|
375
|
+
type: 'inbound-rtp',
|
|
376
|
+
kind: 'audio',
|
|
377
|
+
mediaType: 'audio',
|
|
378
|
+
ssrc: 3376419831,
|
|
379
|
+
jitter: 0,
|
|
380
|
+
packetsLost: 0,
|
|
381
|
+
packetsReceived: 2563,
|
|
382
|
+
bytesReceived: 371213,
|
|
383
|
+
nackCount: 0,
|
|
384
|
+
remoteId: 'e1a8cb41',
|
|
385
|
+
},
|
|
386
|
+
{
|
|
387
|
+
id: '9b81861',
|
|
388
|
+
timestamp: 1607359512686,
|
|
389
|
+
type: 'outbound-rtp',
|
|
390
|
+
kind: 'video',
|
|
391
|
+
mediaType: 'video',
|
|
392
|
+
ssrc: 678033974,
|
|
393
|
+
bytesSent: 11840687,
|
|
394
|
+
packetsSent: 10663,
|
|
395
|
+
bitrateMean: 1730236.3773584904,
|
|
396
|
+
bitrateStdDev: 434797.7326515535,
|
|
397
|
+
droppedFrames: 4,
|
|
398
|
+
firCount: 0,
|
|
399
|
+
framerateMean: 28.999999999999993,
|
|
400
|
+
framerateStdDev: 5.844129204068486,
|
|
401
|
+
framesEncoded: 1512,
|
|
402
|
+
nackCount: 0,
|
|
403
|
+
pliCount: 0,
|
|
404
|
+
qpSum: 89087,
|
|
405
|
+
remoteId: 'b39ceeda',
|
|
406
|
+
},
|
|
407
|
+
{
|
|
408
|
+
id: '9b74fd1c',
|
|
409
|
+
timestamp: 1607359512687,
|
|
410
|
+
type: 'outbound-rtp',
|
|
411
|
+
kind: 'audio',
|
|
412
|
+
mediaType: 'audio',
|
|
413
|
+
ssrc: 3453750983,
|
|
414
|
+
bytesSent: 120316,
|
|
415
|
+
packetsSent: 2560,
|
|
416
|
+
nackCount: 0,
|
|
417
|
+
remoteId: '8471050b',
|
|
418
|
+
},
|
|
419
|
+
{
|
|
420
|
+
id: 'b39ceeda',
|
|
421
|
+
timestamp: 1607359512666,
|
|
422
|
+
type: 'remote-inbound-rtp',
|
|
423
|
+
kind: 'video',
|
|
424
|
+
mediaType: 'video',
|
|
425
|
+
ssrc: 678033974,
|
|
426
|
+
jitter: 0.002,
|
|
427
|
+
packetsLost: 0,
|
|
428
|
+
packetsReceived: 10497,
|
|
429
|
+
bytesReceived: 11445691,
|
|
430
|
+
localId: '9b81861',
|
|
431
|
+
roundTripTime: 0.033,
|
|
432
|
+
},
|
|
433
|
+
{
|
|
434
|
+
id: '8471050b',
|
|
435
|
+
timestamp: 1607359510713,
|
|
436
|
+
type: 'remote-inbound-rtp',
|
|
437
|
+
kind: 'audio',
|
|
438
|
+
mediaType: 'audio',
|
|
439
|
+
ssrc: 3453750983,
|
|
440
|
+
jitter: 0,
|
|
441
|
+
packetsLost: 0,
|
|
442
|
+
packetsReceived: 2232,
|
|
443
|
+
bytesReceived: 78116,
|
|
444
|
+
localId: '9b74fd1c',
|
|
445
|
+
roundTripTime: 0.033,
|
|
446
|
+
},
|
|
447
|
+
{
|
|
448
|
+
id: '7b317e3f',
|
|
449
|
+
timestamp: 1607359512666,
|
|
450
|
+
type: 'remote-outbound-rtp',
|
|
451
|
+
kind: 'video',
|
|
452
|
+
mediaType: 'video',
|
|
453
|
+
ssrc: 840745016,
|
|
454
|
+
bytesSent: 5305963,
|
|
455
|
+
packetsSent: 4805,
|
|
456
|
+
localId: '8adcb9ce',
|
|
457
|
+
remoteTimestamp: 3816457015643,
|
|
458
|
+
},
|
|
459
|
+
{
|
|
460
|
+
id: 'e1a8cb41',
|
|
461
|
+
timestamp: 1607359510713,
|
|
462
|
+
type: 'remote-outbound-rtp',
|
|
463
|
+
kind: 'audio',
|
|
464
|
+
mediaType: 'audio',
|
|
465
|
+
ssrc: 3376419831,
|
|
466
|
+
bytesSent: 347333,
|
|
467
|
+
packetsSent: 2617,
|
|
468
|
+
localId: 'b7b8198b',
|
|
469
|
+
remoteTimestamp: 3816457014478,
|
|
470
|
+
},
|
|
471
|
+
];
|
package/dist/utils.d.ts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { StatsSignals } from './statsCollector.types';
|
|
2
|
+
/**
|
|
3
|
+
* Create and return all required and optional (if specified with `more`),
|
|
4
|
+
* signals for infinity client to work
|
|
5
|
+
*
|
|
6
|
+
* @param scope - any scope prefix for the generated signal name, @see Signal
|
|
7
|
+
* @param more - Keys from `InfinitySignalsOptional`, @see InfinitySignalsOptional
|
|
8
|
+
*
|
|
9
|
+
* The following signals created by default
|
|
10
|
+
* - 'onConnected',
|
|
11
|
+
* - 'onAnswer',
|
|
12
|
+
*
|
|
13
|
+
* @see REQUIRED_STATS_SIGNAL_KEYS
|
|
14
|
+
*/
|
|
15
|
+
export declare const createStatsSignals: (scope?: string) => StatsSignals;
|
package/dist/utils.js
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { createSignal } from '@pexip/signal';
|
|
2
|
+
const SIGNAL_PREFIX = 'call:peerConnection:stats';
|
|
3
|
+
const REQUIRED_STATS_SIGNAL_KEYS = [
|
|
4
|
+
'onRtcStats',
|
|
5
|
+
'onCallQualityStats',
|
|
6
|
+
'onCallQuality',
|
|
7
|
+
];
|
|
8
|
+
/**
|
|
9
|
+
* Create and return all required and optional (if specified with `more`),
|
|
10
|
+
* signals for infinity client to work
|
|
11
|
+
*
|
|
12
|
+
* @param scope - any scope prefix for the generated signal name, @see Signal
|
|
13
|
+
* @param more - Keys from `InfinitySignalsOptional`, @see InfinitySignalsOptional
|
|
14
|
+
*
|
|
15
|
+
* The following signals created by default
|
|
16
|
+
* - 'onConnected',
|
|
17
|
+
* - 'onAnswer',
|
|
18
|
+
*
|
|
19
|
+
* @see REQUIRED_STATS_SIGNAL_KEYS
|
|
20
|
+
*/
|
|
21
|
+
export const createStatsSignals = (scope = '') => {
|
|
22
|
+
const signalScope = scope && [scope, ':'].join('');
|
|
23
|
+
return REQUIRED_STATS_SIGNAL_KEYS.reduce((signals, key) => ({
|
|
24
|
+
...signals,
|
|
25
|
+
[key]: createSignal({
|
|
26
|
+
name: `${SIGNAL_PREFIX}:${signalScope}:${key}`,
|
|
27
|
+
allowEmittingWithoutObserver: true,
|
|
28
|
+
}),
|
|
29
|
+
}), {});
|
|
30
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pexip/peer-connection-stats",
|
|
3
|
-
"version": "17.
|
|
3
|
+
"version": "17.9.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",
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"directory": "src/aquila/packages/peer-connection-stats"
|
|
11
11
|
},
|
|
12
12
|
"license": "Apache-2.0",
|
|
13
|
-
"module": "dist/index.
|
|
13
|
+
"module": "dist/index.js",
|
|
14
14
|
"types": "dist/index.d.ts",
|
|
15
15
|
"files": [
|
|
16
16
|
"dist"
|
|
@@ -28,12 +28,12 @@
|
|
|
28
28
|
"typecheck": "yarn tsc --noEmit -p ."
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@pexip/signal": "16.
|
|
32
|
-
"@pexip/utils": "16.
|
|
31
|
+
"@pexip/signal": "16.7.0",
|
|
32
|
+
"@pexip/utils": "16.10.0"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
|
-
"@pexip/bundler": "16.
|
|
36
|
-
"typescript": "~5.
|
|
35
|
+
"@pexip/bundler": "16.6.0",
|
|
36
|
+
"typescript": "~5.3.0"
|
|
37
37
|
},
|
|
38
38
|
"publishConfig": {
|
|
39
39
|
"access": "public",
|