@observertc/observer-js 1.0.1-9d3744d.0 → 1.0.1-a98466e.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/lib/ObservedCall.d.ts +4 -5
- package/lib/ObservedCall.d.ts.map +1 -1
- package/lib/ObservedCall.js +8 -30
- package/lib/ObservedCallEventMonitor.d.ts +103 -0
- package/lib/ObservedCallEventMonitor.d.ts.map +1 -0
- package/lib/ObservedCallEventMonitor.js +312 -0
- package/lib/ObservedClient.d.ts +11 -1
- package/lib/ObservedClient.d.ts.map +1 -1
- package/lib/ObservedClient.js +183 -4
- package/lib/ObservedClientEventMonitor.d.ts +89 -0
- package/lib/ObservedClientEventMonitor.d.ts.map +1 -0
- package/lib/ObservedClientEventMonitor.js +247 -0
- package/lib/ObservedDataChannel.d.ts +2 -0
- package/lib/ObservedDataChannel.d.ts.map +1 -1
- package/lib/ObservedDataChannel.js +2 -0
- package/lib/ObservedInboundTrack.d.ts +2 -0
- package/lib/ObservedInboundTrack.d.ts.map +1 -1
- package/lib/ObservedInboundTrack.js +2 -0
- package/lib/ObservedOutboundTrack.d.ts +2 -0
- package/lib/ObservedOutboundTrack.d.ts.map +1 -1
- package/lib/ObservedOutboundTrack.js +2 -0
- package/lib/ObservedPeerConnection.d.ts.map +1 -1
- package/lib/ObservedPeerConnection.js +2 -0
- package/lib/Observer.d.ts +9 -5
- package/lib/Observer.d.ts.map +1 -1
- package/lib/Observer.js +17 -5
- package/lib/ObserverEventMonitor.d.ts +106 -0
- package/lib/ObserverEventMonitor.d.ts.map +1 -0
- package/lib/ObserverEventMonitor.js +320 -0
- package/lib/index.d.ts +2 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +5 -1
- package/lib/schema/ClientEventTypes.d.ts +60 -0
- package/lib/schema/ClientEventTypes.d.ts.map +1 -1
- package/lib/updaters/{OnAllCallObserverUpdater_.d.ts → OnAllCallObserverUpdater.d.ts} +3 -1
- package/lib/updaters/OnAllCallObserverUpdater.d.ts.map +1 -0
- package/lib/updaters/{OnAllCallObserverUpdater_.js → OnAllCallObserverUpdater.js} +13 -1
- package/lib/updaters/OnAllClientCallUpdater.d.ts +2 -0
- package/lib/updaters/OnAllClientCallUpdater.d.ts.map +1 -1
- package/lib/updaters/OnAllClientCallUpdater.js +16 -0
- package/lib/updaters/{OnAnyCallObserverUpdater_.d.ts → OnAnyCallObserverUpdater.d.ts} +2 -1
- package/lib/updaters/OnAnyCallObserverUpdater.d.ts.map +1 -0
- package/lib/updaters/{OnAnyCallObserverUpdater_.js → OnAnyCallObserverUpdater.js} +11 -1
- package/lib/updaters/OnAnyClientCallUpdater.d.ts +1 -0
- package/lib/updaters/OnAnyClientCallUpdater.d.ts.map +1 -1
- package/lib/updaters/OnAnyClientCallUpdater.js +11 -2
- package/lib/utils/MediasoupRemoteTrackResolver.d.ts +25 -0
- package/lib/utils/MediasoupRemoteTrackResolver.d.ts.map +1 -0
- package/lib/utils/MediasoupRemoteTrackResolver.js +110 -0
- package/package.json +1 -1
- package/src/ObservedCall.ts +9 -35
- package/src/ObservedCallEventMonitor.ts +389 -0
- package/src/ObservedClient.ts +203 -6
- package/src/ObservedClientEventMonitor.ts +301 -0
- package/src/ObservedDataChannel.ts +3 -0
- package/src/ObservedInboundTrack.ts +3 -0
- package/src/ObservedOutboundTrack.ts +3 -0
- package/src/ObservedPeerConnection.ts +2 -0
- package/src/Observer.ts +24 -9
- package/src/ObserverEventMonitor.ts +398 -0
- package/src/index.ts +2 -0
- package/src/schema/ClientEventTypes.ts +64 -0
- package/src/updaters/{OnAllCallObserverUpdater_.ts → OnAllCallObserverUpdater.ts} +14 -1
- package/src/updaters/OnAllClientCallUpdater.ts +15 -0
- package/src/updaters/{OnAnyCallObserverUpdater_.ts → OnAnyCallObserverUpdater.ts} +11 -2
- package/src/updaters/OnAnyClientCallUpdater.ts +9 -2
- package/src/utils/MediasoupRemoteTrackResolver.ts +155 -0
- package/lib/updaters/OnAllCallObserverUpdater_.d.ts.map +0 -1
- package/lib/updaters/OnAnyCallObserverUpdater_.d.ts.map +0 -1
package/lib/ObservedClient.js
CHANGED
|
@@ -25,6 +25,7 @@ class ObservedClient extends events_1.EventEmitter {
|
|
|
25
25
|
closed = false;
|
|
26
26
|
joinedAt;
|
|
27
27
|
leftAt;
|
|
28
|
+
closedAt;
|
|
28
29
|
// the timestamp of the CLIENT_JOINED event
|
|
29
30
|
operationSystem;
|
|
30
31
|
engine;
|
|
@@ -87,6 +88,7 @@ class ObservedClient extends events_1.EventEmitter {
|
|
|
87
88
|
totalNumberOfIssues = 0;
|
|
88
89
|
mediaDevices = [];
|
|
89
90
|
issues = [];
|
|
91
|
+
_injections = {};
|
|
90
92
|
constructor(settings, call) {
|
|
91
93
|
super();
|
|
92
94
|
this.call = call;
|
|
@@ -106,6 +108,7 @@ class ObservedClient extends events_1.EventEmitter {
|
|
|
106
108
|
return;
|
|
107
109
|
this.closed = true;
|
|
108
110
|
Array.from(this.observedPeerConnections.values()).forEach((peerConnection) => peerConnection.close());
|
|
111
|
+
this.closedAt = Date.now();
|
|
109
112
|
this.emit('close');
|
|
110
113
|
}
|
|
111
114
|
accept(sample) {
|
|
@@ -146,8 +149,11 @@ class ObservedClient extends events_1.EventEmitter {
|
|
|
146
149
|
this.usingTCP = false;
|
|
147
150
|
this.currentMinRttInMs = undefined;
|
|
148
151
|
this.currentMaxRttInMs = undefined;
|
|
152
|
+
this._mergeInjections(sample);
|
|
153
|
+
const clientEventsPostBuffer = [];
|
|
149
154
|
for (const clientEvent of sample.clientEvents ?? []) {
|
|
150
|
-
this._processClientEvent(clientEvent);
|
|
155
|
+
this._processClientEvent(clientEvent, clientEventsPostBuffer);
|
|
156
|
+
this.call.observer.emit('client-event', this, clientEvent);
|
|
151
157
|
}
|
|
152
158
|
for (const metaData of sample.clientMetaItems ?? []) {
|
|
153
159
|
this.addMetadata(metaData);
|
|
@@ -212,7 +218,9 @@ class ObservedClient extends events_1.EventEmitter {
|
|
|
212
218
|
++numberOfRttMeasurements;
|
|
213
219
|
}
|
|
214
220
|
}
|
|
215
|
-
|
|
221
|
+
for (const clientEvent of clientEventsPostBuffer) {
|
|
222
|
+
this._processClientEvent(clientEvent);
|
|
223
|
+
}
|
|
216
224
|
// emit new attachments?
|
|
217
225
|
this.attachments = sample.attachments;
|
|
218
226
|
this.totalDataChannelBytesReceived += this.deltaDataChannelBytesReceived;
|
|
@@ -252,7 +260,7 @@ class ObservedClient extends events_1.EventEmitter {
|
|
|
252
260
|
++this.numberOfScoreMeasurements;
|
|
253
261
|
}
|
|
254
262
|
}
|
|
255
|
-
_processClientEvent(event) {
|
|
263
|
+
_processClientEvent(event, postBuffer) {
|
|
256
264
|
// eslint-disable-next-line no-console
|
|
257
265
|
// console.warn('ClientEvent', event);
|
|
258
266
|
switch (event.type) {
|
|
@@ -284,8 +292,143 @@ class ObservedClient extends events_1.EventEmitter {
|
|
|
284
292
|
}
|
|
285
293
|
break;
|
|
286
294
|
}
|
|
295
|
+
case ClientEventTypes_1.ClientEventTypes.PEER_CONNECTION_OPENED: {
|
|
296
|
+
const payload = (0, utils_1.parseJsonAs)(event.payload);
|
|
297
|
+
if (payload?.peerConnectionId && typeof payload.peerConnectionId === 'string') {
|
|
298
|
+
const observedPeerConnection = this.observedPeerConnections.get(payload.peerConnectionId);
|
|
299
|
+
if (observedPeerConnection) {
|
|
300
|
+
observedPeerConnection.openedAt = event.timestamp;
|
|
301
|
+
}
|
|
302
|
+
else if (postBuffer) {
|
|
303
|
+
postBuffer.push(event);
|
|
304
|
+
}
|
|
305
|
+
else {
|
|
306
|
+
logger.warn('Received PEER_CONNECTION_OPENED event without a corresponding observedPeerConnection', event);
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
break;
|
|
310
|
+
}
|
|
311
|
+
case ClientEventTypes_1.ClientEventTypes.PEER_CONNECTION_CLOSED: {
|
|
312
|
+
const payload = (0, utils_1.parseJsonAs)(event.payload);
|
|
313
|
+
if (payload?.peerConnectionId && typeof payload.peerConnectionId === 'string') {
|
|
314
|
+
const observedPeerConnection = this.observedPeerConnections.get(payload.peerConnectionId);
|
|
315
|
+
if (observedPeerConnection) {
|
|
316
|
+
observedPeerConnection.closedAt = event.timestamp;
|
|
317
|
+
}
|
|
318
|
+
else if (postBuffer) {
|
|
319
|
+
postBuffer.push(event);
|
|
320
|
+
}
|
|
321
|
+
else {
|
|
322
|
+
logger.warn('Received PEER_CONNECTION_CLOSED event without a corresponding observedPeerConnection', event);
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
break;
|
|
326
|
+
}
|
|
327
|
+
case ClientEventTypes_1.ClientEventTypes.MEDIA_TRACK_ADDED: {
|
|
328
|
+
const payload = (0, utils_1.parseJsonAs)(event.payload);
|
|
329
|
+
if (payload?.peerConnectionId && typeof payload.peerConnectionId === 'string' && payload?.trackId && typeof payload.trackId === 'string') {
|
|
330
|
+
const observedPeerConnection = this.observedPeerConnections.get(payload.peerConnectionId);
|
|
331
|
+
const observedTrack = observedPeerConnection?.observedInboundTracks.get(payload.trackId) ?? observedPeerConnection?.observedOutboundTracks.get(payload.trackId);
|
|
332
|
+
if (observedTrack) {
|
|
333
|
+
observedTrack.addedAt = event.timestamp;
|
|
334
|
+
}
|
|
335
|
+
else if (postBuffer) {
|
|
336
|
+
postBuffer.push(event);
|
|
337
|
+
}
|
|
338
|
+
else {
|
|
339
|
+
logger.warn('Received MEDIA_TRACK_ADDED event without a corresponding observedPeerConnection or observedTrack', event);
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
break;
|
|
343
|
+
}
|
|
344
|
+
case ClientEventTypes_1.ClientEventTypes.MEDIA_TRACK_REMOVED: {
|
|
345
|
+
const payload = (0, utils_1.parseJsonAs)(event.payload);
|
|
346
|
+
if (payload?.peerConnectionId && typeof payload.peerConnectionId === 'string' && payload?.trackId && typeof payload.trackId === 'string') {
|
|
347
|
+
const observedPeerConnection = this.observedPeerConnections.get(payload.peerConnectionId);
|
|
348
|
+
const observedTrack = observedPeerConnection?.observedInboundTracks.get(payload.trackId) ?? observedPeerConnection?.observedOutboundTracks.get(payload.trackId);
|
|
349
|
+
if (observedTrack) {
|
|
350
|
+
observedTrack.removedAt = event.timestamp;
|
|
351
|
+
}
|
|
352
|
+
else if (postBuffer) {
|
|
353
|
+
postBuffer.push(event);
|
|
354
|
+
}
|
|
355
|
+
else {
|
|
356
|
+
logger.warn('Received MEDIA_TRACK_REMOVED event without a corresponding observedPeerConnection or observedTrack', event);
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
break;
|
|
360
|
+
}
|
|
361
|
+
case ClientEventTypes_1.ClientEventTypes.DATA_CHANNEL_OPEN: {
|
|
362
|
+
const payload = (0, utils_1.parseJsonAs)(event.payload);
|
|
363
|
+
if (payload?.peerConnectionId && typeof payload.peerConnectionId === 'string' && payload?.dataChannelId && typeof payload.dataChannelId === 'string') {
|
|
364
|
+
const observedPeerConnection = this.observedPeerConnections.get(payload.peerConnectionId);
|
|
365
|
+
const observedDataChannel = observedPeerConnection?.observedDataChannels.get(payload.dataChannelId);
|
|
366
|
+
if (observedDataChannel) {
|
|
367
|
+
observedDataChannel.addedAt = event.timestamp;
|
|
368
|
+
}
|
|
369
|
+
else if (postBuffer) {
|
|
370
|
+
postBuffer.push(event);
|
|
371
|
+
}
|
|
372
|
+
else {
|
|
373
|
+
logger.warn('Received DATA_CHANNEL_OPENED event without a corresponding observedPeerConnection or observedDataChannel', event);
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
break;
|
|
377
|
+
}
|
|
378
|
+
case ClientEventTypes_1.ClientEventTypes.DATA_CHANNEL_CLOSED: {
|
|
379
|
+
const payload = (0, utils_1.parseJsonAs)(event.payload);
|
|
380
|
+
if (payload?.peerConnectionId && typeof payload.peerConnectionId === 'string' && payload?.dataChannelId && typeof payload.dataChannelId === 'string') {
|
|
381
|
+
const observedPeerConnection = this.observedPeerConnections.get(payload.peerConnectionId);
|
|
382
|
+
const observedDataChannel = observedPeerConnection?.observedDataChannels.get(payload.dataChannelId);
|
|
383
|
+
if (observedDataChannel) {
|
|
384
|
+
observedDataChannel.removedAt = event.timestamp;
|
|
385
|
+
}
|
|
386
|
+
else if (postBuffer) {
|
|
387
|
+
postBuffer.push(event);
|
|
388
|
+
}
|
|
389
|
+
else {
|
|
390
|
+
logger.warn('Received DATA_CHANNEL_CLOSE event without a corresponding observedPeerConnection or observedDataChannel', event);
|
|
391
|
+
}
|
|
392
|
+
}
|
|
393
|
+
break;
|
|
394
|
+
}
|
|
287
395
|
}
|
|
288
|
-
this.
|
|
396
|
+
this.emit('clientEvent', event);
|
|
397
|
+
}
|
|
398
|
+
injectMetaData(metaData) {
|
|
399
|
+
if (this.closed)
|
|
400
|
+
return;
|
|
401
|
+
if (!this._injections.clientMetaItems)
|
|
402
|
+
this._injections.clientMetaItems = [];
|
|
403
|
+
this._injections.clientMetaItems.push(metaData);
|
|
404
|
+
}
|
|
405
|
+
injectEvent(event) {
|
|
406
|
+
if (this.closed)
|
|
407
|
+
return;
|
|
408
|
+
if (!this._injections.clientEvents)
|
|
409
|
+
this._injections.clientEvents = [];
|
|
410
|
+
this._injections.clientEvents.push(event);
|
|
411
|
+
}
|
|
412
|
+
injectIssue(issue) {
|
|
413
|
+
if (this.closed)
|
|
414
|
+
return;
|
|
415
|
+
if (!this._injections.clientIssues)
|
|
416
|
+
this._injections.clientIssues = [];
|
|
417
|
+
this._injections.clientIssues.push(issue);
|
|
418
|
+
}
|
|
419
|
+
injectExtensionStat(stat) {
|
|
420
|
+
if (this.closed)
|
|
421
|
+
return;
|
|
422
|
+
if (!this._injections.extensionStats)
|
|
423
|
+
this._injections.extensionStats = [];
|
|
424
|
+
this._injections.extensionStats.push(stat);
|
|
425
|
+
}
|
|
426
|
+
injectAttachment(key, value) {
|
|
427
|
+
if (this.closed)
|
|
428
|
+
return;
|
|
429
|
+
if (!this._injections.attachments)
|
|
430
|
+
this._injections.attachments = {};
|
|
431
|
+
this._injections.attachments[key] = value;
|
|
289
432
|
}
|
|
290
433
|
addMetadata(metadata) {
|
|
291
434
|
if (this.closed)
|
|
@@ -318,6 +461,7 @@ class ObservedClient extends events_1.EventEmitter {
|
|
|
318
461
|
}
|
|
319
462
|
addExtensionStats(stats) {
|
|
320
463
|
this.call.observer.emit('client-extension-stats', this, stats);
|
|
464
|
+
this.emit('extensionStats', stats);
|
|
321
465
|
}
|
|
322
466
|
_updatePeerConnection(sample) {
|
|
323
467
|
let observedPeerConnection = this.observedPeerConnections.get(sample.peerConnectionId);
|
|
@@ -335,5 +479,40 @@ class ObservedClient extends events_1.EventEmitter {
|
|
|
335
479
|
observedPeerConnection.accept(sample);
|
|
336
480
|
return observedPeerConnection;
|
|
337
481
|
}
|
|
482
|
+
_mergeInjections(sample) {
|
|
483
|
+
if (this.closed)
|
|
484
|
+
return sample;
|
|
485
|
+
if (this._injections.clientEvents) {
|
|
486
|
+
if (!sample.clientEvents)
|
|
487
|
+
sample.clientEvents = [];
|
|
488
|
+
sample.clientEvents.push(...this._injections.clientEvents);
|
|
489
|
+
this._injections.clientEvents = undefined;
|
|
490
|
+
}
|
|
491
|
+
if (this._injections.clientIssues) {
|
|
492
|
+
if (!sample.clientIssues)
|
|
493
|
+
sample.clientIssues = [];
|
|
494
|
+
sample.clientIssues.push(...this._injections.clientIssues);
|
|
495
|
+
this._injections.clientIssues = undefined;
|
|
496
|
+
}
|
|
497
|
+
if (this._injections.extensionStats) {
|
|
498
|
+
if (!sample.extensionStats)
|
|
499
|
+
sample.extensionStats = [];
|
|
500
|
+
sample.extensionStats.push(...this._injections.extensionStats);
|
|
501
|
+
this._injections.extensionStats = undefined;
|
|
502
|
+
}
|
|
503
|
+
if (this._injections.attachments) {
|
|
504
|
+
if (!sample.attachments)
|
|
505
|
+
sample.attachments = {};
|
|
506
|
+
Object.assign(sample.attachments, this._injections.attachments);
|
|
507
|
+
this._injections.attachments = undefined;
|
|
508
|
+
}
|
|
509
|
+
if (this._injections.clientMetaItems) {
|
|
510
|
+
if (!sample.clientMetaItems)
|
|
511
|
+
sample.clientMetaItems = [];
|
|
512
|
+
sample.clientMetaItems.push(...this._injections.clientMetaItems);
|
|
513
|
+
this._injections.clientMetaItems = undefined;
|
|
514
|
+
}
|
|
515
|
+
return sample;
|
|
516
|
+
}
|
|
338
517
|
}
|
|
339
518
|
exports.ObservedClient = ObservedClient;
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { ObservedCertificate } from './ObservedCertificate';
|
|
2
|
+
import { ObservedClient } from './ObservedClient';
|
|
3
|
+
import { ObservedCodec } from './ObservedCodec';
|
|
4
|
+
import { ObservedDataChannel } from './ObservedDataChannel';
|
|
5
|
+
import { ObservedIceCandidate } from './ObservedIceCandidate';
|
|
6
|
+
import { ObservedIceCandidatePair } from './ObservedIceCandidatePair';
|
|
7
|
+
import { ObservedIceTransport } from './ObservedIceTransport';
|
|
8
|
+
import { ObservedInboundRtp } from './ObservedInboundRtp';
|
|
9
|
+
import { ObservedInboundTrack } from './ObservedInboundTrack';
|
|
10
|
+
import { ObservedMediaPlayout } from './ObservedMediaPlayout';
|
|
11
|
+
import { ObservedMediaSource } from './ObservedMediaSource';
|
|
12
|
+
import { ObservedOutboundRtp } from './ObservedOutboundRtp';
|
|
13
|
+
import { ObservedOutboundTrack } from './ObservedOutboundTrack';
|
|
14
|
+
import { ObservedPeerConnection } from './ObservedPeerConnection';
|
|
15
|
+
import { ClientIssue, ClientMetaData, ExtensionStat } from './schema/ClientSample';
|
|
16
|
+
export declare class ObservedClientEventMonitor<Context> {
|
|
17
|
+
readonly observedClient: ObservedClient;
|
|
18
|
+
readonly context: Context;
|
|
19
|
+
constructor(observedClient: ObservedClient, context: Context);
|
|
20
|
+
onClientClosed?: (client: ObservedClient, ctx: Context) => void;
|
|
21
|
+
private _onClientClosed;
|
|
22
|
+
onPeerConnectionAdded?: (peerConnection: ObservedPeerConnection, ctx: Context) => void;
|
|
23
|
+
private _onPeerConnconnectionAdded;
|
|
24
|
+
onPeerConnectionRemoved?: (peerConnection: ObservedPeerConnection, ctx: Context) => void;
|
|
25
|
+
private _onPeerConnectionRemoved;
|
|
26
|
+
onCertificateAdded?: (certificate: ObservedCertificate, ctx: Context) => void;
|
|
27
|
+
private _onCertificateAdded;
|
|
28
|
+
onCertificateRemoved?: (certificate: ObservedCertificate, ctx: Context) => void;
|
|
29
|
+
private _onCertificateRemoved;
|
|
30
|
+
onInboundTrackAdded?: (inboundTrack: ObservedInboundTrack, ctx: Context) => void;
|
|
31
|
+
private _onInboundTrackAdded;
|
|
32
|
+
onInboundTrackRemoved?: (inboundTrack: ObservedInboundTrack, ctx: Context) => void;
|
|
33
|
+
private _onInboundTrackRemoved;
|
|
34
|
+
onOutboundTrackAdded?: (outboundTrack: ObservedOutboundTrack, ctx: Context) => void;
|
|
35
|
+
private _onOutboundTrackAdded;
|
|
36
|
+
onOutboundTrackRemoved?: (outboundTrack: ObservedOutboundTrack, ctx: Context) => void;
|
|
37
|
+
private _onOutboundTrackRemoved;
|
|
38
|
+
onInboundRtpAdded?: (inboundRtp: ObservedInboundRtp, ctx: Context) => void;
|
|
39
|
+
private _onInboundRtpAdded;
|
|
40
|
+
onInboundRtpRemoved?: (inboundRtp: ObservedInboundRtp, ctx: Context) => void;
|
|
41
|
+
private _onInboundRtpRemoved;
|
|
42
|
+
onOutboundRtpAdded?: (outboundRtp: ObservedOutboundRtp, ctx: Context) => void;
|
|
43
|
+
private _onOutboundRtpAdded;
|
|
44
|
+
onOutboundRtpRemoved?: (outboundRtp: ObservedOutboundRtp, ctx: Context) => void;
|
|
45
|
+
private _onOutboundRtpRemoved;
|
|
46
|
+
onDataChannelAdded?: (dataChannel: ObservedDataChannel, ctx: Context) => void;
|
|
47
|
+
private _onDataChannelAdded;
|
|
48
|
+
onDataChannelRemoved?: (dataChannel: ObservedDataChannel, ctx: Context) => void;
|
|
49
|
+
private _onDataChannelRemoved;
|
|
50
|
+
onAddedIceTransport?: (iceTransport: ObservedIceTransport, ctx: Context) => void;
|
|
51
|
+
private _onAddedIceTransport;
|
|
52
|
+
onRemovedIceTransport?: (iceTransport: ObservedIceTransport, ctx: Context) => void;
|
|
53
|
+
private _onRemovedIceTransport;
|
|
54
|
+
onIceCandidateAdded?: (iceCandidate: ObservedIceCandidate, ctx: Context) => void;
|
|
55
|
+
private _onIceCandidateAdded;
|
|
56
|
+
onIceCandidateRemoved?: (iceCandidate: ObservedIceCandidate, ctx: Context) => void;
|
|
57
|
+
private _onIceCandidateRemoved;
|
|
58
|
+
onAddedIceCandidatePair?: (candidatePair: ObservedIceCandidatePair, ctx: Context) => void;
|
|
59
|
+
private _onAddedIceCandidatePair;
|
|
60
|
+
onRemovedIceCandidatePair?: (candidatePair: ObservedIceCandidatePair, ctx: Context) => void;
|
|
61
|
+
private _onRemovedIceCandidatePair;
|
|
62
|
+
onAddedMediaCodec?: (codec: ObservedCodec, ctx: Context) => void;
|
|
63
|
+
private _onAddedMediaCodec;
|
|
64
|
+
onRemovedMediaCodec?: (codec: ObservedCodec, ctx: Context) => void;
|
|
65
|
+
private _onRemovedMediaCodec;
|
|
66
|
+
onAddedMediaPlayout?: (mediaPlayout: ObservedMediaPlayout, ctx: Context) => void;
|
|
67
|
+
private _onAddedMediaPlayout;
|
|
68
|
+
onRemovedMediaPlayout?: (mediaPlayout: ObservedMediaPlayout, ctx: Context) => void;
|
|
69
|
+
private _onRemovedMediaPlayout;
|
|
70
|
+
onMediaSourceAdded?: (mediaSource: ObservedMediaSource, ctx: Context) => void;
|
|
71
|
+
private _onMediaSourceAdded;
|
|
72
|
+
onMediaSourceRemoved?: (mediaSource: ObservedMediaSource, ctx: Context) => void;
|
|
73
|
+
private _onMediaSourceRemoved;
|
|
74
|
+
onClientIssue?: (issue: ClientIssue, ctx: Context) => void;
|
|
75
|
+
private _onClientIssue;
|
|
76
|
+
onClientMetadata?: (metadata: ClientMetaData, ctx: Context) => void;
|
|
77
|
+
private _onClientMetadata;
|
|
78
|
+
onClientExtensionStats?: (extensionStats: ExtensionStat, ctx: Context) => void;
|
|
79
|
+
private _onClientExtensionStats;
|
|
80
|
+
onClientJoined?: (client: ObservedClient, ctx: Context) => void;
|
|
81
|
+
private _onClientJoined;
|
|
82
|
+
onClientLeft?: (client: ObservedClient, ctx: Context) => void;
|
|
83
|
+
private _onClientLeft;
|
|
84
|
+
onUserMediaError?: (error: string, observedClient: ObservedClient, ctx: Context) => void;
|
|
85
|
+
private _onUserMediaError;
|
|
86
|
+
onUsingTurn?: (client: ObservedClient, ctx: Context) => void;
|
|
87
|
+
private _onUsingTurn;
|
|
88
|
+
}
|
|
89
|
+
//# sourceMappingURL=ObservedClientEventMonitor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ObservedClientEventMonitor.d.ts","sourceRoot":"","sources":["../src/ObservedClientEventMonitor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AACtE,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,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E,CAAC,QAAQ,EAAE,cAAc,EAAE,GAAG,EAAE,OAAO,KAAK,IAAI,CAAC;IAC3E,OAAO,CAAC,iBAAiB;IAIlB,sBAAsB,CAAC,EAAE,CAAC,cAAc,EAAE,aAAa,EAAE,GAAG,EAAE,OAAO,KAAK,IAAI,CAAC;IACtF,OAAO,CAAC,uBAAuB;IAIxB,cAAc,CAAC,EAAE,CAAC,MAAM,EAAE,cAAc,EAAE,GAAG,EAAE,OAAO,KAAK,IAAI,CAAC;IACvE,OAAO,CAAC,eAAe;IAIhB,YAAY,CAAC,EAAE,CAAC,MAAM,EAAE,cAAc,EAAE,GAAG,EAAE,OAAO,KAAK,IAAI,CAAC;IACrE,OAAO,CAAC,aAAa;IAId,gBAAgB,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,cAAc,EAAE,cAAc,EAAE,GAAG,EAAE,OAAO,KAAK,IAAI,CAAC;IAChG,OAAO,CAAC,iBAAiB;IAIlB,WAAW,CAAC,EAAE,CAAC,MAAM,EAAE,cAAc,EAAE,GAAG,EAAE,OAAO,KAAK,IAAI,CAAC;IACpE,OAAO,CAAC,YAAY;CAGpB"}
|
|
@@ -0,0 +1,247 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ObservedClientEventMonitor = void 0;
|
|
4
|
+
class ObservedClientEventMonitor {
|
|
5
|
+
observedClient;
|
|
6
|
+
context;
|
|
7
|
+
constructor(observedClient, context) {
|
|
8
|
+
this.observedClient = observedClient;
|
|
9
|
+
this.context = context;
|
|
10
|
+
this._onPeerConnconnectionAdded = this._onPeerConnconnectionAdded.bind(this);
|
|
11
|
+
this._onPeerConnectionRemoved = this._onPeerConnectionRemoved.bind(this);
|
|
12
|
+
this._onCertificateAdded = this._onCertificateAdded.bind(this);
|
|
13
|
+
this._onCertificateRemoved = this._onCertificateRemoved.bind(this);
|
|
14
|
+
this._onInboundTrackAdded = this._onInboundTrackAdded.bind(this);
|
|
15
|
+
this._onInboundTrackRemoved = this._onInboundTrackRemoved.bind(this);
|
|
16
|
+
this._onOutboundTrackAdded = this._onOutboundTrackAdded.bind(this);
|
|
17
|
+
this._onOutboundTrackRemoved = this._onOutboundTrackRemoved.bind(this);
|
|
18
|
+
this._onInboundRtpAdded = this._onInboundRtpAdded.bind(this);
|
|
19
|
+
this._onInboundRtpRemoved = this._onInboundRtpRemoved.bind(this);
|
|
20
|
+
this._onOutboundRtpAdded = this._onOutboundRtpAdded.bind(this);
|
|
21
|
+
this._onOutboundRtpRemoved = this._onOutboundRtpRemoved.bind(this);
|
|
22
|
+
this._onDataChannelAdded = this._onDataChannelAdded.bind(this);
|
|
23
|
+
this._onDataChannelRemoved = this._onDataChannelRemoved.bind(this);
|
|
24
|
+
this._onAddedIceTransport = this._onAddedIceTransport.bind(this);
|
|
25
|
+
this._onRemovedIceTransport = this._onRemovedIceTransport.bind(this);
|
|
26
|
+
this._onIceCandidateAdded = this._onIceCandidateAdded.bind(this);
|
|
27
|
+
this._onIceCandidateRemoved = this._onIceCandidateRemoved.bind(this);
|
|
28
|
+
this._onAddedIceCandidatePair = this._onAddedIceCandidatePair.bind(this);
|
|
29
|
+
this._onRemovedIceCandidatePair = this._onRemovedIceCandidatePair.bind(this);
|
|
30
|
+
this._onAddedMediaCodec = this._onAddedMediaCodec.bind(this);
|
|
31
|
+
this._onRemovedMediaCodec = this._onRemovedMediaCodec.bind(this);
|
|
32
|
+
this._onAddedMediaPlayout = this._onAddedMediaPlayout.bind(this);
|
|
33
|
+
this._onRemovedMediaPlayout = this._onRemovedMediaPlayout.bind(this);
|
|
34
|
+
this._onMediaSourceAdded = this._onMediaSourceAdded.bind(this);
|
|
35
|
+
this._onMediaSourceRemoved = this._onMediaSourceRemoved.bind(this);
|
|
36
|
+
this._onClientClosed = this._onClientClosed.bind(this);
|
|
37
|
+
this._onClientIssue = this._onClientIssue.bind(this);
|
|
38
|
+
this._onClientMetadata = this._onClientMetadata.bind(this);
|
|
39
|
+
this._onClientJoined = this._onClientJoined.bind(this);
|
|
40
|
+
this._onClientLeft = this._onClientLeft.bind(this);
|
|
41
|
+
this._onUserMediaError = this._onUserMediaError.bind(this);
|
|
42
|
+
this._onUsingTurn = this._onUsingTurn.bind(this);
|
|
43
|
+
this.observedClient.on('newpeerconnection', this._onPeerConnconnectionAdded);
|
|
44
|
+
this.observedClient.on('issue', this._onClientIssue);
|
|
45
|
+
this.observedClient.on('metaData', this._onClientMetadata);
|
|
46
|
+
this.observedClient.on('joined', this._onClientJoined);
|
|
47
|
+
this.observedClient.on('left', this._onClientLeft);
|
|
48
|
+
this.observedClient.on('rejoined', this._onClientJoined);
|
|
49
|
+
this.observedClient.on('usermediaerror', this._onUserMediaError);
|
|
50
|
+
this.observedClient.on('usingturn', this._onUsingTurn);
|
|
51
|
+
this.observedClient.once('close', this._onClientClosed);
|
|
52
|
+
}
|
|
53
|
+
onClientClosed;
|
|
54
|
+
_onClientClosed() {
|
|
55
|
+
this.onClientClosed?.(this.observedClient, this.context);
|
|
56
|
+
this.observedClient.off('newpeerconnection', this._onPeerConnconnectionAdded);
|
|
57
|
+
this.observedClient.off('issue', this._onClientIssue);
|
|
58
|
+
this.observedClient.off('metaData', this._onClientMetadata);
|
|
59
|
+
this.observedClient.off('joined', this._onClientJoined);
|
|
60
|
+
this.observedClient.off('left', this._onClientLeft);
|
|
61
|
+
this.observedClient.off('rejoined', this._onClientJoined);
|
|
62
|
+
this.observedClient.off('usermediaerror', this._onUserMediaError);
|
|
63
|
+
this.observedClient.off('usingturn', this._onUsingTurn);
|
|
64
|
+
}
|
|
65
|
+
onPeerConnectionAdded;
|
|
66
|
+
_onPeerConnconnectionAdded(peerConnection) {
|
|
67
|
+
this.onPeerConnectionAdded?.(peerConnection, this.context);
|
|
68
|
+
peerConnection.once('close', () => this._onPeerConnectionRemoved(peerConnection));
|
|
69
|
+
peerConnection.on('added-certificate', this._onCertificateAdded);
|
|
70
|
+
peerConnection.on('removed-certificate', this._onCertificateRemoved);
|
|
71
|
+
peerConnection.on('added-inbound-track', this._onInboundTrackAdded);
|
|
72
|
+
peerConnection.on('removed-inbound-track', this._onInboundTrackRemoved);
|
|
73
|
+
peerConnection.on('added-outbound-track', this._onOutboundTrackAdded);
|
|
74
|
+
peerConnection.on('removed-outbound-track', this._onOutboundTrackRemoved);
|
|
75
|
+
peerConnection.on('added-inbound-rtp', this._onInboundRtpAdded);
|
|
76
|
+
peerConnection.on('removed-inbound-rtp', this._onInboundRtpRemoved);
|
|
77
|
+
peerConnection.on('added-outbound-rtp', this._onOutboundRtpAdded);
|
|
78
|
+
peerConnection.on('removed-outbound-rtp', this._onOutboundRtpRemoved);
|
|
79
|
+
peerConnection.on('added-data-channel', this._onDataChannelAdded);
|
|
80
|
+
peerConnection.on('removed-data-channel', this._onDataChannelRemoved);
|
|
81
|
+
peerConnection.on('added-ice-transport', this._onAddedIceTransport);
|
|
82
|
+
peerConnection.on('removed-ice-transport', this._onRemovedIceTransport);
|
|
83
|
+
peerConnection.on('added-ice-candidate', this._onIceCandidateAdded);
|
|
84
|
+
peerConnection.on('removed-ice-candidate', this._onIceCandidateRemoved);
|
|
85
|
+
peerConnection.on('added-ice-candidate-pair', this._onAddedIceCandidatePair);
|
|
86
|
+
peerConnection.on('removed-ice-candidate-pair', this._onRemovedIceCandidatePair);
|
|
87
|
+
peerConnection.on('added-codec', this._onAddedMediaCodec);
|
|
88
|
+
peerConnection.on('removed-codec', this._onRemovedMediaCodec);
|
|
89
|
+
peerConnection.on('added-media-playout', this._onAddedMediaPlayout);
|
|
90
|
+
peerConnection.on('removed-media-playout', this._onRemovedMediaPlayout);
|
|
91
|
+
peerConnection.on('added-media-source', this._onMediaSourceAdded);
|
|
92
|
+
peerConnection.on('removed-media-source', this._onMediaSourceRemoved);
|
|
93
|
+
}
|
|
94
|
+
onPeerConnectionRemoved;
|
|
95
|
+
_onPeerConnectionRemoved(peerConnection) {
|
|
96
|
+
this.onPeerConnectionRemoved?.(peerConnection, this.context);
|
|
97
|
+
peerConnection.off('added-certificate', this._onCertificateAdded);
|
|
98
|
+
peerConnection.off('removed-certificate', this._onCertificateRemoved);
|
|
99
|
+
peerConnection.off('added-inbound-track', this._onInboundTrackAdded);
|
|
100
|
+
peerConnection.off('removed-inbound-track', this._onInboundTrackRemoved);
|
|
101
|
+
peerConnection.off('added-outbound-track', this._onOutboundTrackAdded);
|
|
102
|
+
peerConnection.off('removed-outbound-track', this._onOutboundTrackRemoved);
|
|
103
|
+
peerConnection.off('added-inbound-rtp', this._onInboundRtpAdded);
|
|
104
|
+
peerConnection.off('removed-inbound-rtp', this._onInboundRtpRemoved);
|
|
105
|
+
peerConnection.off('added-outbound-rtp', this._onOutboundRtpAdded);
|
|
106
|
+
peerConnection.off('removed-outbound-rtp', this._onOutboundRtpRemoved);
|
|
107
|
+
peerConnection.off('added-data-channel', this._onDataChannelAdded);
|
|
108
|
+
peerConnection.off('removed-data-channel', this._onDataChannelRemoved);
|
|
109
|
+
peerConnection.off('added-ice-transport', this._onAddedIceTransport);
|
|
110
|
+
peerConnection.off('removed-ice-transport', this._onRemovedIceTransport);
|
|
111
|
+
peerConnection.off('added-ice-candidate', this._onIceCandidateAdded);
|
|
112
|
+
peerConnection.off('removed-ice-candidate', this._onIceCandidateRemoved);
|
|
113
|
+
peerConnection.off('added-ice-candidate-pair', this._onAddedIceCandidatePair);
|
|
114
|
+
peerConnection.off('removed-ice-candidate-pair', this._onRemovedIceCandidatePair);
|
|
115
|
+
peerConnection.off('added-codec', this._onAddedMediaCodec);
|
|
116
|
+
peerConnection.off('removed-codec', this._onRemovedMediaCodec);
|
|
117
|
+
peerConnection.off('added-media-playout', this._onAddedMediaPlayout);
|
|
118
|
+
peerConnection.off('removed-media-playout', this._onRemovedMediaPlayout);
|
|
119
|
+
peerConnection.off('added-media-source', this._onMediaSourceAdded);
|
|
120
|
+
peerConnection.off('removed-media-source', this._onMediaSourceRemoved);
|
|
121
|
+
}
|
|
122
|
+
onCertificateAdded;
|
|
123
|
+
_onCertificateAdded(certificate) {
|
|
124
|
+
this.onCertificateAdded?.(certificate, this.context);
|
|
125
|
+
}
|
|
126
|
+
onCertificateRemoved;
|
|
127
|
+
_onCertificateRemoved(certificate) {
|
|
128
|
+
this.onCertificateRemoved?.(certificate, this.context);
|
|
129
|
+
}
|
|
130
|
+
onInboundTrackAdded;
|
|
131
|
+
_onInboundTrackAdded(inboundTrack) {
|
|
132
|
+
this.onInboundTrackAdded?.(inboundTrack, this.context);
|
|
133
|
+
}
|
|
134
|
+
onInboundTrackRemoved;
|
|
135
|
+
_onInboundTrackRemoved(inboundTrack) {
|
|
136
|
+
this.onInboundTrackRemoved?.(inboundTrack, this.context);
|
|
137
|
+
}
|
|
138
|
+
onOutboundTrackAdded;
|
|
139
|
+
_onOutboundTrackAdded(outboundTrack) {
|
|
140
|
+
this.onOutboundTrackAdded?.(outboundTrack, this.context);
|
|
141
|
+
}
|
|
142
|
+
onOutboundTrackRemoved;
|
|
143
|
+
_onOutboundTrackRemoved(outboundTrack) {
|
|
144
|
+
this.onOutboundTrackRemoved?.(outboundTrack, this.context);
|
|
145
|
+
}
|
|
146
|
+
onInboundRtpAdded;
|
|
147
|
+
_onInboundRtpAdded(inboundRtp) {
|
|
148
|
+
this.onInboundRtpAdded?.(inboundRtp, this.context);
|
|
149
|
+
}
|
|
150
|
+
onInboundRtpRemoved;
|
|
151
|
+
_onInboundRtpRemoved(inboundRtp) {
|
|
152
|
+
this.onInboundRtpRemoved?.(inboundRtp, this.context);
|
|
153
|
+
}
|
|
154
|
+
onOutboundRtpAdded;
|
|
155
|
+
_onOutboundRtpAdded(outboundRtp) {
|
|
156
|
+
this.onOutboundRtpAdded?.(outboundRtp, this.context);
|
|
157
|
+
}
|
|
158
|
+
onOutboundRtpRemoved;
|
|
159
|
+
_onOutboundRtpRemoved(outboundRtp) {
|
|
160
|
+
this.onOutboundRtpRemoved?.(outboundRtp, this.context);
|
|
161
|
+
}
|
|
162
|
+
onDataChannelAdded;
|
|
163
|
+
_onDataChannelAdded(dataChannel) {
|
|
164
|
+
this.onDataChannelAdded?.(dataChannel, this.context);
|
|
165
|
+
}
|
|
166
|
+
onDataChannelRemoved;
|
|
167
|
+
_onDataChannelRemoved(dataChannel) {
|
|
168
|
+
this.onDataChannelRemoved?.(dataChannel, this.context);
|
|
169
|
+
}
|
|
170
|
+
onAddedIceTransport;
|
|
171
|
+
_onAddedIceTransport(iceTransport) {
|
|
172
|
+
this.onAddedIceTransport?.(iceTransport, this.context);
|
|
173
|
+
}
|
|
174
|
+
onRemovedIceTransport;
|
|
175
|
+
_onRemovedIceTransport(iceTransport) {
|
|
176
|
+
this.onRemovedIceTransport?.(iceTransport, this.context);
|
|
177
|
+
}
|
|
178
|
+
onIceCandidateAdded;
|
|
179
|
+
_onIceCandidateAdded(iceCandidate) {
|
|
180
|
+
this.onIceCandidateAdded?.(iceCandidate, this.context);
|
|
181
|
+
}
|
|
182
|
+
onIceCandidateRemoved;
|
|
183
|
+
_onIceCandidateRemoved(iceCandidate) {
|
|
184
|
+
this.onIceCandidateRemoved?.(iceCandidate, this.context);
|
|
185
|
+
}
|
|
186
|
+
onAddedIceCandidatePair;
|
|
187
|
+
_onAddedIceCandidatePair(candidatePair) {
|
|
188
|
+
this.onAddedIceCandidatePair?.(candidatePair, this.context);
|
|
189
|
+
}
|
|
190
|
+
onRemovedIceCandidatePair;
|
|
191
|
+
_onRemovedIceCandidatePair(candidatePair) {
|
|
192
|
+
this.onRemovedIceCandidatePair?.(candidatePair, this.context);
|
|
193
|
+
}
|
|
194
|
+
onAddedMediaCodec;
|
|
195
|
+
_onAddedMediaCodec(codec) {
|
|
196
|
+
this.onAddedMediaCodec?.(codec, this.context);
|
|
197
|
+
}
|
|
198
|
+
onRemovedMediaCodec;
|
|
199
|
+
_onRemovedMediaCodec(codec) {
|
|
200
|
+
this.onRemovedMediaCodec?.(codec, this.context);
|
|
201
|
+
}
|
|
202
|
+
onAddedMediaPlayout;
|
|
203
|
+
_onAddedMediaPlayout(mediaPlayout) {
|
|
204
|
+
this.onAddedMediaPlayout?.(mediaPlayout, this.context);
|
|
205
|
+
}
|
|
206
|
+
onRemovedMediaPlayout;
|
|
207
|
+
_onRemovedMediaPlayout(mediaPlayout) {
|
|
208
|
+
this.onRemovedMediaPlayout?.(mediaPlayout, this.context);
|
|
209
|
+
}
|
|
210
|
+
onMediaSourceAdded;
|
|
211
|
+
_onMediaSourceAdded(mediaSource) {
|
|
212
|
+
this.onMediaSourceAdded?.(mediaSource, this.context);
|
|
213
|
+
}
|
|
214
|
+
onMediaSourceRemoved;
|
|
215
|
+
_onMediaSourceRemoved(mediaSource) {
|
|
216
|
+
this.onMediaSourceRemoved?.(mediaSource, this.context);
|
|
217
|
+
}
|
|
218
|
+
onClientIssue;
|
|
219
|
+
_onClientIssue(issue) {
|
|
220
|
+
this.onClientIssue?.(issue, this.context);
|
|
221
|
+
}
|
|
222
|
+
onClientMetadata;
|
|
223
|
+
_onClientMetadata(metadata) {
|
|
224
|
+
this.onClientMetadata?.(metadata, this.context);
|
|
225
|
+
}
|
|
226
|
+
onClientExtensionStats;
|
|
227
|
+
_onClientExtensionStats(extensionStats) {
|
|
228
|
+
this.onClientExtensionStats?.(extensionStats, this.context);
|
|
229
|
+
}
|
|
230
|
+
onClientJoined;
|
|
231
|
+
_onClientJoined() {
|
|
232
|
+
this.onClientJoined?.(this.observedClient, this.context);
|
|
233
|
+
}
|
|
234
|
+
onClientLeft;
|
|
235
|
+
_onClientLeft() {
|
|
236
|
+
this.onClientLeft?.(this.observedClient, this.context);
|
|
237
|
+
}
|
|
238
|
+
onUserMediaError;
|
|
239
|
+
_onUserMediaError(error) {
|
|
240
|
+
this.onUserMediaError?.(error, this.observedClient, this.context);
|
|
241
|
+
}
|
|
242
|
+
onUsingTurn;
|
|
243
|
+
_onUsingTurn() {
|
|
244
|
+
this.onUsingTurn?.(this.observedClient, this.context);
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
exports.ObservedClientEventMonitor = ObservedClientEventMonitor;
|
|
@@ -15,6 +15,8 @@ export declare class ObservedDataChannel implements DataChannelStats {
|
|
|
15
15
|
messagesReceived?: number | undefined;
|
|
16
16
|
bytesReceived?: number | undefined;
|
|
17
17
|
attachments?: Record<string, unknown> | undefined;
|
|
18
|
+
addedAt?: number | undefined;
|
|
19
|
+
removedAt?: number | undefined;
|
|
18
20
|
deltaBytesSent: number;
|
|
19
21
|
deltaBytesReceived: number;
|
|
20
22
|
deltaMessagesSent: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ObservedDataChannel.d.ts","sourceRoot":"","sources":["../src/ObservedDataChannel.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAEzD,MAAM,MAAM,wBAAwB,GAAG,YAAY,GAAG,MAAM,GAAG,SAAS,GAAG,QAAQ,CAAC;AAEpF,qBAAa,mBAAoB,YAAW,gBAAgB;
|
|
1
|
+
{"version":3,"file":"ObservedDataChannel.d.ts","sourceRoot":"","sources":["../src/ObservedDataChannel.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAEzD,MAAM,MAAM,wBAAwB,GAAG,YAAY,GAAG,MAAM,GAAG,SAAS,GAAG,QAAQ,CAAC;AAEpF,qBAAa,mBAAoB,YAAW,gBAAgB;IAwBnD,SAAS,EAAE,MAAM;IACjB,EAAE,EAAE,MAAM;IACjB,OAAO,CAAC,QAAQ,CAAC,eAAe;IAzBjC,OAAO,CAAC,QAAQ,CAAS;IAEzB,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC9B,qBAAqB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3C,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,YAAY,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAClC,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC/B,gBAAgB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACtC,aAAa,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACnC,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,CAAC;IAE3C,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7B,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAE/B,cAAc,SAAK;IACnB,kBAAkB,SAAK;IACvB,iBAAiB,SAAK;IACtB,qBAAqB,SAAK;IAE1B,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;gBAGjC,SAAS,EAAE,MAAM,EACjB,EAAE,EAAE,MAAM,EACA,eAAe,EAAE,sBAAsB;IAIzD,IAAW,OAAO,YAMjB;IAEM,iBAAiB;IAIjB,MAAM,CAAC,KAAK,EAAE,gBAAgB;CAqCrC"}
|
|
@@ -16,6 +16,8 @@ export declare class ObservedInboundTrack implements InboundTrackSample {
|
|
|
16
16
|
readonly calculatedScore: CalculatedScore;
|
|
17
17
|
appData?: Record<string, unknown>;
|
|
18
18
|
private _visited;
|
|
19
|
+
addedAt?: number | undefined;
|
|
20
|
+
removedAt?: number | undefined;
|
|
19
21
|
attachments?: Record<string, unknown> | undefined;
|
|
20
22
|
constructor(timestamp: number, id: string, kind: MediaKind, _peerConnection: ObservedPeerConnection, _inboundRtp?: ObservedInboundRtp | undefined, _mediaPlayout?: ObservedMediaPlayout | undefined);
|
|
21
23
|
get score(): number | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ObservedInboundTrack.d.ts","sourceRoot":"","sources":["../src/ObservedInboundTrack.ts"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AAM,EAAE,OAAO,CAAC,CAAC;IAEzC,OAAO,CAAC,QAAQ,CAAS;IAElB,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7B,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAEtC,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,CAAC;gBAG1C,SAAS,EAAE,MAAM,EACR,EAAE,EAAE,MAAM,EACV,IAAI,EAAE,SAAS,EACd,eAAe,EAAE,sBAAsB,EACvC,WAAW,CAAC,gCAAoB,EAChC,aAAa,CAAC,kCAAsB;IAKtD,IAAW,KAAK,uBAEf;IAED,IAAW,OAAO,YAMjB;IAEM,iBAAiB;IAIjB,aAAa;IAIb,eAAe;IAIf,sBAAsB;IAItB,MAAM,CAAC,KAAK,EAAE,kBAAkB,GAAG,IAAI;CAU9C"}
|
|
@@ -16,6 +16,8 @@ export declare class ObservedOutboundTrack implements OutboundTrackSample {
|
|
|
16
16
|
private _visited;
|
|
17
17
|
appData?: Record<string, unknown>;
|
|
18
18
|
readonly calculatedScore: CalculatedScore;
|
|
19
|
+
addedAt?: number | undefined;
|
|
20
|
+
removedAt?: number | undefined;
|
|
19
21
|
attachments?: Record<string, unknown> | undefined;
|
|
20
22
|
constructor(timestamp: number, id: string, kind: MediaKind, _peerConnection: ObservedPeerConnection, _outboundRtps?: ObservedOutboundRtp[] | undefined, _mediaSource?: ObservedMediaSource | undefined);
|
|
21
23
|
get score(): number | undefined;
|