@observertc/observer-js 1.0.0-beta.3 → 1.0.0-beta.5

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.
Files changed (230) hide show
  1. package/README.md +790 -386
  2. package/dist/index.d.mts +2795 -0
  3. package/dist/index.d.ts +2795 -0
  4. package/dist/index.js +3765 -0
  5. package/dist/index.js.map +1 -0
  6. package/dist/index.mjs +3699 -0
  7. package/dist/index.mjs.map +1 -0
  8. package/package.json +28 -15
  9. package/.eslintrc.json +0 -143
  10. package/.prettierignore +0 -5
  11. package/.prettierrc +0 -7
  12. package/jest.config.js +0 -9
  13. package/lib/ObservedCall.d.ts +0 -70
  14. package/lib/ObservedCall.d.ts.map +0 -1
  15. package/lib/ObservedCall.js +0 -196
  16. package/lib/ObservedCallEventMonitor.d.ts +0 -107
  17. package/lib/ObservedCallEventMonitor.d.ts.map +0 -1
  18. package/lib/ObservedCallEventMonitor.js +0 -321
  19. package/lib/ObservedCallSummary.d.ts +0 -18
  20. package/lib/ObservedCallSummary.d.ts.map +0 -1
  21. package/lib/ObservedCallSummary.js +0 -2
  22. package/lib/ObservedCertificate.d.ts +0 -19
  23. package/lib/ObservedCertificate.d.ts.map +0 -1
  24. package/lib/ObservedCertificate.js +0 -38
  25. package/lib/ObservedClient.d.ts +0 -115
  26. package/lib/ObservedClient.d.ts.map +0 -1
  27. package/lib/ObservedClient.js +0 -714
  28. package/lib/ObservedClientEventMonitor.d.ts +0 -91
  29. package/lib/ObservedClientEventMonitor.d.ts.map +0 -1
  30. package/lib/ObservedClientEventMonitor.js +0 -254
  31. package/lib/ObservedClientSummary.d.ts +0 -23
  32. package/lib/ObservedClientSummary.d.ts.map +0 -1
  33. package/lib/ObservedClientSummary.js +0 -2
  34. package/lib/ObservedCodec.d.ts +0 -22
  35. package/lib/ObservedCodec.d.ts.map +0 -1
  36. package/lib/ObservedCodec.js +0 -45
  37. package/lib/ObservedDataChannel.d.ts +0 -30
  38. package/lib/ObservedDataChannel.d.ts.map +0 -1
  39. package/lib/ObservedDataChannel.js +0 -75
  40. package/lib/ObservedIceCandidate.d.ts +0 -29
  41. package/lib/ObservedIceCandidate.d.ts.map +0 -1
  42. package/lib/ObservedIceCandidate.js +0 -59
  43. package/lib/ObservedIceCandidatePair.d.ts +0 -45
  44. package/lib/ObservedIceCandidatePair.d.ts.map +0 -1
  45. package/lib/ObservedIceCandidatePair.js +0 -127
  46. package/lib/ObservedIceTransport.d.ts +0 -36
  47. package/lib/ObservedIceTransport.d.ts.map +0 -1
  48. package/lib/ObservedIceTransport.js +0 -93
  49. package/lib/ObservedInboundRtp.d.ts +0 -92
  50. package/lib/ObservedInboundRtp.d.ts.map +0 -1
  51. package/lib/ObservedInboundRtp.js +0 -193
  52. package/lib/ObservedInboundTrack.d.ts +0 -34
  53. package/lib/ObservedInboundTrack.d.ts.map +0 -1
  54. package/lib/ObservedInboundTrack.js +0 -92
  55. package/lib/ObservedMediaPlayout.d.ts +0 -22
  56. package/lib/ObservedMediaPlayout.d.ts.map +0 -1
  57. package/lib/ObservedMediaPlayout.js +0 -42
  58. package/lib/ObservedMediaSource.d.ts +0 -28
  59. package/lib/ObservedMediaSource.d.ts.map +0 -1
  60. package/lib/ObservedMediaSource.js +0 -55
  61. package/lib/ObservedOutboundRtp.d.ts +0 -62
  62. package/lib/ObservedOutboundRtp.d.ts.map +0 -1
  63. package/lib/ObservedOutboundRtp.js +0 -144
  64. package/lib/ObservedOutboundTrack.d.ts +0 -34
  65. package/lib/ObservedOutboundTrack.d.ts.map +0 -1
  66. package/lib/ObservedOutboundTrack.js +0 -65
  67. package/lib/ObservedPeerConnection.d.ts +0 -207
  68. package/lib/ObservedPeerConnection.d.ts.map +0 -1
  69. package/lib/ObservedPeerConnection.js +0 -788
  70. package/lib/ObservedPeerConnectionTransport.d.ts +0 -17
  71. package/lib/ObservedPeerConnectionTransport.d.ts.map +0 -1
  72. package/lib/ObservedPeerConnectionTransport.js +0 -34
  73. package/lib/ObservedRemoteInboundRtp.d.ts +0 -30
  74. package/lib/ObservedRemoteInboundRtp.d.ts.map +0 -1
  75. package/lib/ObservedRemoteInboundRtp.js +0 -60
  76. package/lib/ObservedRemoteOutboundRtp.d.ts +0 -30
  77. package/lib/ObservedRemoteOutboundRtp.d.ts.map +0 -1
  78. package/lib/ObservedRemoteOutboundRtp.js +0 -60
  79. package/lib/ObservedTURN.d.ts +0 -31
  80. package/lib/ObservedTURN.d.ts.map +0 -1
  81. package/lib/ObservedTURN.js +0 -58
  82. package/lib/ObservedTurnServer.d.ts +0 -25
  83. package/lib/ObservedTurnServer.d.ts.map +0 -1
  84. package/lib/ObservedTurnServer.js +0 -59
  85. package/lib/Observer.d.ts +0 -62
  86. package/lib/Observer.d.ts.map +0 -1
  87. package/lib/Observer.js +0 -160
  88. package/lib/ObserverEventMonitor.d.ts +0 -141
  89. package/lib/ObserverEventMonitor.d.ts.map +0 -1
  90. package/lib/ObserverEventMonitor.js +0 -440
  91. package/lib/ObserverSummary.d.ts +0 -13
  92. package/lib/ObserverSummary.d.ts.map +0 -1
  93. package/lib/ObserverSummary.js +0 -2
  94. package/lib/Reports.d.ts +0 -85
  95. package/lib/Reports.d.ts.map +0 -1
  96. package/lib/Reports.js +0 -2
  97. package/lib/common/Middleware.d.ts +0 -17
  98. package/lib/common/Middleware.d.ts.map +0 -1
  99. package/lib/common/Middleware.js +0 -60
  100. package/lib/common/SingleExecutor.d.ts +0 -3
  101. package/lib/common/SingleExecutor.d.ts.map +0 -1
  102. package/lib/common/SingleExecutor.js +0 -31
  103. package/lib/common/logger.d.ts +0 -17
  104. package/lib/common/logger.d.ts.map +0 -1
  105. package/lib/common/logger.js +0 -50
  106. package/lib/common/types.d.ts +0 -3
  107. package/lib/common/types.d.ts.map +0 -1
  108. package/lib/common/types.js +0 -3
  109. package/lib/common/utils.d.ts +0 -11
  110. package/lib/common/utils.d.ts.map +0 -1
  111. package/lib/common/utils.js +0 -63
  112. package/lib/detectors/Detector.d.ts +0 -5
  113. package/lib/detectors/Detector.d.ts.map +0 -1
  114. package/lib/detectors/Detector.js +0 -3
  115. package/lib/detectors/Detectors.d.ts +0 -11
  116. package/lib/detectors/Detectors.d.ts.map +0 -1
  117. package/lib/detectors/Detectors.js +0 -34
  118. package/lib/index.d.ts +0 -29
  119. package/lib/index.d.ts.map +0 -1
  120. package/lib/index.js +0 -49
  121. package/lib/mediasoup/ObservedMediaRouter.d.ts +0 -10
  122. package/lib/mediasoup/ObservedMediaRouter.d.ts.map +0 -1
  123. package/lib/mediasoup/ObservedMediaRouter.js +0 -6
  124. package/lib/monitors/TurnUsageMonitor.d.ts +0 -1
  125. package/lib/monitors/TurnUsageMonitor.d.ts.map +0 -1
  126. package/lib/monitors/TurnUsageMonitor.js +0 -146
  127. package/lib/schema/ClientEventTypes.d.ts +0 -228
  128. package/lib/schema/ClientEventTypes.d.ts.map +0 -1
  129. package/lib/schema/ClientEventTypes.js +0 -41
  130. package/lib/schema/ClientMetaTypes.d.ts +0 -34
  131. package/lib/schema/ClientMetaTypes.d.ts.map +0 -1
  132. package/lib/schema/ClientMetaTypes.js +0 -16
  133. package/lib/schema/ClientSample.d.ts +0 -1333
  134. package/lib/schema/ClientSample.d.ts.map +0 -1
  135. package/lib/schema/ClientSample.js +0 -4
  136. package/lib/scores/CalculatedScore.d.ts +0 -6
  137. package/lib/scores/CalculatedScore.d.ts.map +0 -1
  138. package/lib/scores/CalculatedScore.js +0 -2
  139. package/lib/scores/DefaultCallScoreCalculator.d.ts +0 -7
  140. package/lib/scores/DefaultCallScoreCalculator.d.ts.map +0 -1
  141. package/lib/scores/DefaultCallScoreCalculator.js +0 -21
  142. package/lib/scores/ScoreCalculator.d.ts +0 -4
  143. package/lib/scores/ScoreCalculator.d.ts.map +0 -1
  144. package/lib/scores/ScoreCalculator.js +0 -2
  145. package/lib/updaters/CallUpdater.d.ts +0 -5
  146. package/lib/updaters/CallUpdater.d.ts.map +0 -1
  147. package/lib/updaters/CallUpdater.js +0 -2
  148. package/lib/updaters/ObserverUpdater.d.ts +0 -5
  149. package/lib/updaters/ObserverUpdater.d.ts.map +0 -1
  150. package/lib/updaters/ObserverUpdater.js +0 -2
  151. package/lib/updaters/OnAllCallObserverUpdater.d.ts +0 -15
  152. package/lib/updaters/OnAllCallObserverUpdater.d.ts.map +0 -1
  153. package/lib/updaters/OnAllCallObserverUpdater.js +0 -50
  154. package/lib/updaters/OnAllClientCallUpdater.d.ts +0 -15
  155. package/lib/updaters/OnAllClientCallUpdater.d.ts.map +0 -1
  156. package/lib/updaters/OnAllClientCallUpdater.js +0 -53
  157. package/lib/updaters/OnAnyCallObserverUpdater.d.ts +0 -12
  158. package/lib/updaters/OnAnyCallObserverUpdater.d.ts.map +0 -1
  159. package/lib/updaters/OnAnyCallObserverUpdater.js +0 -37
  160. package/lib/updaters/OnAnyClientCallUpdater.d.ts +0 -12
  161. package/lib/updaters/OnAnyClientCallUpdater.d.ts.map +0 -1
  162. package/lib/updaters/OnAnyClientCallUpdater.js +0 -36
  163. package/lib/updaters/OnIntervalUpdater.d.ts +0 -10
  164. package/lib/updaters/OnIntervalUpdater.d.ts.map +0 -1
  165. package/lib/updaters/OnIntervalUpdater.js +0 -17
  166. package/lib/updaters/Updater.d.ts +0 -6
  167. package/lib/updaters/Updater.d.ts.map +0 -1
  168. package/lib/updaters/Updater.js +0 -2
  169. package/lib/utils/MediasoupRemoteTrackResolver.d.ts +0 -25
  170. package/lib/utils/MediasoupRemoteTrackResolver.d.ts.map +0 -1
  171. package/lib/utils/MediasoupRemoteTrackResolver.js +0 -110
  172. package/lib/utils/RemoteTrackResolver.d.ts +0 -7
  173. package/lib/utils/RemoteTrackResolver.d.ts.map +0 -1
  174. package/lib/utils/RemoteTrackResolver.js +0 -2
  175. package/src/ObservedCall.ts +0 -308
  176. package/src/ObservedCallEventMonitor.ts +0 -402
  177. package/src/ObservedCallSummary.ts +0 -22
  178. package/src/ObservedCertificate.ts +0 -43
  179. package/src/ObservedClient.ts +0 -883
  180. package/src/ObservedClientEventMonitor.ts +0 -309
  181. package/src/ObservedClientSummary.ts +0 -24
  182. package/src/ObservedCodec.ts +0 -49
  183. package/src/ObservedDataChannel.ts +0 -85
  184. package/src/ObservedIceCandidate.ts +0 -64
  185. package/src/ObservedIceCandidatePair.ts +0 -134
  186. package/src/ObservedIceTransport.ts +0 -99
  187. package/src/ObservedInboundRtp.ts +0 -205
  188. package/src/ObservedInboundTrack.ts +0 -105
  189. package/src/ObservedMediaPlayout.ts +0 -49
  190. package/src/ObservedMediaSource.ts +0 -60
  191. package/src/ObservedOutboundRtp.ts +0 -156
  192. package/src/ObservedOutboundTrack.ts +0 -82
  193. package/src/ObservedPeerConnection.ts +0 -1104
  194. package/src/ObservedPeerConnectionTransport.ts +0 -38
  195. package/src/ObservedRemoteInboundRtp.ts +0 -64
  196. package/src/ObservedRemoteOutboundRtp.ts +0 -65
  197. package/src/ObservedTURN.ts +0 -86
  198. package/src/ObservedTurnServer.ts +0 -72
  199. package/src/Observer.ts +0 -248
  200. package/src/ObserverEventMonitor.ts +0 -561
  201. package/src/ObserverSummary.ts +0 -15
  202. package/src/Reports.ts +0 -87
  203. package/src/common/Middleware.ts +0 -84
  204. package/src/common/SingleExecutor.ts +0 -36
  205. package/src/common/logger.ts +0 -82
  206. package/src/common/types.ts +0 -4
  207. package/src/common/utils.ts +0 -69
  208. package/src/detectors/Detector.ts +0 -6
  209. package/src/detectors/Detectors.ts +0 -38
  210. package/src/index.ts +0 -32
  211. package/src/mediasoup/ObservedMediaRouter.ts +0 -10
  212. package/src/monitors/TurnUsageMonitor.ts +0 -187
  213. package/src/schema/ClientEventTypes.ts +0 -280
  214. package/src/schema/ClientMetaTypes.ts +0 -41
  215. package/src/schema/ClientSample.ts +0 -1682
  216. package/src/scores/CalculatedScore.ts +0 -6
  217. package/src/scores/DefaultCallScoreCalculator.ts +0 -23
  218. package/src/scores/ScoreCalculator.ts +0 -3
  219. package/src/updaters/CallUpdater.ts +0 -5
  220. package/src/updaters/ObserverUpdater.ts +0 -5
  221. package/src/updaters/OnAllCallObserverUpdater.ts +0 -59
  222. package/src/updaters/OnAllClientCallUpdater.ts +0 -61
  223. package/src/updaters/OnAnyCallObserverUpdater.ts +0 -41
  224. package/src/updaters/OnAnyClientCallUpdater.ts +0 -39
  225. package/src/updaters/OnIntervalUpdater.ts +0 -19
  226. package/src/updaters/Updater.ts +0 -5
  227. package/src/utils/MediasoupRemoteTrackResolver.ts +0 -155
  228. package/src/utils/RemoteTrackResolver.ts +0 -12
  229. package/tsconfig.json +0 -19
  230. package/tslint.json +0 -6
