@observertc/observer-js 1.0.1-7be4daa.0 → 1.0.1-7f7cf82.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.
@@ -29,8 +29,13 @@ export class ObserverEventMonitor<Context> {
29
29
  this._onInboundTrackRemoved = this._onInboundTrackRemoved.bind(this);
30
30
  this._onOutboundTrackAdded = this._onOutboundTrackAdded.bind(this);
31
31
  this._onOutboundTrackRemoved = this._onOutboundTrackRemoved.bind(this);
32
+ this._onOutboundTrackMuted = this._onOutboundTrackMuted.bind(this);
33
+ this._onOutboundTrackUnmuted = this._onOutboundTrackUnmuted.bind(this);
32
34
  this._onInboundRtpAdded = this._onInboundRtpAdded.bind(this);
33
35
  this._onInboundRtpRemoved = this._onInboundRtpRemoved.bind(this);
36
+ this._onInboundRtpUpdated = this._onInboundRtpUpdated.bind(this);
37
+ this._onOutboundTrackUpdated = this._onOutboundTrackUpdated.bind(this);
38
+ this._onInboundTrackUpdated = this._onInboundTrackUpdated.bind(this);
34
39
  this._onOutboundRtpAdded = this._onOutboundRtpAdded.bind(this);
35
40
  this._onOutboundRtpRemoved = this._onOutboundRtpRemoved.bind(this);
36
41
  this._onDataChannelAdded = this._onDataChannelAdded.bind(this);
@@ -57,6 +62,18 @@ export class ObserverEventMonitor<Context> {
57
62
  this._onCallAdded = this._onCallAdded.bind(this);
58
63
  this._onClientRejoined = this._onClientRejoined.bind(this);
59
64
  this._onClientExtensionStats = this._onClientExtensionStats.bind(this);
65
+ this._onCertificateUpdated = this._onCertificateUpdated.bind(this);
66
+ this._onInboundRtpUpdated = this._onInboundRtpUpdated.bind(this);
67
+ this._onOutboundRtpUpdated = this._onOutboundRtpUpdated.bind(this);
68
+ this._onInboundTrackUpdated = this._onInboundTrackUpdated.bind(this);
69
+ this._onOutboundTrackUpdated = this._onOutboundTrackUpdated.bind(this);
70
+ this._onDataChannelUpdated = this._onDataChannelUpdated.bind(this);
71
+ this._onIceTransportUpdated = this._onIceTransportUpdated.bind(this);
72
+ this._onIceCandidatePairUpdated = this._onIceCandidatePairUpdated.bind(this);
73
+ this._onMediaCodecUpdated = this._onMediaCodecUpdated.bind(this);
74
+ this._onMediaPlayoutUpdated = this._onMediaPlayoutUpdated.bind(this);
75
+ this._onMediaSourceUpdated = this._onMediaSourceUpdated.bind(this);
76
+ this._onIceCandidateUpdated = this._onIceCandidateUpdated.bind(this);
60
77
 
61
78
  this.observer.once('close', () => {
62
79
  this.observer.off('newcall', this._onCallAdded);
@@ -93,39 +110,55 @@ export class ObserverEventMonitor<Context> {
93
110
 
94
111
  public onCertificateAdded?: (certificate: ObservedCertificate, ctx: Context) => void;
95
112
  public onCertificateRemoved?: (certificate: ObservedCertificate, ctx: Context) => void;
113
+ public onCertificateUpdated?: (certificate: ObservedCertificate, ctx: Context) => void;
96
114
 
97
115
  public onInboundTrackAdded?: (inboundTrack: ObservedInboundTrack, ctx: Context) => void;
98
116
  public onInboundTrackRemoved?: (inboundTrack: ObservedInboundTrack, ctx: Context) => void;
117
+ public onInboundTrackUpdated?: (inboundTrack: ObservedInboundTrack, ctx: Context) => void;
118
+ public onInboundTrackMuted?: (inboundTrack: ObservedInboundTrack, ctx: Context) => void;
119
+ public onInboundTrackUnmuted?: (inboundTrack: ObservedInboundTrack, ctx: Context) => void;
99
120
 
100
121
  public onOutboundTrackAdded?: (outboundTrack: ObservedOutboundTrack, ctx: Context) => void;
101
122
  public onOutboundTrackRemoved?: (outboundTrack: ObservedOutboundTrack, ctx: Context) => void;
123
+ public onOutboundTrackUpdated?: (outboundTrack: ObservedOutboundTrack, ctx: Context) => void;
124
+ public onOutboundTrackMuted?: (outboundTrack: ObservedOutboundTrack, ctx: Context) => void;
125
+ public onOutboundTrackUnmuted?: (outboundTrack: ObservedOutboundTrack, ctx: Context) => void;
102
126
 
103
127
  public onInboundRtpAdded?: (inboundRtp: ObservedInboundRtp, ctx: Context) => void;
104
128
  public onInboundRtpRemoved?: (inboundRtp: ObservedInboundRtp, ctx: Context) => void;
129
+ public onInboundRtpUpdated?: (inboundRtp: ObservedInboundRtp, ctx: Context) => void;
105
130
 
106
131
  public onOutboundRtpAdded?: (outboundRtp: ObservedOutboundRtp, ctx: Context) => void;
107
132
  public onOutboundRtpRemoved?: (outboundRtp: ObservedOutboundRtp, ctx: Context) => void;
133
+ public onOutboundRtpUpdated?: (outboundRtp: ObservedOutboundRtp, ctx: Context) => void;
108
134
 
109
135
  public onDataChannelAdded?: (dataChannel: ObservedDataChannel, ctx: Context) => void;
110
136
  public onDataChannelRemoved?: (dataChannel: ObservedDataChannel, ctx: Context) => void;
137
+ public onDataChannelUpdated?: (dataChannel: ObservedDataChannel, ctx: Context) => void;
111
138
 
112
139
  public onAddedIceTransport?: (iceTransport: ObservedIceTransport, ctx: Context) => void;
113
140
  public onRemovedIceTransport?: (iceTransport: ObservedIceTransport, ctx: Context) => void;
141
+ public onIceTransportUpdated?: (iceTransport: ObservedIceTransport, ctx: Context) => void;
114
142
 
115
143
  public onIceCandidateAdded?: (iceCandidate: ObservedIceCandidate, ctx: Context) => void;
116
144
  public onIceCandidateRemoved?: (iceCandidate: ObservedIceCandidate, ctx: Context) => void;
145
+ public onIceCandidateUpdated?: (iceCandidate: ObservedIceCandidate, ctx: Context) => void;
117
146
 
118
147
  public onAddedIceCandidatePair?: (candidatePair: ObservedIceCandidatePair, ctx: Context) => void;
119
148
  public onRemovedIceCandidatePair?: (candidatePair: ObservedIceCandidatePair, ctx: Context) => void;
149
+ public onIceCandidatePairUpdated?: (candidatePair: ObservedIceCandidatePair, ctx: Context) => void;
120
150
 
121
151
  public onAddedMediaCodec?: (codec: ObservedCodec, ctx: Context) => void;
122
152
  public onRemovedMediaCodec?: (codec: ObservedCodec, ctx: Context) => void;
153
+ public onMediaCodecUpdated?: (codec: ObservedCodec, ctx: Context) => void;
123
154
 
124
155
  public onAddedMediaPlayout?: (mediaPlayout: ObservedMediaPlayout, ctx: Context) => void;
125
156
  public onRemovedMediaPlayout?: (mediaPlayout: ObservedMediaPlayout, ctx: Context) => void;
157
+ public onMediaPlayoutUpdated?: (mediaPlayout: ObservedMediaPlayout, ctx: Context) => void;
126
158
 
127
159
  public onMediaSourceAdded?: (mediaSource: ObservedMediaSource, ctx: Context) => void;
128
160
  public onMediaSourceRemoved?: (mediaSource: ObservedMediaSource, ctx: Context) => void;
161
+ public onMediaSourceUpdated?: (mediaSource: ObservedMediaSource, ctx: Context) => void;
129
162
 
130
163
  private _onCallAdded(call: ObservedCall) {
131
164
  const onCallEmpty = () => this.onCallEmpty?.(call, this.context);
@@ -204,28 +237,56 @@ export class ObserverEventMonitor<Context> {
204
237
  peerConnection.once('close', () => {
205
238
  peerConnection.off('added-certificate', this._onCertificateAdded);
206
239
  peerConnection.off('removed-certificate', this._onCertificateRemoved);
240
+ peerConnection.off('updated-certificate', this._onCertificateUpdated);
241
+
207
242
  peerConnection.off('added-inbound-track', this._onInboundTrackAdded);
208
243
  peerConnection.off('removed-inbound-track', this._onInboundTrackRemoved);
244
+ peerConnection.off('updated-inbound-track', this._onInboundTrackUpdated);
245
+ peerConnection.off('muted-inbound-track', this._onInboundTrackMuted);
246
+ peerConnection.off('unmuted-inbound-track', this._onInboundTrackUnmuted);
247
+
209
248
  peerConnection.off('added-outbound-track', this._onOutboundTrackAdded);
210
249
  peerConnection.off('removed-outbound-track', this._onOutboundTrackRemoved);
250
+ peerConnection.off('updated-outbound-track', this._onOutboundTrackUpdated);
251
+ peerConnection.off('muted-outbound-track', this._onOutboundTrackMuted);
252
+ peerConnection.off('unmuted-outbound-track', this._onOutboundTrackUnmuted);
253
+
211
254
  peerConnection.off('added-inbound-rtp', this._onInboundRtpAdded);
212
255
  peerConnection.off('removed-inbound-rtp', this._onInboundRtpRemoved);
256
+ peerConnection.off('updated-inbound-rtp', this._onInboundRtpUpdated);
257
+
213
258
  peerConnection.off('added-outbound-rtp', this._onOutboundRtpAdded);
214
259
  peerConnection.off('removed-outbound-rtp', this._onOutboundRtpRemoved);
260
+ peerConnection.off('updated-outbound-rtp', this._onOutboundRtpUpdated);
261
+
215
262
  peerConnection.off('added-data-channel', this._onDataChannelAdded);
216
263
  peerConnection.off('removed-data-channel', this._onDataChannelRemoved);
264
+ peerConnection.off('updated-data-channel', this._onDataChannelUpdated);
265
+
217
266
  peerConnection.off('added-ice-transport', this._onAddedIceTransport);
218
267
  peerConnection.off('removed-ice-transport', this._onRemovedIceTransport);
268
+ peerConnection.off('updated-ice-transport', this._onIceTransportUpdated);
269
+
219
270
  peerConnection.off('added-ice-candidate', this._onIceCandidateAdded);
220
271
  peerConnection.off('removed-ice-candidate', this._onIceCandidateRemoved);
272
+ peerConnection.off('updated-ice-candidate', this._onIceCandidateUpdated);
273
+
221
274
  peerConnection.off('added-ice-candidate-pair', this._onAddedIceCandidatePair);
222
275
  peerConnection.off('removed-ice-candidate-pair', this._onRemovedIceCandidatePair);
276
+ peerConnection.off('updated-ice-candidate-pair', this._onIceCandidatePairUpdated);
277
+
223
278
  peerConnection.off('added-codec', this._onAddedMediaCodec);
224
279
  peerConnection.off('removed-codec', this._onRemovedMediaCodec);
280
+ peerConnection.off('updated-codec', this._onMediaCodecUpdated);
281
+
225
282
  peerConnection.off('added-media-playout', this._onAddedMediaPlayout);
226
283
  peerConnection.off('removed-media-playout', this._onRemovedMediaPlayout);
284
+ peerConnection.off('updated-media-playout', this._onMediaPlayoutUpdated);
285
+
227
286
  peerConnection.off('added-media-source', this._onMediaSourceAdded);
228
287
  peerConnection.off('removed-media-source', this._onMediaSourceRemoved);
288
+ peerConnection.off('updated-media-source', this._onMediaSourceUpdated);
289
+
229
290
  peerConnection.off('selectedcandidatepair', onSelectedCandidatePairChanged);
230
291
  peerConnection.off('icegatheringstatechange', onIceGatheringStateChange);
231
292
  peerConnection.off('iceconnectionstatechange', onIceConnectionStateChange);
@@ -236,28 +297,56 @@ export class ObserverEventMonitor<Context> {
236
297
 
237
298
  peerConnection.on('added-certificate', this._onCertificateAdded);
238
299
  peerConnection.on('removed-certificate', this._onCertificateRemoved);
300
+ peerConnection.on('updated-certificate', this._onCertificateUpdated);
301
+
239
302
  peerConnection.on('added-inbound-track', this._onInboundTrackAdded);
240
303
  peerConnection.on('removed-inbound-track', this._onInboundTrackRemoved);
304
+ peerConnection.on('updated-inbound-track', this._onInboundTrackUpdated);
305
+ peerConnection.on('muted-inbound-track', this._onInboundTrackMuted);
306
+ peerConnection.on('unmuted-inbound-track', this._onInboundTrackUnmuted);
307
+
241
308
  peerConnection.on('added-outbound-track', this._onOutboundTrackAdded);
242
309
  peerConnection.on('removed-outbound-track', this._onOutboundTrackRemoved);
310
+ peerConnection.on('updated-outbound-track', this._onOutboundTrackUpdated);
311
+ peerConnection.on('muted-outbound-track', this._onOutboundTrackMuted);
312
+ peerConnection.on('unmuted-outbound-track', this._onOutboundTrackUnmuted);
313
+
243
314
  peerConnection.on('added-inbound-rtp', this._onInboundRtpAdded);
244
315
  peerConnection.on('removed-inbound-rtp', this._onInboundRtpRemoved);
316
+ peerConnection.on('updated-inbound-rtp', this._onInboundRtpUpdated);
317
+
245
318
  peerConnection.on('added-outbound-rtp', this._onOutboundRtpAdded);
246
319
  peerConnection.on('removed-outbound-rtp', this._onOutboundRtpRemoved);
320
+ peerConnection.on('updated-outbound-rtp', this._onOutboundRtpUpdated);
321
+
247
322
  peerConnection.on('added-data-channel', this._onDataChannelAdded);
248
323
  peerConnection.on('removed-data-channel', this._onDataChannelRemoved);
324
+ peerConnection.on('updated-data-channel', this._onDataChannelUpdated);
325
+
249
326
  peerConnection.on('added-ice-transport', this._onAddedIceTransport);
250
327
  peerConnection.on('removed-ice-transport', this._onRemovedIceTransport);
328
+ peerConnection.on('updated-ice-transport', this._onIceTransportUpdated);
329
+
251
330
  peerConnection.on('added-ice-candidate', this._onIceCandidateAdded);
252
331
  peerConnection.on('removed-ice-candidate', this._onIceCandidateRemoved);
332
+ peerConnection.on('updated-ice-candidate', this._onIceCandidateUpdated);
333
+
253
334
  peerConnection.on('added-ice-candidate-pair', this._onAddedIceCandidatePair);
254
335
  peerConnection.on('removed-ice-candidate-pair', this._onRemovedIceCandidatePair);
336
+ peerConnection.on('updated-ice-candidate-pair', this._onIceCandidatePairUpdated);
337
+
255
338
  peerConnection.on('added-codec', this._onAddedMediaCodec);
256
339
  peerConnection.on('removed-codec', this._onRemovedMediaCodec);
340
+ peerConnection.on('updated-codec', this._onMediaCodecUpdated);
341
+
257
342
  peerConnection.on('added-media-playout', this._onAddedMediaPlayout);
258
343
  peerConnection.on('removed-media-playout', this._onRemovedMediaPlayout);
344
+ peerConnection.on('updated-media-playout', this._onMediaPlayoutUpdated);
345
+
259
346
  peerConnection.on('added-media-source', this._onMediaSourceAdded);
260
347
  peerConnection.on('removed-media-source', this._onMediaSourceRemoved);
348
+ peerConnection.on('updated-media-source', this._onMediaSourceUpdated);
349
+
261
350
  peerConnection.on('selectedcandidatepair', onSelectedCandidatePairChanged);
262
351
  peerConnection.on('icegatheringstatechange', onIceGatheringStateChange);
263
352
  peerConnection.on('iceconnectionstatechange', onIceConnectionStateChange);
@@ -280,6 +369,10 @@ export class ObserverEventMonitor<Context> {
280
369
  this.onCertificateRemoved?.(certificate, this.context);
281
370
  }
282
371
 
372
+ private _onCertificateUpdated(certificate: ObservedCertificate) {
373
+ this.onCertificateUpdated?.(certificate, this.context);
374
+ }
375
+
283
376
  private _onInboundTrackAdded(inboundTrack: ObservedInboundTrack) {
284
377
  this.onInboundTrackAdded?.(inboundTrack, this.context);
285
378
  }
@@ -288,6 +381,18 @@ export class ObserverEventMonitor<Context> {
288
381
  this.onInboundTrackRemoved?.(inboundTrack, this.context);
289
382
  }
290
383
 
384
+ private _onInboundTrackUpdated(inboundTrack: ObservedInboundTrack) {
385
+ this.onInboundTrackUpdated?.(inboundTrack, this.context);
386
+ }
387
+
388
+ private _onOutboundTrackMuted(outboundTrack: ObservedOutboundTrack) {
389
+ this.onOutboundTrackMuted?.(outboundTrack, this.context);
390
+ }
391
+
392
+ private _onOutboundTrackUnmuted(outboundTrack: ObservedOutboundTrack) {
393
+ this.onOutboundTrackUnmuted?.(outboundTrack, this.context);
394
+ }
395
+
291
396
  private _onOutboundTrackAdded(outboundTrack: ObservedOutboundTrack) {
292
397
  this.onOutboundTrackAdded?.(outboundTrack, this.context);
293
398
  }
@@ -296,6 +401,18 @@ export class ObserverEventMonitor<Context> {
296
401
  this.onOutboundTrackRemoved?.(outboundTrack, this.context);
297
402
  }
298
403
 
404
+ private _onOutboundTrackUpdated(outboundTrack: ObservedOutboundTrack) {
405
+ this.onOutboundTrackUpdated?.(outboundTrack, this.context);
406
+ }
407
+
408
+ private _onInboundTrackMuted(inboundTrack: ObservedInboundTrack) {
409
+ this.onInboundTrackMuted?.(inboundTrack, this.context);
410
+ }
411
+
412
+ private _onInboundTrackUnmuted(inboundTrack: ObservedInboundTrack) {
413
+ this.onInboundTrackUnmuted?.(inboundTrack, this.context);
414
+ }
415
+
299
416
  private _onInboundRtpAdded(inboundRtp: ObservedInboundRtp) {
300
417
  this.onInboundRtpAdded?.(inboundRtp, this.context);
301
418
  }
@@ -304,6 +421,10 @@ export class ObserverEventMonitor<Context> {
304
421
  this.onInboundRtpRemoved?.(inboundRtp, this.context);
305
422
  }
306
423
 
424
+ private _onInboundRtpUpdated(inboundRtp: ObservedInboundRtp) {
425
+ this.onInboundRtpUpdated?.(inboundRtp, this.context);
426
+ }
427
+
307
428
  private _onOutboundRtpAdded(outboundRtp: ObservedOutboundRtp) {
308
429
  this.onOutboundRtpAdded?.(outboundRtp, this.context);
309
430
  }
@@ -312,6 +433,10 @@ export class ObserverEventMonitor<Context> {
312
433
  this.onOutboundRtpRemoved?.(outboundRtp, this.context);
313
434
  }
314
435
 
436
+ private _onOutboundRtpUpdated(outboundRtp: ObservedOutboundRtp) {
437
+ this.onOutboundRtpUpdated?.(outboundRtp, this.context);
438
+ }
439
+
315
440
  private _onDataChannelAdded(dataChannel: ObservedDataChannel) {
316
441
  this.onDataChannelAdded?.(dataChannel, this.context);
317
442
  }
@@ -320,6 +445,10 @@ export class ObserverEventMonitor<Context> {
320
445
  this.onDataChannelRemoved?.(dataChannel, this.context);
321
446
  }
322
447
 
448
+ private _onDataChannelUpdated(dataChannel: ObservedDataChannel) {
449
+ this.onDataChannelUpdated?.(dataChannel, this.context);
450
+ }
451
+
323
452
  private _onAddedIceTransport(iceTransport: ObservedIceTransport) {
324
453
  this.onAddedIceTransport?.(iceTransport, this.context);
325
454
  }
@@ -328,6 +457,10 @@ export class ObserverEventMonitor<Context> {
328
457
  this.onRemovedIceTransport?.(iceTransport, this.context);
329
458
  }
330
459
 
460
+ private _onIceTransportUpdated(iceTransport: ObservedIceTransport) {
461
+ this.onIceTransportUpdated?.(iceTransport, this.context);
462
+ }
463
+
331
464
  private _onIceCandidateAdded(iceCandidate: ObservedIceCandidate) {
332
465
  this.onIceCandidateAdded?.(iceCandidate, this.context);
333
466
  }
@@ -336,6 +469,10 @@ export class ObserverEventMonitor<Context> {
336
469
  this.onIceCandidateRemoved?.(iceCandidate, this.context);
337
470
  }
338
471
 
472
+ private _onIceCandidateUpdated(iceCandidate: ObservedIceCandidate) {
473
+ this.onIceCandidateUpdated?.(iceCandidate, this.context);
474
+ }
475
+
339
476
  private _onAddedIceCandidatePair(candidatePair: ObservedIceCandidatePair) {
340
477
  this.onAddedIceCandidatePair?.(candidatePair, this.context);
341
478
  }
@@ -344,6 +481,10 @@ export class ObserverEventMonitor<Context> {
344
481
  this.onRemovedIceCandidatePair?.(candidatePair, this.context);
345
482
  }
346
483
 
484
+ private _onIceCandidatePairUpdated(candidatePair: ObservedIceCandidatePair) {
485
+ this.onIceCandidatePairUpdated?.(candidatePair, this.context);
486
+ }
487
+
347
488
  private _onAddedMediaCodec(codec: ObservedCodec) {
348
489
  this.onAddedMediaCodec?.(codec, this.context);
349
490
  }
@@ -352,6 +493,10 @@ export class ObserverEventMonitor<Context> {
352
493
  this.onRemovedMediaCodec?.(codec, this.context);
353
494
  }
354
495
 
496
+ private _onMediaCodecUpdated(codec: ObservedCodec) {
497
+ this.onMediaCodecUpdated?.(codec, this.context);
498
+ }
499
+
355
500
  private _onAddedMediaPlayout(mediaPlayout: ObservedMediaPlayout) {
356
501
  this.onAddedMediaPlayout?.(mediaPlayout, this.context);
357
502
  }
@@ -360,6 +505,10 @@ export class ObserverEventMonitor<Context> {
360
505
  this.onRemovedMediaPlayout?.(mediaPlayout, this.context);
361
506
  }
362
507
 
508
+ private _onMediaPlayoutUpdated(mediaPlayout: ObservedMediaPlayout) {
509
+ this.onMediaPlayoutUpdated?.(mediaPlayout, this.context);
510
+ }
511
+
363
512
  private _onMediaSourceAdded(mediaSource: ObservedMediaSource) {
364
513
  this.onMediaSourceAdded?.(mediaSource, this.context);
365
514
  }
@@ -368,6 +517,10 @@ export class ObserverEventMonitor<Context> {
368
517
  this.onMediaSourceRemoved?.(mediaSource, this.context);
369
518
  }
370
519
 
520
+ private _onMediaSourceUpdated(mediaSource: ObservedMediaSource) {
521
+ this.onMediaSourceUpdated?.(mediaSource, this.context);
522
+ }
523
+
371
524
  private _onClientIssue(observedClent: ObservedClient, issue: ClientIssue) {
372
525
  this.onClientIssue?.(observedClent, issue, this.context);
373
526
  }
package/src/index.ts CHANGED
@@ -21,9 +21,8 @@ export { ObservedIceTransport } from './ObservedIceTransport';
21
21
  export { ObservedPeerConnectionTransport } from './ObservedPeerConnectionTransport';
22
22
  export { ClientEventTypes } from './schema/ClientEventTypes';
23
23
  export { ClientMetaTypes } from './schema/ClientMetaTypes';
24
- export { ClientSample } from './schema/ClientSample';
24
+ export { ClientSample, ClientIssue } from './schema/ClientSample';
25
25
  export { ScoreCalculator } from './scores/ScoreCalculator';
26
26
  export { ObservedClientEventMonitor } from './ObservedClientEventMonitor';
27
27
  export { ObserverEventMonitor } from './ObserverEventMonitor';
28
-
29
28
  export { Middleware } from './common/Middleware';