@observertc/observer-js 1.0.1-ec27289.0 → 1.1.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/README.md +2184 -1
- package/dist/index.d.mts +6842 -0
- package/dist/index.d.ts +6842 -0
- package/dist/index.js +7736 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +7608 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +44 -18
- package/.eslintrc.json +0 -143
- package/.prettierignore +0 -5
- package/.prettierrc +0 -7
- package/jest.config.js +0 -9
- package/lib/ObservedCall.d.ts +0 -83
- package/lib/ObservedCall.d.ts.map +0 -1
- package/lib/ObservedCall.js +0 -203
- package/lib/ObservedCallSummary.d.ts +0 -18
- package/lib/ObservedCallSummary.d.ts.map +0 -1
- package/lib/ObservedCallSummary.js +0 -2
- package/lib/ObservedCertificate.d.ts +0 -19
- package/lib/ObservedCertificate.d.ts.map +0 -1
- package/lib/ObservedCertificate.js +0 -38
- package/lib/ObservedClient.d.ts +0 -131
- package/lib/ObservedClient.d.ts.map +0 -1
- package/lib/ObservedClient.js +0 -520
- package/lib/ObservedClientEventMonitor.d.ts +0 -89
- package/lib/ObservedClientEventMonitor.d.ts.map +0 -1
- package/lib/ObservedClientEventMonitor.js +0 -247
- package/lib/ObservedClientSummary.d.ts +0 -23
- package/lib/ObservedClientSummary.d.ts.map +0 -1
- package/lib/ObservedClientSummary.js +0 -2
- package/lib/ObservedCodec.d.ts +0 -22
- package/lib/ObservedCodec.d.ts.map +0 -1
- package/lib/ObservedCodec.js +0 -45
- package/lib/ObservedDataChannel.d.ts +0 -30
- package/lib/ObservedDataChannel.d.ts.map +0 -1
- package/lib/ObservedDataChannel.js +0 -75
- package/lib/ObservedIceCandidate.d.ts +0 -29
- package/lib/ObservedIceCandidate.d.ts.map +0 -1
- package/lib/ObservedIceCandidate.js +0 -59
- package/lib/ObservedIceCandidatePair.d.ts +0 -44
- package/lib/ObservedIceCandidatePair.d.ts.map +0 -1
- package/lib/ObservedIceCandidatePair.js +0 -111
- package/lib/ObservedIceTransport.d.ts +0 -36
- package/lib/ObservedIceTransport.d.ts.map +0 -1
- package/lib/ObservedIceTransport.js +0 -93
- package/lib/ObservedInboundRtp.d.ts +0 -92
- package/lib/ObservedInboundRtp.d.ts.map +0 -1
- package/lib/ObservedInboundRtp.js +0 -193
- package/lib/ObservedInboundTrack.d.ts +0 -31
- package/lib/ObservedInboundTrack.d.ts.map +0 -1
- package/lib/ObservedInboundTrack.js +0 -59
- package/lib/ObservedMediaPlayout.d.ts +0 -22
- package/lib/ObservedMediaPlayout.d.ts.map +0 -1
- package/lib/ObservedMediaPlayout.js +0 -42
- package/lib/ObservedMediaSource.d.ts +0 -28
- package/lib/ObservedMediaSource.d.ts.map +0 -1
- package/lib/ObservedMediaSource.js +0 -55
- package/lib/ObservedOutboundRtp.d.ts +0 -62
- package/lib/ObservedOutboundRtp.d.ts.map +0 -1
- package/lib/ObservedOutboundRtp.js +0 -144
- package/lib/ObservedOutboundTrack.d.ts +0 -31
- package/lib/ObservedOutboundTrack.d.ts.map +0 -1
- package/lib/ObservedOutboundTrack.js +0 -59
- package/lib/ObservedPeerConnection.d.ts +0 -185
- package/lib/ObservedPeerConnection.d.ts.map +0 -1
- package/lib/ObservedPeerConnection.js +0 -710
- package/lib/ObservedPeerConnectionTransport.d.ts +0 -17
- package/lib/ObservedPeerConnectionTransport.d.ts.map +0 -1
- package/lib/ObservedPeerConnectionTransport.js +0 -34
- package/lib/ObservedRemoteInboundRtp.d.ts +0 -30
- package/lib/ObservedRemoteInboundRtp.d.ts.map +0 -1
- package/lib/ObservedRemoteInboundRtp.js +0 -60
- package/lib/ObservedRemoteOutboundRtp.d.ts +0 -30
- package/lib/ObservedRemoteOutboundRtp.d.ts.map +0 -1
- package/lib/ObservedRemoteOutboundRtp.js +0 -60
- package/lib/ObservedTURN.d.ts +0 -31
- package/lib/ObservedTURN.d.ts.map +0 -1
- package/lib/ObservedTURN.js +0 -58
- package/lib/ObservedTurnServer.d.ts +0 -25
- package/lib/ObservedTurnServer.d.ts.map +0 -1
- package/lib/ObservedTurnServer.js +0 -59
- package/lib/Observer.d.ts +0 -61
- package/lib/Observer.d.ts.map +0 -1
- package/lib/Observer.js +0 -156
- package/lib/ObserverSummary.d.ts +0 -13
- package/lib/ObserverSummary.d.ts.map +0 -1
- package/lib/ObserverSummary.js +0 -2
- package/lib/common/Middleware.d.ts +0 -17
- package/lib/common/Middleware.d.ts.map +0 -1
- package/lib/common/Middleware.js +0 -60
- package/lib/common/SingleExecutor.d.ts +0 -3
- package/lib/common/SingleExecutor.d.ts.map +0 -1
- package/lib/common/SingleExecutor.js +0 -31
- package/lib/common/logger.d.ts +0 -17
- package/lib/common/logger.d.ts.map +0 -1
- package/lib/common/logger.js +0 -50
- package/lib/common/types.d.ts +0 -3
- package/lib/common/types.d.ts.map +0 -1
- package/lib/common/types.js +0 -3
- package/lib/common/utils.d.ts +0 -11
- package/lib/common/utils.d.ts.map +0 -1
- package/lib/common/utils.js +0 -63
- package/lib/detectors/Detector.d.ts +0 -5
- package/lib/detectors/Detector.d.ts.map +0 -1
- package/lib/detectors/Detector.js +0 -3
- package/lib/detectors/Detectors.d.ts +0 -11
- package/lib/detectors/Detectors.d.ts.map +0 -1
- package/lib/detectors/Detectors.js +0 -34
- package/lib/index.d.ts +0 -27
- package/lib/index.d.ts.map +0 -1
- package/lib/index.js +0 -47
- package/lib/monitors/TurnUsageMonitor.d.ts +0 -1
- package/lib/monitors/TurnUsageMonitor.d.ts.map +0 -1
- package/lib/monitors/TurnUsageMonitor.js +0 -146
- package/lib/schema/ClientEventTypes.d.ts +0 -100
- package/lib/schema/ClientEventTypes.d.ts.map +0 -1
- package/lib/schema/ClientEventTypes.js +0 -38
- package/lib/schema/ClientMetaTypes.d.ts +0 -34
- package/lib/schema/ClientMetaTypes.d.ts.map +0 -1
- package/lib/schema/ClientMetaTypes.js +0 -16
- package/lib/schema/ClientSample.d.ts +0 -1333
- package/lib/schema/ClientSample.d.ts.map +0 -1
- package/lib/schema/ClientSample.js +0 -4
- package/lib/scores/CalculatedScore.d.ts +0 -6
- package/lib/scores/CalculatedScore.d.ts.map +0 -1
- package/lib/scores/CalculatedScore.js +0 -2
- package/lib/scores/DefaultCallScoreCalculator.d.ts +0 -7
- package/lib/scores/DefaultCallScoreCalculator.d.ts.map +0 -1
- package/lib/scores/DefaultCallScoreCalculator.js +0 -21
- package/lib/scores/ScoreCalculator.d.ts +0 -4
- package/lib/scores/ScoreCalculator.d.ts.map +0 -1
- package/lib/scores/ScoreCalculator.js +0 -2
- package/lib/updaters/CallUpdater.d.ts +0 -5
- package/lib/updaters/CallUpdater.d.ts.map +0 -1
- package/lib/updaters/CallUpdater.js +0 -2
- package/lib/updaters/ObserverUpdater.d.ts +0 -5
- package/lib/updaters/ObserverUpdater.d.ts.map +0 -1
- package/lib/updaters/ObserverUpdater.js +0 -2
- package/lib/updaters/OnAllCallObserverUpdater_.d.ts +0 -13
- package/lib/updaters/OnAllCallObserverUpdater_.d.ts.map +0 -1
- package/lib/updaters/OnAllCallObserverUpdater_.js +0 -38
- package/lib/updaters/OnAllClientCallUpdater.d.ts +0 -13
- package/lib/updaters/OnAllClientCallUpdater.d.ts.map +0 -1
- package/lib/updaters/OnAllClientCallUpdater.js +0 -37
- package/lib/updaters/OnAnyCallObserverUpdater_.d.ts +0 -11
- package/lib/updaters/OnAnyCallObserverUpdater_.d.ts.map +0 -1
- package/lib/updaters/OnAnyCallObserverUpdater_.js +0 -27
- package/lib/updaters/OnAnyClientCallUpdater.d.ts +0 -11
- package/lib/updaters/OnAnyClientCallUpdater.d.ts.map +0 -1
- package/lib/updaters/OnAnyClientCallUpdater.js +0 -27
- package/lib/updaters/OnIntervalUpdater.d.ts +0 -10
- package/lib/updaters/OnIntervalUpdater.d.ts.map +0 -1
- package/lib/updaters/OnIntervalUpdater.js +0 -17
- package/lib/updaters/Updater.d.ts +0 -6
- package/lib/updaters/Updater.d.ts.map +0 -1
- package/lib/updaters/Updater.js +0 -2
- package/lib/utils/RemoteTrackResolver.d.ts +0 -7
- package/lib/utils/RemoteTrackResolver.d.ts.map +0 -1
- package/lib/utils/RemoteTrackResolver.js +0 -2
- package/src/ObservedCall.ts +0 -322
- package/src/ObservedCallSummary.ts +0 -22
- package/src/ObservedCertificate.ts +0 -43
- package/src/ObservedClient.ts +0 -673
- package/src/ObservedClientEventMonitor.ts +0 -301
- package/src/ObservedClientSummary.ts +0 -24
- package/src/ObservedCodec.ts +0 -49
- package/src/ObservedDataChannel.ts +0 -85
- package/src/ObservedIceCandidate.ts +0 -64
- package/src/ObservedIceCandidatePair.ts +0 -118
- package/src/ObservedIceTransport.ts +0 -99
- package/src/ObservedInboundRtp.ts +0 -205
- package/src/ObservedInboundTrack.ts +0 -73
- package/src/ObservedMediaPlayout.ts +0 -49
- package/src/ObservedMediaSource.ts +0 -60
- package/src/ObservedOutboundRtp.ts +0 -156
- package/src/ObservedOutboundTrack.ts +0 -72
- package/src/ObservedPeerConnection.ts +0 -1019
- package/src/ObservedPeerConnectionTransport.ts +0 -38
- package/src/ObservedRemoteInboundRtp.ts +0 -64
- package/src/ObservedRemoteOutboundRtp.ts +0 -65
- package/src/ObservedTURN.ts +0 -86
- package/src/ObservedTurnServer.ts +0 -72
- package/src/Observer.ts +0 -239
- package/src/ObserverSummary.ts +0 -15
- package/src/common/Middleware.ts +0 -84
- package/src/common/SingleExecutor.ts +0 -36
- package/src/common/logger.ts +0 -82
- package/src/common/types.ts +0 -4
- package/src/common/utils.ts +0 -69
- package/src/detectors/Detector.ts +0 -6
- package/src/detectors/Detectors.ts +0 -38
- package/src/index.ts +0 -28
- package/src/monitors/TurnUsageMonitor.ts +0 -187
- package/src/schema/ClientEventTypes.ts +0 -112
- package/src/schema/ClientMetaTypes.ts +0 -41
- package/src/schema/ClientSample.ts +0 -1682
- package/src/scores/CalculatedScore.ts +0 -6
- package/src/scores/DefaultCallScoreCalculator.ts +0 -23
- package/src/scores/ScoreCalculator.ts +0 -3
- package/src/updaters/CallUpdater.ts +0 -5
- package/src/updaters/ObserverUpdater.ts +0 -5
- package/src/updaters/OnAllCallObserverUpdater_.ts +0 -46
- package/src/updaters/OnAllClientCallUpdater.ts +0 -46
- package/src/updaters/OnAnyCallObserverUpdater_.ts +0 -32
- package/src/updaters/OnAnyClientCallUpdater.ts +0 -32
- package/src/updaters/OnIntervalUpdater.ts +0 -19
- package/src/updaters/Updater.ts +0 -5
- package/src/utils/RemoteTrackResolver.ts +0 -12
- package/tsconfig.json +0 -19
- package/tslint.json +0 -6
|
@@ -1,301 +0,0 @@
|
|
|
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
|
-
|
|
17
|
-
export class ObservedClientEventMonitor<Context> {
|
|
18
|
-
public constructor(
|
|
19
|
-
public readonly observedClient: ObservedClient,
|
|
20
|
-
public readonly context: Context,
|
|
21
|
-
) {
|
|
22
|
-
this._onPeerConnconnectionAdded = this._onPeerConnconnectionAdded.bind(this);
|
|
23
|
-
this._onPeerConnectionRemoved = this._onPeerConnectionRemoved.bind(this);
|
|
24
|
-
this._onCertificateAdded = this._onCertificateAdded.bind(this);
|
|
25
|
-
this._onCertificateRemoved = this._onCertificateRemoved.bind(this);
|
|
26
|
-
this._onInboundTrackAdded = this._onInboundTrackAdded.bind(this);
|
|
27
|
-
this._onInboundTrackRemoved = this._onInboundTrackRemoved.bind(this);
|
|
28
|
-
this._onOutboundTrackAdded = this._onOutboundTrackAdded.bind(this);
|
|
29
|
-
this._onOutboundTrackRemoved = this._onOutboundTrackRemoved.bind(this);
|
|
30
|
-
this._onInboundRtpAdded = this._onInboundRtpAdded.bind(this);
|
|
31
|
-
this._onInboundRtpRemoved = this._onInboundRtpRemoved.bind(this);
|
|
32
|
-
this._onOutboundRtpAdded = this._onOutboundRtpAdded.bind(this);
|
|
33
|
-
this._onOutboundRtpRemoved = this._onOutboundRtpRemoved.bind(this);
|
|
34
|
-
this._onDataChannelAdded = this._onDataChannelAdded.bind(this);
|
|
35
|
-
this._onDataChannelRemoved = this._onDataChannelRemoved.bind(this);
|
|
36
|
-
this._onAddedIceTransport = this._onAddedIceTransport.bind(this);
|
|
37
|
-
this._onRemovedIceTransport = this._onRemovedIceTransport.bind(this);
|
|
38
|
-
this._onIceCandidateAdded = this._onIceCandidateAdded.bind(this);
|
|
39
|
-
this._onIceCandidateRemoved = this._onIceCandidateRemoved.bind(this);
|
|
40
|
-
this._onAddedIceCandidatePair = this._onAddedIceCandidatePair.bind(this);
|
|
41
|
-
this._onRemovedIceCandidatePair = this._onRemovedIceCandidatePair.bind(this);
|
|
42
|
-
this._onAddedMediaCodec = this._onAddedMediaCodec.bind(this);
|
|
43
|
-
this._onRemovedMediaCodec = this._onRemovedMediaCodec.bind(this);
|
|
44
|
-
this._onAddedMediaPlayout = this._onAddedMediaPlayout.bind(this);
|
|
45
|
-
this._onRemovedMediaPlayout = this._onRemovedMediaPlayout.bind(this);
|
|
46
|
-
this._onMediaSourceAdded = this._onMediaSourceAdded.bind(this);
|
|
47
|
-
this._onMediaSourceRemoved = this._onMediaSourceRemoved.bind(this);
|
|
48
|
-
this._onClientClosed = this._onClientClosed.bind(this);
|
|
49
|
-
this._onClientIssue = this._onClientIssue.bind(this);
|
|
50
|
-
this._onClientMetadata = this._onClientMetadata.bind(this);
|
|
51
|
-
this._onClientJoined = this._onClientJoined.bind(this);
|
|
52
|
-
this._onClientLeft = this._onClientLeft.bind(this);
|
|
53
|
-
this._onUserMediaError = this._onUserMediaError.bind(this);
|
|
54
|
-
this._onUsingTurn = this._onUsingTurn.bind(this);
|
|
55
|
-
|
|
56
|
-
this.observedClient.on('newpeerconnection', this._onPeerConnconnectionAdded);
|
|
57
|
-
this.observedClient.on('issue', this._onClientIssue);
|
|
58
|
-
this.observedClient.on('metaData', this._onClientMetadata);
|
|
59
|
-
this.observedClient.on('joined', this._onClientJoined);
|
|
60
|
-
this.observedClient.on('left', this._onClientLeft);
|
|
61
|
-
this.observedClient.on('rejoined', this._onClientJoined);
|
|
62
|
-
this.observedClient.on('usermediaerror', this._onUserMediaError);
|
|
63
|
-
this.observedClient.on('usingturn', this._onUsingTurn);
|
|
64
|
-
|
|
65
|
-
this.observedClient.once('close', this._onClientClosed);
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
public onClientClosed?: (client: ObservedClient, ctx: Context) => void;
|
|
69
|
-
private _onClientClosed() {
|
|
70
|
-
this.onClientClosed?.(this.observedClient, this.context);
|
|
71
|
-
|
|
72
|
-
this.observedClient.off('newpeerconnection', this._onPeerConnconnectionAdded);
|
|
73
|
-
this.observedClient.off('issue', this._onClientIssue);
|
|
74
|
-
this.observedClient.off('metaData', this._onClientMetadata);
|
|
75
|
-
this.observedClient.off('joined', this._onClientJoined);
|
|
76
|
-
this.observedClient.off('left', this._onClientLeft);
|
|
77
|
-
this.observedClient.off('rejoined', this._onClientJoined);
|
|
78
|
-
this.observedClient.off('usermediaerror', this._onUserMediaError);
|
|
79
|
-
this.observedClient.off('usingturn', this._onUsingTurn);
|
|
80
|
-
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
public onPeerConnectionAdded?: (peerConnection: ObservedPeerConnection, ctx: Context) => void;
|
|
84
|
-
private _onPeerConnconnectionAdded(peerConnection: ObservedPeerConnection) {
|
|
85
|
-
this.onPeerConnectionAdded?.(peerConnection, this.context);
|
|
86
|
-
|
|
87
|
-
peerConnection.once('close', () => this._onPeerConnectionRemoved(peerConnection));
|
|
88
|
-
|
|
89
|
-
peerConnection.on('added-certificate', this._onCertificateAdded);
|
|
90
|
-
peerConnection.on('removed-certificate', this._onCertificateRemoved);
|
|
91
|
-
peerConnection.on('added-inbound-track', this._onInboundTrackAdded);
|
|
92
|
-
peerConnection.on('removed-inbound-track', this._onInboundTrackRemoved);
|
|
93
|
-
peerConnection.on('added-outbound-track', this._onOutboundTrackAdded);
|
|
94
|
-
peerConnection.on('removed-outbound-track', this._onOutboundTrackRemoved);
|
|
95
|
-
peerConnection.on('added-inbound-rtp', this._onInboundRtpAdded);
|
|
96
|
-
peerConnection.on('removed-inbound-rtp', this._onInboundRtpRemoved);
|
|
97
|
-
peerConnection.on('added-outbound-rtp', this._onOutboundRtpAdded);
|
|
98
|
-
peerConnection.on('removed-outbound-rtp', this._onOutboundRtpRemoved);
|
|
99
|
-
peerConnection.on('added-data-channel', this._onDataChannelAdded);
|
|
100
|
-
peerConnection.on('removed-data-channel', this._onDataChannelRemoved);
|
|
101
|
-
peerConnection.on('added-ice-transport', this._onAddedIceTransport);
|
|
102
|
-
peerConnection.on('removed-ice-transport', this._onRemovedIceTransport);
|
|
103
|
-
peerConnection.on('added-ice-candidate', this._onIceCandidateAdded);
|
|
104
|
-
peerConnection.on('removed-ice-candidate', this._onIceCandidateRemoved);
|
|
105
|
-
peerConnection.on('added-ice-candidate-pair', this._onAddedIceCandidatePair);
|
|
106
|
-
peerConnection.on('removed-ice-candidate-pair', this._onRemovedIceCandidatePair);
|
|
107
|
-
peerConnection.on('added-codec', this._onAddedMediaCodec);
|
|
108
|
-
peerConnection.on('removed-codec', this._onRemovedMediaCodec);
|
|
109
|
-
peerConnection.on('added-media-playout', this._onAddedMediaPlayout);
|
|
110
|
-
peerConnection.on('removed-media-playout', this._onRemovedMediaPlayout);
|
|
111
|
-
peerConnection.on('added-media-source', this._onMediaSourceAdded);
|
|
112
|
-
peerConnection.on('removed-media-source', this._onMediaSourceRemoved);
|
|
113
|
-
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
public onPeerConnectionRemoved?: (peerConnection: ObservedPeerConnection, ctx: Context) => void;
|
|
117
|
-
private _onPeerConnectionRemoved(peerConnection: ObservedPeerConnection) {
|
|
118
|
-
this.onPeerConnectionRemoved?.(peerConnection, this.context);
|
|
119
|
-
|
|
120
|
-
peerConnection.off('added-certificate', this._onCertificateAdded);
|
|
121
|
-
peerConnection.off('removed-certificate', this._onCertificateRemoved);
|
|
122
|
-
peerConnection.off('added-inbound-track', this._onInboundTrackAdded);
|
|
123
|
-
peerConnection.off('removed-inbound-track', this._onInboundTrackRemoved);
|
|
124
|
-
peerConnection.off('added-outbound-track', this._onOutboundTrackAdded);
|
|
125
|
-
peerConnection.off('removed-outbound-track', this._onOutboundTrackRemoved);
|
|
126
|
-
peerConnection.off('added-inbound-rtp', this._onInboundRtpAdded);
|
|
127
|
-
peerConnection.off('removed-inbound-rtp', this._onInboundRtpRemoved);
|
|
128
|
-
peerConnection.off('added-outbound-rtp', this._onOutboundRtpAdded);
|
|
129
|
-
peerConnection.off('removed-outbound-rtp', this._onOutboundRtpRemoved);
|
|
130
|
-
peerConnection.off('added-data-channel', this._onDataChannelAdded);
|
|
131
|
-
peerConnection.off('removed-data-channel', this._onDataChannelRemoved);
|
|
132
|
-
peerConnection.off('added-ice-transport', this._onAddedIceTransport);
|
|
133
|
-
peerConnection.off('removed-ice-transport', this._onRemovedIceTransport);
|
|
134
|
-
peerConnection.off('added-ice-candidate', this._onIceCandidateAdded);
|
|
135
|
-
peerConnection.off('removed-ice-candidate', this._onIceCandidateRemoved);
|
|
136
|
-
peerConnection.off('added-ice-candidate-pair', this._onAddedIceCandidatePair);
|
|
137
|
-
peerConnection.off('removed-ice-candidate-pair', this._onRemovedIceCandidatePair);
|
|
138
|
-
peerConnection.off('added-codec', this._onAddedMediaCodec);
|
|
139
|
-
peerConnection.off('removed-codec', this._onRemovedMediaCodec);
|
|
140
|
-
peerConnection.off('added-media-playout', this._onAddedMediaPlayout);
|
|
141
|
-
peerConnection.off('removed-media-playout', this._onRemovedMediaPlayout);
|
|
142
|
-
peerConnection.off('added-media-source', this._onMediaSourceAdded);
|
|
143
|
-
peerConnection.off('removed-media-source', this._onMediaSourceRemoved);
|
|
144
|
-
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
public onCertificateAdded?: (certificate: ObservedCertificate, ctx: Context) => void;
|
|
148
|
-
private _onCertificateAdded(certificate: ObservedCertificate) {
|
|
149
|
-
this.onCertificateAdded?.(certificate, this.context);
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
public onCertificateRemoved?: (certificate: ObservedCertificate, ctx: Context) => void;
|
|
153
|
-
private _onCertificateRemoved(certificate: ObservedCertificate) {
|
|
154
|
-
this.onCertificateRemoved?.(certificate, this.context);
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
public onInboundTrackAdded?: (inboundTrack: ObservedInboundTrack, ctx: Context) => void;
|
|
158
|
-
private _onInboundTrackAdded(inboundTrack: ObservedInboundTrack) {
|
|
159
|
-
this.onInboundTrackAdded?.(inboundTrack, this.context);
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
public onInboundTrackRemoved?: (inboundTrack: ObservedInboundTrack, ctx: Context) => void;
|
|
163
|
-
private _onInboundTrackRemoved(inboundTrack: ObservedInboundTrack) {
|
|
164
|
-
this.onInboundTrackRemoved?.(inboundTrack, this.context);
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
public onOutboundTrackAdded?: (outboundTrack: ObservedOutboundTrack, ctx: Context) => void;
|
|
168
|
-
private _onOutboundTrackAdded(outboundTrack: ObservedOutboundTrack) {
|
|
169
|
-
this.onOutboundTrackAdded?.(outboundTrack, this.context);
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
public onOutboundTrackRemoved?: (outboundTrack: ObservedOutboundTrack, ctx: Context) => void;
|
|
173
|
-
private _onOutboundTrackRemoved(outboundTrack: ObservedOutboundTrack) {
|
|
174
|
-
this.onOutboundTrackRemoved?.(outboundTrack, this.context);
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
public onInboundRtpAdded?: (inboundRtp: ObservedInboundRtp, ctx: Context) => void;
|
|
178
|
-
private _onInboundRtpAdded(inboundRtp: ObservedInboundRtp) {
|
|
179
|
-
this.onInboundRtpAdded?.(inboundRtp, this.context);
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
public onInboundRtpRemoved?: (inboundRtp: ObservedInboundRtp, ctx: Context) => void;
|
|
183
|
-
private _onInboundRtpRemoved(inboundRtp: ObservedInboundRtp) {
|
|
184
|
-
this.onInboundRtpRemoved?.(inboundRtp, this.context);
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
public onOutboundRtpAdded?: (outboundRtp: ObservedOutboundRtp, ctx: Context) => void;
|
|
188
|
-
private _onOutboundRtpAdded(outboundRtp: ObservedOutboundRtp) {
|
|
189
|
-
this.onOutboundRtpAdded?.(outboundRtp, this.context);
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
public onOutboundRtpRemoved?: (outboundRtp: ObservedOutboundRtp, ctx: Context) => void;
|
|
193
|
-
private _onOutboundRtpRemoved(outboundRtp: ObservedOutboundRtp) {
|
|
194
|
-
this.onOutboundRtpRemoved?.(outboundRtp, this.context);
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
public onDataChannelAdded?: (dataChannel: ObservedDataChannel, ctx: Context) => void;
|
|
198
|
-
private _onDataChannelAdded(dataChannel: ObservedDataChannel) {
|
|
199
|
-
this.onDataChannelAdded?.(dataChannel, this.context);
|
|
200
|
-
}
|
|
201
|
-
|
|
202
|
-
public onDataChannelRemoved?: (dataChannel: ObservedDataChannel, ctx: Context) => void;
|
|
203
|
-
private _onDataChannelRemoved(dataChannel: ObservedDataChannel) {
|
|
204
|
-
this.onDataChannelRemoved?.(dataChannel, this.context);
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
public onAddedIceTransport?: (iceTransport: ObservedIceTransport, ctx: Context) => void;
|
|
208
|
-
private _onAddedIceTransport(iceTransport: ObservedIceTransport) {
|
|
209
|
-
this.onAddedIceTransport?.(iceTransport, this.context);
|
|
210
|
-
}
|
|
211
|
-
|
|
212
|
-
public onRemovedIceTransport?: (iceTransport: ObservedIceTransport, ctx: Context) => void;
|
|
213
|
-
private _onRemovedIceTransport(iceTransport: ObservedIceTransport) {
|
|
214
|
-
this.onRemovedIceTransport?.(iceTransport, this.context);
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
public onIceCandidateAdded?: (iceCandidate: ObservedIceCandidate, ctx: Context) => void;
|
|
218
|
-
private _onIceCandidateAdded(iceCandidate: ObservedIceCandidate) {
|
|
219
|
-
this.onIceCandidateAdded?.(iceCandidate, this.context);
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
public onIceCandidateRemoved?: (iceCandidate: ObservedIceCandidate, ctx: Context) => void;
|
|
223
|
-
private _onIceCandidateRemoved(iceCandidate: ObservedIceCandidate) {
|
|
224
|
-
this.onIceCandidateRemoved?.(iceCandidate, this.context);
|
|
225
|
-
}
|
|
226
|
-
|
|
227
|
-
public onAddedIceCandidatePair?: (candidatePair: ObservedIceCandidatePair, ctx: Context) => void;
|
|
228
|
-
private _onAddedIceCandidatePair(candidatePair: ObservedIceCandidatePair) {
|
|
229
|
-
this.onAddedIceCandidatePair?.(candidatePair, this.context);
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
public onRemovedIceCandidatePair?: (candidatePair: ObservedIceCandidatePair, ctx: Context) => void;
|
|
233
|
-
private _onRemovedIceCandidatePair(candidatePair: ObservedIceCandidatePair) {
|
|
234
|
-
this.onRemovedIceCandidatePair?.(candidatePair, this.context);
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
public onAddedMediaCodec?: (codec: ObservedCodec, ctx: Context) => void;
|
|
238
|
-
private _onAddedMediaCodec(codec: ObservedCodec) {
|
|
239
|
-
this.onAddedMediaCodec?.(codec, this.context);
|
|
240
|
-
}
|
|
241
|
-
|
|
242
|
-
public onRemovedMediaCodec?: (codec: ObservedCodec, ctx: Context) => void;
|
|
243
|
-
private _onRemovedMediaCodec(codec: ObservedCodec) {
|
|
244
|
-
this.onRemovedMediaCodec?.(codec, this.context);
|
|
245
|
-
}
|
|
246
|
-
|
|
247
|
-
public onAddedMediaPlayout?: (mediaPlayout: ObservedMediaPlayout, ctx: Context) => void;
|
|
248
|
-
private _onAddedMediaPlayout(mediaPlayout: ObservedMediaPlayout) {
|
|
249
|
-
this.onAddedMediaPlayout?.(mediaPlayout, this.context);
|
|
250
|
-
}
|
|
251
|
-
|
|
252
|
-
public onRemovedMediaPlayout?: (mediaPlayout: ObservedMediaPlayout, ctx: Context) => void;
|
|
253
|
-
private _onRemovedMediaPlayout(mediaPlayout: ObservedMediaPlayout) {
|
|
254
|
-
this.onRemovedMediaPlayout?.(mediaPlayout, this.context);
|
|
255
|
-
}
|
|
256
|
-
|
|
257
|
-
public onMediaSourceAdded?: (mediaSource: ObservedMediaSource, ctx: Context) => void;
|
|
258
|
-
private _onMediaSourceAdded(mediaSource: ObservedMediaSource) {
|
|
259
|
-
this.onMediaSourceAdded?.(mediaSource, this.context);
|
|
260
|
-
}
|
|
261
|
-
|
|
262
|
-
public onMediaSourceRemoved?: (mediaSource: ObservedMediaSource, ctx: Context) => void;
|
|
263
|
-
private _onMediaSourceRemoved(mediaSource: ObservedMediaSource) {
|
|
264
|
-
this.onMediaSourceRemoved?.(mediaSource, this.context);
|
|
265
|
-
}
|
|
266
|
-
|
|
267
|
-
public onClientIssue?: (issue: ClientIssue, ctx: Context) => void;
|
|
268
|
-
private _onClientIssue(issue: ClientIssue) {
|
|
269
|
-
this.onClientIssue?.(issue, this.context);
|
|
270
|
-
}
|
|
271
|
-
|
|
272
|
-
public onClientMetadata?: (metadata: ClientMetaData, ctx: Context) => void;
|
|
273
|
-
private _onClientMetadata(metadata: ClientMetaData) {
|
|
274
|
-
this.onClientMetadata?.(metadata, this.context);
|
|
275
|
-
}
|
|
276
|
-
|
|
277
|
-
public onClientExtensionStats?: (extensionStats: ExtensionStat, ctx: Context) => void;
|
|
278
|
-
private _onClientExtensionStats(extensionStats: ExtensionStat) {
|
|
279
|
-
this.onClientExtensionStats?.(extensionStats, this.context);
|
|
280
|
-
}
|
|
281
|
-
|
|
282
|
-
public onClientJoined?: (client: ObservedClient, ctx: Context) => void;
|
|
283
|
-
private _onClientJoined() {
|
|
284
|
-
this.onClientJoined?.(this.observedClient, this.context);
|
|
285
|
-
}
|
|
286
|
-
|
|
287
|
-
public onClientLeft?: (client: ObservedClient, ctx: Context) => void;
|
|
288
|
-
private _onClientLeft() {
|
|
289
|
-
this.onClientLeft?.(this.observedClient, this.context);
|
|
290
|
-
}
|
|
291
|
-
|
|
292
|
-
public onUserMediaError?: (error: string, observedClient: ObservedClient, ctx: Context) => void;
|
|
293
|
-
private _onUserMediaError(error: string) {
|
|
294
|
-
this.onUserMediaError?.(error, this.observedClient, this.context);
|
|
295
|
-
}
|
|
296
|
-
|
|
297
|
-
public onUsingTurn?: (client: ObservedClient, ctx: Context) => void;
|
|
298
|
-
private _onUsingTurn() {
|
|
299
|
-
this.onUsingTurn?.(this.observedClient, this.context);
|
|
300
|
-
}
|
|
301
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
export type ObservedClientSummary = {
|
|
2
|
-
totalInboundPacketsLost: number,
|
|
3
|
-
totalInboundPacketsReceived: number,
|
|
4
|
-
totalOutboundPacketsSent: number,
|
|
5
|
-
totalDataChannelBytesSent: number,
|
|
6
|
-
totalDataChannelBytesReceived: number,
|
|
7
|
-
totalDataChannelMessagesSent: number,
|
|
8
|
-
totalDataChannelMessagesReceived: number,
|
|
9
|
-
totalSentBytes: number,
|
|
10
|
-
totalReceivedBytes: number,
|
|
11
|
-
totalReceivedAudioBytes: number,
|
|
12
|
-
totalReceivedVideoBytes: number,
|
|
13
|
-
totalSentAudioBytes: number,
|
|
14
|
-
totalSentVideoBytes: number,
|
|
15
|
-
|
|
16
|
-
totalRttLt50Measurements: number,
|
|
17
|
-
totalRttLt150Measurements: number,
|
|
18
|
-
totalRttLt300Measurements: number,
|
|
19
|
-
totalRttGtOrEq300Measurements: number,
|
|
20
|
-
totalScoreSum: number,
|
|
21
|
-
numberOfScoreMeasurements: number,
|
|
22
|
-
|
|
23
|
-
numberOfIssues: number,
|
|
24
|
-
}
|
package/src/ObservedCodec.ts
DELETED
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import { ObservedPeerConnection } from './ObservedPeerConnection';
|
|
2
|
-
import { CodecStats } from './schema/ClientSample';
|
|
3
|
-
|
|
4
|
-
export class ObservedCodec implements CodecStats {
|
|
5
|
-
private _visited = false;
|
|
6
|
-
public appData?: Record<string, unknown>;
|
|
7
|
-
|
|
8
|
-
payloadType?: number | undefined;
|
|
9
|
-
transportId?: string | undefined;
|
|
10
|
-
clockRate?: number | undefined;
|
|
11
|
-
channels?: number | undefined;
|
|
12
|
-
sdpFmtpLine?: string | undefined;
|
|
13
|
-
attachments?: Record<string, unknown> | undefined;
|
|
14
|
-
|
|
15
|
-
public constructor(
|
|
16
|
-
public timestamp: number,
|
|
17
|
-
public id: string,
|
|
18
|
-
public mimeType: string,
|
|
19
|
-
private readonly _peerConnection: ObservedPeerConnection
|
|
20
|
-
) {}
|
|
21
|
-
|
|
22
|
-
public get visited() {
|
|
23
|
-
const visited = this._visited;
|
|
24
|
-
|
|
25
|
-
this._visited = false;
|
|
26
|
-
|
|
27
|
-
return visited;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
public getPeerConnection() {
|
|
31
|
-
return this._peerConnection;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
public getIceTransport() {
|
|
35
|
-
return this._peerConnection.observedIceTransports.get(this.transportId ?? '');
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
public update(stats: CodecStats) {
|
|
39
|
-
this._visited = true;
|
|
40
|
-
|
|
41
|
-
this.timestamp = stats.timestamp;
|
|
42
|
-
this.payloadType = stats.payloadType;
|
|
43
|
-
this.transportId = stats.transportId;
|
|
44
|
-
this.clockRate = stats.clockRate;
|
|
45
|
-
this.channels = stats.channels;
|
|
46
|
-
this.sdpFmtpLine = stats.sdpFmtpLine;
|
|
47
|
-
this.attachments = stats.attachments;
|
|
48
|
-
}
|
|
49
|
-
}
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
import { ObservedPeerConnection } from './ObservedPeerConnection';
|
|
2
|
-
import { DataChannelStats } from './schema/ClientSample';
|
|
3
|
-
|
|
4
|
-
export type ObservedDataChannelState = 'connecting' | 'open' | 'closing' | 'closed';
|
|
5
|
-
|
|
6
|
-
export class ObservedDataChannel implements DataChannelStats {
|
|
7
|
-
private _visited = false;
|
|
8
|
-
|
|
9
|
-
label?: string | undefined;
|
|
10
|
-
protocol?: string | undefined;
|
|
11
|
-
dataChannelIdentifier?: number | undefined;
|
|
12
|
-
state?: string | undefined;
|
|
13
|
-
messagesSent?: number | undefined;
|
|
14
|
-
bytesSent?: number | undefined;
|
|
15
|
-
messagesReceived?: number | undefined;
|
|
16
|
-
bytesReceived?: number | undefined;
|
|
17
|
-
attachments?: Record<string, unknown> | undefined;
|
|
18
|
-
|
|
19
|
-
public addedAt?: number | undefined;
|
|
20
|
-
public removedAt?: number | undefined;
|
|
21
|
-
|
|
22
|
-
public deltaBytesSent = 0;
|
|
23
|
-
public deltaBytesReceived = 0;
|
|
24
|
-
public deltaMessagesSent = 0;
|
|
25
|
-
public deltaMessagesReceived = 0;
|
|
26
|
-
|
|
27
|
-
public appData?: Record<string, unknown>;
|
|
28
|
-
|
|
29
|
-
public constructor(
|
|
30
|
-
public timestamp: number,
|
|
31
|
-
public id: string,
|
|
32
|
-
private readonly _peerConnection: ObservedPeerConnection,
|
|
33
|
-
) {
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
public get visited() {
|
|
37
|
-
const visited = this._visited;
|
|
38
|
-
|
|
39
|
-
this._visited = false;
|
|
40
|
-
|
|
41
|
-
return visited;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
public getPeerConnection() {
|
|
45
|
-
return this._peerConnection;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
public update(stats: DataChannelStats) {
|
|
49
|
-
this._visited = true;
|
|
50
|
-
|
|
51
|
-
if (this.messagesSent && stats.messagesSent && stats.messagesSent >= this.messagesSent) {
|
|
52
|
-
this.deltaMessagesSent = stats.messagesSent - this.messagesSent;
|
|
53
|
-
} else {
|
|
54
|
-
this.deltaMessagesSent = 0;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
if (this.messagesReceived && stats.messagesReceived && stats.messagesReceived >= this.messagesReceived) {
|
|
58
|
-
this.deltaMessagesReceived = stats.messagesReceived - this.messagesReceived;
|
|
59
|
-
} else {
|
|
60
|
-
this.deltaMessagesReceived = 0;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
if (this.bytesSent && stats.bytesSent && stats.bytesSent >= this.bytesSent) {
|
|
64
|
-
this.deltaBytesSent = stats.bytesSent - this.bytesSent;
|
|
65
|
-
} else {
|
|
66
|
-
this.deltaBytesSent = 0;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
if (this.bytesReceived && stats.bytesReceived && stats.bytesReceived >= this.bytesReceived) {
|
|
70
|
-
this.deltaBytesReceived = stats.bytesReceived - this.bytesReceived;
|
|
71
|
-
} else {
|
|
72
|
-
this.deltaBytesReceived = 0;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
this.label = stats.label;
|
|
76
|
-
this.protocol = stats.protocol;
|
|
77
|
-
this.dataChannelIdentifier = stats.dataChannelIdentifier;
|
|
78
|
-
this.state = stats.state;
|
|
79
|
-
this.messagesSent = stats.messagesSent;
|
|
80
|
-
this.bytesSent = stats.bytesSent;
|
|
81
|
-
this.messagesReceived = stats.messagesReceived;
|
|
82
|
-
this.bytesReceived = stats.bytesReceived;
|
|
83
|
-
this.attachments = stats.attachments;
|
|
84
|
-
}
|
|
85
|
-
}
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import { ObservedPeerConnection } from './ObservedPeerConnection';
|
|
2
|
-
import { IceCandidateStats } from './schema/ClientSample';
|
|
3
|
-
|
|
4
|
-
export class ObservedIceCandidate implements IceCandidateStats {
|
|
5
|
-
private _visited = false;
|
|
6
|
-
public appData?: Record<string, unknown>;
|
|
7
|
-
|
|
8
|
-
transportId?: string | undefined;
|
|
9
|
-
address?: string | undefined;
|
|
10
|
-
port?: number | undefined;
|
|
11
|
-
protocol?: string | undefined;
|
|
12
|
-
candidateType?: string | undefined;
|
|
13
|
-
priority?: number | undefined;
|
|
14
|
-
url?: string | undefined;
|
|
15
|
-
relayProtocol?: string | undefined;
|
|
16
|
-
foundation?: string | undefined;
|
|
17
|
-
relatedAddress?: string | undefined;
|
|
18
|
-
relatedPort?: number | undefined;
|
|
19
|
-
usernameFragment?: string | undefined;
|
|
20
|
-
tcpType?: string | undefined;
|
|
21
|
-
attachments?: Record<string, unknown> | undefined;
|
|
22
|
-
|
|
23
|
-
public constructor(
|
|
24
|
-
public timestamp: number,
|
|
25
|
-
public id: string,
|
|
26
|
-
private readonly _peerConnection: ObservedPeerConnection
|
|
27
|
-
) {}
|
|
28
|
-
|
|
29
|
-
public get visited() {
|
|
30
|
-
const visited = this._visited;
|
|
31
|
-
|
|
32
|
-
this._visited = false;
|
|
33
|
-
|
|
34
|
-
return visited;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
public getPeerConnection() {
|
|
38
|
-
return this._peerConnection;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
public getIceTransport() {
|
|
42
|
-
return this._peerConnection.observedIceTransports.get(this.transportId ?? '');
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
public update(stats: IceCandidateStats) {
|
|
46
|
-
this._visited = true;
|
|
47
|
-
|
|
48
|
-
this.timestamp = stats.timestamp;
|
|
49
|
-
this.transportId = stats.transportId;
|
|
50
|
-
this.address = stats.address;
|
|
51
|
-
this.port = stats.port;
|
|
52
|
-
this.protocol = stats.protocol;
|
|
53
|
-
this.candidateType = stats.candidateType;
|
|
54
|
-
this.priority = stats.priority;
|
|
55
|
-
this.url = stats.url;
|
|
56
|
-
this.relayProtocol = stats.relayProtocol;
|
|
57
|
-
this.foundation = stats.foundation;
|
|
58
|
-
this.relatedAddress = stats.relatedAddress;
|
|
59
|
-
this.relatedPort = stats.relatedPort;
|
|
60
|
-
this.usernameFragment = stats.usernameFragment;
|
|
61
|
-
this.tcpType = stats.tcpType;
|
|
62
|
-
this.attachments = stats.attachments;
|
|
63
|
-
}
|
|
64
|
-
}
|
|
@@ -1,118 +0,0 @@
|
|
|
1
|
-
import { ObservedPeerConnection } from './ObservedPeerConnection';
|
|
2
|
-
import { IceCandidatePairStats } from './schema/ClientSample';
|
|
3
|
-
|
|
4
|
-
export class ObservedIceCandidatePair implements IceCandidatePairStats {
|
|
5
|
-
private _visited = false;
|
|
6
|
-
public appData?: Record<string, unknown>;
|
|
7
|
-
|
|
8
|
-
transportId?: string | undefined;
|
|
9
|
-
localCandidateId?: string | undefined;
|
|
10
|
-
remoteCandidateId?: string | undefined;
|
|
11
|
-
state?: 'new' | 'inProgress' | 'failed' | 'succeeded' | undefined;
|
|
12
|
-
nominated?: boolean | undefined;
|
|
13
|
-
packetsSent?: number | undefined;
|
|
14
|
-
packetsReceived?: number | undefined;
|
|
15
|
-
bytesSent?: number | undefined;
|
|
16
|
-
bytesReceived?: number | undefined;
|
|
17
|
-
lastPacketSentTimestamp?: number | undefined;
|
|
18
|
-
lastPacketReceivedTimestamp?: number | undefined;
|
|
19
|
-
totalRoundTripTime?: number | undefined;
|
|
20
|
-
currentRoundTripTime?: number | undefined;
|
|
21
|
-
availableOutgoingBitrate?: number | undefined;
|
|
22
|
-
availableIncomingBitrate?: number | undefined;
|
|
23
|
-
requestsReceived?: number | undefined;
|
|
24
|
-
requestsSent?: number | undefined;
|
|
25
|
-
responsesReceived?: number | undefined;
|
|
26
|
-
responsesSent?: number | undefined;
|
|
27
|
-
consentRequestsSent?: number | undefined;
|
|
28
|
-
packetsDiscardedOnSend?: number | undefined;
|
|
29
|
-
bytesDiscardedOnSend?: number | undefined;
|
|
30
|
-
attachments?: Record<string, unknown> | undefined;
|
|
31
|
-
|
|
32
|
-
public deltaBytesSent = 0;
|
|
33
|
-
public deltaBytesReceived = 0;
|
|
34
|
-
public deltaPacketsSent = 0;
|
|
35
|
-
public deltaPacketsReceived = 0;
|
|
36
|
-
|
|
37
|
-
public constructor(
|
|
38
|
-
public timestamp: number,
|
|
39
|
-
public id: string,
|
|
40
|
-
private readonly _peerConnection: ObservedPeerConnection,
|
|
41
|
-
) {
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
public get visited() {
|
|
45
|
-
const visited = this._visited;
|
|
46
|
-
|
|
47
|
-
this._visited = false;
|
|
48
|
-
|
|
49
|
-
return visited;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
public getPeerConnection() {
|
|
53
|
-
return this._peerConnection;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
public getIceTransport() {
|
|
57
|
-
return this._peerConnection.observedIceTransports.get(this.transportId ?? '');
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
public getLocalCandidate() {
|
|
61
|
-
return this._peerConnection.observedIceCandidates.get(this.localCandidateId ?? '');
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
public getRemoteCandidate() {
|
|
65
|
-
return this._peerConnection.observedIceCandidates.get(this.remoteCandidateId ?? '');
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
public update(stats: IceCandidatePairStats) {
|
|
69
|
-
this._visited = true;
|
|
70
|
-
|
|
71
|
-
if (this.packetsSent && stats.packetsSent && stats.packetsSent >= this.packetsSent) {
|
|
72
|
-
this.deltaPacketsSent = stats.packetsSent - this.packetsSent;
|
|
73
|
-
} else {
|
|
74
|
-
this.deltaPacketsSent = 0;
|
|
75
|
-
}
|
|
76
|
-
if (this.packetsReceived && stats.packetsReceived && stats.packetsReceived >= this.packetsReceived) {
|
|
77
|
-
this.deltaPacketsReceived = stats.packetsReceived - this.packetsReceived;
|
|
78
|
-
} else {
|
|
79
|
-
this.deltaPacketsReceived = 0;
|
|
80
|
-
}
|
|
81
|
-
if (this.bytesSent && stats.bytesSent && stats.bytesSent >= this.bytesSent) {
|
|
82
|
-
this.deltaBytesSent = stats.bytesSent - this.bytesSent;
|
|
83
|
-
} else {
|
|
84
|
-
this.deltaBytesSent = 0;
|
|
85
|
-
}
|
|
86
|
-
if (this.bytesReceived && stats.bytesReceived && stats.bytesReceived >= this.bytesReceived) {
|
|
87
|
-
this.deltaBytesReceived = stats.bytesReceived - this.bytesReceived;
|
|
88
|
-
} else {
|
|
89
|
-
this.deltaBytesReceived = 0;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
this.timestamp = stats.timestamp;
|
|
93
|
-
this.transportId = stats.transportId;
|
|
94
|
-
this.localCandidateId = stats.localCandidateId;
|
|
95
|
-
this.remoteCandidateId = stats.remoteCandidateId;
|
|
96
|
-
this.state = stats.state;
|
|
97
|
-
this.nominated = stats.nominated;
|
|
98
|
-
this.packetsSent = stats.packetsSent;
|
|
99
|
-
this.packetsReceived = stats.packetsReceived;
|
|
100
|
-
this.bytesSent = stats.bytesSent;
|
|
101
|
-
this.bytesReceived = stats.bytesReceived;
|
|
102
|
-
this.lastPacketSentTimestamp = stats.lastPacketSentTimestamp;
|
|
103
|
-
this.lastPacketReceivedTimestamp = stats.lastPacketReceivedTimestamp;
|
|
104
|
-
this.totalRoundTripTime = stats.totalRoundTripTime;
|
|
105
|
-
this.currentRoundTripTime = stats.currentRoundTripTime;
|
|
106
|
-
this.availableOutgoingBitrate = stats.availableOutgoingBitrate;
|
|
107
|
-
this.availableIncomingBitrate = stats.availableIncomingBitrate;
|
|
108
|
-
this.requestsReceived = stats.requestsReceived;
|
|
109
|
-
this.requestsSent = stats.requestsSent;
|
|
110
|
-
this.responsesReceived = stats.responsesReceived;
|
|
111
|
-
this.responsesSent = stats.responsesSent;
|
|
112
|
-
this.consentRequestsSent = stats.consentRequestsSent;
|
|
113
|
-
this.packetsDiscardedOnSend = stats.packetsDiscardedOnSend;
|
|
114
|
-
this.bytesDiscardedOnSend = stats.bytesDiscardedOnSend;
|
|
115
|
-
this.attachments = stats.attachments;
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
}
|