@@ -1,402 +0,0 @@
1
- import { ObservedCall } from './ObservedCall';
2
- import { ObservedCertificate } from './ObservedCertificate';
3
- import { ObservedClient, ObservedClientEvents } from './ObservedClient';
4
- import { ObservedCodec } from './ObservedCodec';
5
- import { ObservedDataChannel } from './ObservedDataChannel';
6
- import { ObservedIceCandidate } from './ObservedIceCandidate';
7
- import { ObservedIceCandidatePair } from './ObservedIceCandidatePair';
8
- import { ObservedIceTransport } from './ObservedIceTransport';
9
- import { ObservedInboundRtp } from './ObservedInboundRtp';
10
- import { ObservedInboundTrack } from './ObservedInboundTrack';
11
- import { ObservedMediaPlayout } from './ObservedMediaPlayout';
12
- import { ObservedMediaSource } from './ObservedMediaSource';
13
- import { ObservedOutboundRtp } from './ObservedOutboundRtp';
14
- import { ObservedOutboundTrack } from './ObservedOutboundTrack';
15
- import { ObservedPeerConnection } from './ObservedPeerConnection';
16
- import { TrackReport } from './Reports';
17
- import { ClientEvent, ClientIssue, ClientMetaData, ClientSample, ExtensionStat } from './schema/ClientSample';
18
-
19
- export class ObservedCallEventMonitor<Context> {
20
- public constructor(
21
- public readonly call: ObservedCall,
22
- public readonly context: Context,
23
- ) {
24
- this._onPeerConnconnectionAdded = this._onPeerConnconnectionAdded.bind(this);
25
- this._onPeerConnectionRemoved = this._onPeerConnectionRemoved.bind(this);
26
- this._onCertificateAdded = this._onCertificateAdded.bind(this);
27
- this._onCertificateRemoved = this._onCertificateRemoved.bind(this);
28
- this._onInboundTrackAdded = this._onInboundTrackAdded.bind(this);
29
- this._onInboundTrackRemoved = this._onInboundTrackRemoved.bind(this);
30
- this._onOutboundTrackAdded = this._onOutboundTrackAdded.bind(this);
31
- this._onOutboundTrackRemoved = this._onOutboundTrackRemoved.bind(this);
32
- this._onInboundRtpAdded = this._onInboundRtpAdded.bind(this);
33
- this._onInboundRtpRemoved = this._onInboundRtpRemoved.bind(this);
34
- this._onOutboundRtpAdded = this._onOutboundRtpAdded.bind(this);
35
- this._onOutboundRtpRemoved = this._onOutboundRtpRemoved.bind(this);
36
- this._onDataChannelAdded = this._onDataChannelAdded.bind(this);
37
- this._onDataChannelRemoved = this._onDataChannelRemoved.bind(this);
38
- this._onAddedIceTransport = this._onAddedIceTransport.bind(this);
39
- this._onRemovedIceTransport = this._onRemovedIceTransport.bind(this);
40
- this._onIceCandidateAdded = this._onIceCandidateAdded.bind(this);
41
- this._onIceCandidateRemoved = this._onIceCandidateRemoved.bind(this);
42
- this._onAddedIceCandidatePair = this._onAddedIceCandidatePair.bind(this);
43
- this._onRemovedIceCandidatePair = this._onRemovedIceCandidatePair.bind(this);
44
- this._onAddedMediaCodec = this._onAddedMediaCodec.bind(this);
45
- this._onRemovedMediaCodec = this._onRemovedMediaCodec.bind(this);
46
- this._onAddedMediaPlayout = this._onAddedMediaPlayout.bind(this);
47
- this._onRemovedMediaPlayout = this._onRemovedMediaPlayout.bind(this);
48
- this._onMediaSourceAdded = this._onMediaSourceAdded.bind(this);
49
- this._onMediaSourceRemoved = this._onMediaSourceRemoved.bind(this);
50
- this._onClientIssue = this._onClientIssue.bind(this);
51
- this._onClientMetadata = this._onClientMetadata.bind(this);
52
- this._onClientJoined = this._onClientJoined.bind(this);
53
- this._onClientLeft = this._onClientLeft.bind(this);
54
- this._onUserMediaError = this._onUserMediaError.bind(this);
55
- this._onUsingTurn = this._onUsingTurn.bind(this);
56
- this._onClientAdded = this._onClientAdded.bind(this);
57
- this._onCallAdded = this._onCallAdded.bind(this);
58
- this._onClientRejoined = this._onClientRejoined.bind(this);
59
- this._onClientExtensionStats = this._onClientExtensionStats.bind(this);
60
-
61
- this._onCallAdded(call);
62
- }
63
-
64
- // Public event handlers
65
- public onCallClosed?: (call: ObservedCall, ctx: Context) => void;
66
- public onCallEmpty?: (call: ObservedCall, ctx: Context) => void;
67
- public onCallNotEmpty?: (call: ObservedCall, ctx: Context) => void;
68
- public onCallUpdated?: (call: ObservedCall, ctx: Context) => void;
69
-
70
- public onClientAdded?: (client: ObservedClient, ctx: Context) => void;
71
- public onClientClosed?: (client: ObservedClient, ctx: Context) => void;
72
- public onClientRejoined?: (client: ObservedClient, ctx: Context) => void;
73
- public onClientIssue?: (observedClent: ObservedClient, issue: ClientIssue, ctx: Context) => void;
74
- public onClientMetadata?: (observedClient: ObservedClient, metadata: ClientMetaData, ctx: Context) => void;
75
- public onClientExtensionStats?: (observedClient: ObservedClient, extensionStats: ExtensionStat, ctx: Context) => void;
76
- public onClientJoined?: (client: ObservedClient, ctx: Context) => void;
77
- public onClientLeft?: (client: ObservedClient, ctx: Context) => void;
78
- public onClientUserMediaError?: (observedClient: ObservedClient, error: string, ctx: Context) => void;
79
- public onClientUsingTurn?: (client: ObservedClient, usingTurn: boolean, ctx: Context) => void;
80
- public onClientUpdated?: (client: ObservedClient, sample: ClientSample, ctx: Context) => void;
81
- public onClientEvent?: (client: ObservedClient, event: ClientEvent, ctx: Context) => void;
82
-
83
- public onPeerConnectionAdded?: (peerConnection: ObservedPeerConnection, ctx: Context) => void;
84
- public onPeerConnectionRemoved?: (peerConnection: ObservedPeerConnection, ctx: Context) => void;
85
- public onSelectedCandidatePairChanged?: (peerConnection: ObservedPeerConnection, ctx: Context) => void;
86
- public onIceGatheringStateChange?: (peerConnection: ObservedPeerConnection, ctx: Context) => void;
87
- public onIceConnectionStateChange?: (peerConnection: ObservedPeerConnection, ctx: Context) => void;
88
- public onConnectionStateChange?: (peerConnection: ObservedPeerConnection, ctx: Context) => void;
89
-
90
- public onCertificateAdded?: (certificate: ObservedCertificate, ctx: Context) => void;
91
- public onCertificateRemoved?: (certificate: ObservedCertificate, ctx: Context) => void;
92
-
93
- public onInboundTrackAdded?: (inboundTrack: ObservedInboundTrack, ctx: Context) => void;
94
- public onInboundTrackRemoved?: (inboundTrack: ObservedInboundTrack, ctx: Context) => void;
95
-
96
- public onOutboundTrackAdded?: (outboundTrack: ObservedOutboundTrack, ctx: Context) => void;
97
- public onOutboundTrackRemoved?: (outboundTrack: ObservedOutboundTrack, ctx: Context) => void;
98
-
99
- public onInboundRtpAdded?: (inboundRtp: ObservedInboundRtp, ctx: Context) => void;
100
- public onInboundRtpRemoved?: (inboundRtp: ObservedInboundRtp, ctx: Context) => void;
101
-
102
- public onOutboundRtpAdded?: (outboundRtp: ObservedOutboundRtp, ctx: Context) => void;
103
- public onOutboundRtpRemoved?: (outboundRtp: ObservedOutboundRtp, ctx: Context) => void;
104
-
105
- public onDataChannelAdded?: (dataChannel: ObservedDataChannel, ctx: Context) => void;
106
- public onDataChannelRemoved?: (dataChannel: ObservedDataChannel, ctx: Context) => void;
107
-
108
- public onAddedIceTransport?: (iceTransport: ObservedIceTransport, ctx: Context) => void;
109
- public onRemovedIceTransport?: (iceTransport: ObservedIceTransport, ctx: Context) => void;
110
-
111
- public onIceCandidateAdded?: (iceCandidate: ObservedIceCandidate, ctx: Context) => void;
112
- public onIceCandidateRemoved?: (iceCandidate: ObservedIceCandidate, ctx: Context) => void;
113
-
114
- public onAddedIceCandidatePair?: (candidatePair: ObservedIceCandidatePair, ctx: Context) => void;
115
- public onRemovedIceCandidatePair?: (candidatePair: ObservedIceCandidatePair, ctx: Context) => void;
116
-
117
- public onAddedMediaCodec?: (codec: ObservedCodec, ctx: Context) => void;
118
- public onRemovedMediaCodec?: (codec: ObservedCodec, ctx: Context) => void;
119
-
120
- public onAddedMediaPlayout?: (mediaPlayout: ObservedMediaPlayout, ctx: Context) => void;
121
- public onRemovedMediaPlayout?: (mediaPlayout: ObservedMediaPlayout, ctx: Context) => void;
122
-
123
- public onMediaSourceAdded?: (mediaSource: ObservedMediaSource, ctx: Context) => void;
124
- public onMediaSourceRemoved?: (mediaSource: ObservedMediaSource, ctx: Context) => void;
125
-
126
- public onTrackReport?: (trackReport: TrackReport, ctx: Context) => void;
127
-
128
- private _onCallAdded(call: ObservedCall) {
129
- const onCallEmpty = () => this.onCallEmpty?.(call, this.context);
130
- const onCallNotEmpty = () => this.onCallNotEmpty?.(call, this.context);
131
- const onCallUpdated = () => this.onCallUpdated?.(call, this.context);
132
-
133
- call.once('close', () => {
134
- call.off('newclient', this._onClientAdded);
135
- call.off('empty', onCallEmpty);
136
- call.off('not-empty', onCallNotEmpty);
137
- call.off('update', onCallUpdated);
138
-
139
- this.onCallClosed?.(call, this.context);
140
-
141
- });
142
- call.on('newclient', this._onClientAdded);
143
- call.on('empty', onCallEmpty);
144
- call.on('not-empty', onCallNotEmpty);
145
- call.on('update', onCallUpdated);
146
-
147
- }
148
-
149
- private _onClientAdded(observedClient: ObservedClient) {
150
- const onClientIssue = (issue: ClientIssue) => this._onClientIssue(observedClient, issue);
151
- const onClientMetadata = (metaData: ClientMetaData) => this._onClientMetadata(observedClient, metaData);
152
- const onClientJoined = () => this._onClientJoined(observedClient);
153
- const onClientLeft = () => this._onClientLeft(observedClient);
154
- const onClientRejoined = () => this._onClientRejoined(observedClient);
155
- const onClientExtensionStats = (extensionStats: ExtensionStat) => this._onClientExtensionStats(observedClient, extensionStats);
156
- const onUsingTurn = (usingTurn: boolean) => this._onUsingTurn(observedClient, usingTurn);
157
- const onUserMediaError = (error: string) => this._onUserMediaError(observedClient, error);
158
- const onClientUpdated = (...args: ObservedClientEvents['update']) => this.onClientUpdated?.(observedClient, args[0], this.context);
159
- const onClientEvent = (event: ClientEvent) => this.onClientEvent?.(observedClient, event, this.context);
160
- const onTrackReport = (trackReport: TrackReport) => this._onTrackReport(observedClient, trackReport);
161
-
162
- observedClient.once('close', () => {
163
- observedClient.off('newpeerconnection', this._onPeerConnconnectionAdded);
164
- observedClient.off('issue', onClientIssue);
165
- observedClient.off('metaData', onClientMetadata);
166
- observedClient.off('joined', onClientJoined);
167
- observedClient.off('left', onClientLeft);
168
- observedClient.off('rejoined', onClientJoined);
169
- observedClient.off('usermediaerror', onUserMediaError);
170
- observedClient.off('usingturn', onUsingTurn);
171
- observedClient.off('update', onClientUpdated);
172
- observedClient.off('clientEvent', onClientEvent);
173
- observedClient.off('trackreport', onTrackReport);
174
-
175
- this.onClientClosed?.(observedClient, this.context);
176
- });
177
-
178
- observedClient.on('newpeerconnection', this._onPeerConnconnectionAdded);
179
- observedClient.on('issue', onClientIssue);
180
- observedClient.on('metaData', onClientMetadata);
181
- observedClient.on('joined', onClientJoined);
182
- observedClient.on('left', onClientLeft);
183
- observedClient.on('rejoined', onClientRejoined);
184
- observedClient.on('usermediaerror', onUserMediaError);
185
- observedClient.on('usingturn', onUsingTurn);
186
- observedClient.on('extensionStats', onClientExtensionStats);
187
- observedClient.on('update', onClientUpdated);
188
- observedClient.on('clientEvent', onClientEvent);
189
- observedClient.on('trackreport', onTrackReport);
190
-
191
- this.onClientAdded?.(observedClient, this.context);
192
- }
193
-
194
- private _onClientRejoined(observedClient: ObservedClient) {
195
- this.onClientRejoined?.(observedClient, this.context);
196
- }
197
-
198
- private _onPeerConnconnectionAdded(peerConnection: ObservedPeerConnection) {
199
- const onSelectedCandidatePairChanged = () => this.onSelectedCandidatePairChanged?.(peerConnection, this.context);
200
- const onIceGatheringStateChange = () => this.onIceGatheringStateChange?.(peerConnection, this.context);
201
- const onIceConnectionStateChange = () => this.onIceConnectionStateChange?.(peerConnection, this.context);
202
- const onConnectionStateChange = () => this.onConnectionStateChange?.(peerConnection, this.context);
203
-
204
- peerConnection.once('close', () => {
205
- peerConnection.off('added-certificate', this._onCertificateAdded);
206
- peerConnection.off('removed-certificate', this._onCertificateRemoved);
207
- peerConnection.off('added-inbound-track', this._onInboundTrackAdded);
208
- peerConnection.off('removed-inbound-track', this._onInboundTrackRemoved);
209
- peerConnection.off('added-outbound-track', this._onOutboundTrackAdded);
210
- peerConnection.off('removed-outbound-track', this._onOutboundTrackRemoved);
211
- peerConnection.off('added-inbound-rtp', this._onInboundRtpAdded);
212
- peerConnection.off('removed-inbound-rtp', this._onInboundRtpRemoved);
213
- peerConnection.off('added-outbound-rtp', this._onOutboundRtpAdded);
214
- peerConnection.off('removed-outbound-rtp', this._onOutboundRtpRemoved);
215
- peerConnection.off('added-data-channel', this._onDataChannelAdded);
216
- peerConnection.off('removed-data-channel', this._onDataChannelRemoved);
217
- peerConnection.off('added-ice-transport', this._onAddedIceTransport);
218
- peerConnection.off('removed-ice-transport', this._onRemovedIceTransport);
219
- peerConnection.off('added-ice-candidate', this._onIceCandidateAdded);
220
- peerConnection.off('removed-ice-candidate', this._onIceCandidateRemoved);
221
- peerConnection.off('added-ice-candidate-pair', this._onAddedIceCandidatePair);
222
- peerConnection.off('removed-ice-candidate-pair', this._onRemovedIceCandidatePair);
223
- peerConnection.off('added-codec', this._onAddedMediaCodec);
224
- peerConnection.off('removed-codec', this._onRemovedMediaCodec);
225
- peerConnection.off('added-media-playout', this._onAddedMediaPlayout);
226
- peerConnection.off('removed-media-playout', this._onRemovedMediaPlayout);
227
- peerConnection.off('added-media-source', this._onMediaSourceAdded);
228
- peerConnection.off('removed-media-source', this._onMediaSourceRemoved);
229
- peerConnection.off('selectedcandidatepair', onSelectedCandidatePairChanged);
230
- peerConnection.off('icegatheringstatechange', onIceGatheringStateChange);
231
- peerConnection.off('iceconnectionstatechange', onIceConnectionStateChange);
232
- peerConnection.off('connectionstatechange', onConnectionStateChange);
233
-
234
- this.onPeerConnectionRemoved?.(peerConnection, this.context);
235
- });
236
-
237
- peerConnection.on('added-certificate', this._onCertificateAdded);
238
- peerConnection.on('removed-certificate', this._onCertificateRemoved);
239
- peerConnection.on('added-inbound-track', this._onInboundTrackAdded);
240
- peerConnection.on('removed-inbound-track', this._onInboundTrackRemoved);
241
- peerConnection.on('added-outbound-track', this._onOutboundTrackAdded);
242
- peerConnection.on('removed-outbound-track', this._onOutboundTrackRemoved);
243
- peerConnection.on('added-inbound-rtp', this._onInboundRtpAdded);
244
- peerConnection.on('removed-inbound-rtp', this._onInboundRtpRemoved);
245
- peerConnection.on('added-outbound-rtp', this._onOutboundRtpAdded);
246
- peerConnection.on('removed-outbound-rtp', this._onOutboundRtpRemoved);
247
- peerConnection.on('added-data-channel', this._onDataChannelAdded);
248
- peerConnection.on('removed-data-channel', this._onDataChannelRemoved);
249
- peerConnection.on('added-ice-transport', this._onAddedIceTransport);
250
- peerConnection.on('removed-ice-transport', this._onRemovedIceTransport);
251
- peerConnection.on('added-ice-candidate', this._onIceCandidateAdded);
252
- peerConnection.on('removed-ice-candidate', this._onIceCandidateRemoved);
253
- peerConnection.on('added-ice-candidate-pair', this._onAddedIceCandidatePair);
254
- peerConnection.on('removed-ice-candidate-pair', this._onRemovedIceCandidatePair);
255
- peerConnection.on('added-codec', this._onAddedMediaCodec);
256
- peerConnection.on('removed-codec', this._onRemovedMediaCodec);
257
- peerConnection.on('added-media-playout', this._onAddedMediaPlayout);
258
- peerConnection.on('removed-media-playout', this._onRemovedMediaPlayout);
259
- peerConnection.on('added-media-source', this._onMediaSourceAdded);
260
- peerConnection.on('removed-media-source', this._onMediaSourceRemoved);
261
- peerConnection.on('selectedcandidatepair', onSelectedCandidatePairChanged);
262
- peerConnection.on('icegatheringstatechange', onIceGatheringStateChange);
263
- peerConnection.on('iceconnectionstatechange', onIceConnectionStateChange);
264
- peerConnection.on('connectionstatechange', onConnectionStateChange);
265
-
266
- this.onPeerConnectionAdded?.(peerConnection, this.context);
267
-
268
- }
269
-
270
- private _onPeerConnectionRemoved(peerConnection: ObservedPeerConnection) {
271
- this.onPeerConnectionRemoved?.(peerConnection, this.context);
272
-
273
- }
274
-
275
- private _onCertificateAdded(certificate: ObservedCertificate) {
276
- this.onCertificateAdded?.(certificate, this.context);
277
- }
278
-
279
- private _onCertificateRemoved(certificate: ObservedCertificate) {
280
- this.onCertificateRemoved?.(certificate, this.context);
281
- }
282
-
283
- private _onInboundTrackAdded(inboundTrack: ObservedInboundTrack) {
284
- this.onInboundTrackAdded?.(inboundTrack, this.context);
285
- }
286
-
287
- private _onInboundTrackRemoved(inboundTrack: ObservedInboundTrack) {
288
- this.onInboundTrackRemoved?.(inboundTrack, this.context);
289
- }
290
-
291
- private _onOutboundTrackAdded(outboundTrack: ObservedOutboundTrack) {
292
- this.onOutboundTrackAdded?.(outboundTrack, this.context);
293
- }
294
-
295
- private _onOutboundTrackRemoved(outboundTrack: ObservedOutboundTrack) {
296
- this.onOutboundTrackRemoved?.(outboundTrack, this.context);
297
- }
298
-
299
- private _onInboundRtpAdded(inboundRtp: ObservedInboundRtp) {
300
- this.onInboundRtpAdded?.(inboundRtp, this.context);
301
- }
302
-
303
- private _onInboundRtpRemoved(inboundRtp: ObservedInboundRtp) {
304
- this.onInboundRtpRemoved?.(inboundRtp, this.context);
305
- }
306
-
307
- private _onOutboundRtpAdded(outboundRtp: ObservedOutboundRtp) {
308
- this.onOutboundRtpAdded?.(outboundRtp, this.context);
309
- }
310
-
311
- private _onOutboundRtpRemoved(outboundRtp: ObservedOutboundRtp) {
312
- this.onOutboundRtpRemoved?.(outboundRtp, this.context);
313
- }
314
-
315
- private _onDataChannelAdded(dataChannel: ObservedDataChannel) {
316
- this.onDataChannelAdded?.(dataChannel, this.context);
317
- }
318
-
319
- private _onDataChannelRemoved(dataChannel: ObservedDataChannel) {
320
- this.onDataChannelRemoved?.(dataChannel, this.context);
321
- }
322
-
323
- private _onAddedIceTransport(iceTransport: ObservedIceTransport) {
324
- this.onAddedIceTransport?.(iceTransport, this.context);
325
- }
326
-
327
- private _onRemovedIceTransport(iceTransport: ObservedIceTransport) {
328
- this.onRemovedIceTransport?.(iceTransport, this.context);
329
- }
330
-
331
- private _onIceCandidateAdded(iceCandidate: ObservedIceCandidate) {
332
- this.onIceCandidateAdded?.(iceCandidate, this.context);
333
- }
334
-
335
- private _onIceCandidateRemoved(iceCandidate: ObservedIceCandidate) {
336
- this.onIceCandidateRemoved?.(iceCandidate, this.context);
337
- }
338
-
339
- private _onAddedIceCandidatePair(candidatePair: ObservedIceCandidatePair) {
340
- this.onAddedIceCandidatePair?.(candidatePair, this.context);
341
- }
342
-
343
- private _onRemovedIceCandidatePair(candidatePair: ObservedIceCandidatePair) {
344
- this.onRemovedIceCandidatePair?.(candidatePair, this.context);
345
- }
346
-
347
- private _onAddedMediaCodec(codec: ObservedCodec) {
348
- this.onAddedMediaCodec?.(codec, this.context);
349
- }
350
-
351
- private _onRemovedMediaCodec(codec: ObservedCodec) {
352
- this.onRemovedMediaCodec?.(codec, this.context);
353
- }
354
-
355
- private _onAddedMediaPlayout(mediaPlayout: ObservedMediaPlayout) {
356
- this.onAddedMediaPlayout?.(mediaPlayout, this.context);
357
- }
358
-
359
- private _onRemovedMediaPlayout(mediaPlayout: ObservedMediaPlayout) {
360
- this.onRemovedMediaPlayout?.(mediaPlayout, this.context);
361
- }
362
-
363
- private _onMediaSourceAdded(mediaSource: ObservedMediaSource) {
364
- this.onMediaSourceAdded?.(mediaSource, this.context);
365
- }
366
-
367
- private _onMediaSourceRemoved(mediaSource: ObservedMediaSource) {
368
- this.onMediaSourceRemoved?.(mediaSource, this.context);
369
- }
370
-
371
- private _onClientIssue(observedClent: ObservedClient, issue: ClientIssue) {
372
- this.onClientIssue?.(observedClent, issue, this.context);
373
- }
374
-
375
- private _onClientMetadata(observedClient: ObservedClient, metadata: ClientMetaData) {
376
- this.onClientMetadata?.(observedClient, metadata, this.context);
377
- }
378
-
379
- private _onClientExtensionStats(observedClient: ObservedClient, extensionStats: ExtensionStat) {
380
- this.onClientExtensionStats?.(observedClient, extensionStats, this.context);
381
- }
382
-
383
- private _onClientJoined(observedClient: ObservedClient) {
384
- this.onClientJoined?.(observedClient, this.context);
385
- }
386
-
387
- private _onClientLeft(observedClient: ObservedClient) {
388
- this.onClientLeft?.(observedClient, this.context);
389
- }
390
-
391
- private _onUserMediaError(observedClient: ObservedClient, error: string) {
392
- this.onClientUserMediaError?.(observedClient, error, this.context);
393
- }
394
-
395
- private _onUsingTurn(observedClient: ObservedClient, usingTurn: boolean) {
396
- this.onClientUsingTurn?.(observedClient, usingTurn, this.context);
397
- }
398
-
399
- private _onTrackReport(client: ObservedClient, trackReport: TrackReport) {
400
- this.onTrackReport?.(trackReport, this.context);
401
- }
402
- }
@@ -1,22 +0,0 @@
1
- export type ObservedCallSummary = {
2
- currentActiveClients: number;
3
-
4
- totalAddedClients: number;
5
- totalRemovedClients: number;
6
-
7
- totalClientsSentBytes: number,
8
- totalClientsReceivedBytes: number,
9
- totalClientsReceivedAudioBytes: number,
10
- totalClientsReceivedVideoBytes: number,
11
- totalClientsSentAudioBytes: number,
12
- totalClientsSentVideoBytes: number,
13
-
14
- totalRttLt50Measurements: number,
15
- totalRttLt150Measurements: number,
16
- totalRttLt300Measurements: number,
17
- totalRttGtOrEq300Measurements: number,
18
-
19
- numberOfIssues: number,
20
-
21
- numberOfClientsUsedTurn: number;
22
- }
@@ -1,43 +0,0 @@
1
- import { ObservedPeerConnection } from './ObservedPeerConnection';
2
- import { CertificateStats } from './schema/ClientSample';
3
-
4
- export class ObservedCertificate implements CertificateStats {
5
- public appData?: Record<string, unknown>;
6
-
7
- private _visited = false;
8
-
9
- fingerprint?: string;
10
- fingerprintAlgorithm?: string;
11
- base64Certificate?: string;
12
- issuerCertificateId?: string;
13
- attachments?: Record<string, unknown>;
14
-
15
- public constructor(
16
- public timestamp: number,
17
- public id: string,
18
- private readonly _peerConnection: ObservedPeerConnection
19
- ) {}
20
-
21
- public get visited() {
22
- const visited = this._visited;
23
-
24
- this._visited = false;
25
-
26
- return visited;
27
- }
28
-
29
- public getPeerConnection() {
30
- return this._peerConnection;
31
- }
32
-
33
- public update(stats: CertificateStats) {
34
- this._visited = true;
35
-
36
- this.timestamp = stats.timestamp;
37
- this.fingerprint = stats.fingerprint;
38
- this.fingerprintAlgorithm = stats.fingerprintAlgorithm;
39
- this.base64Certificate = stats.base64Certificate;
40
- this.issuerCertificateId = stats.issuerCertificateId;
41
- this.attachments = stats.attachments;
42
- }
43
- }