@webex/plugin-meetings 2.18.0 → 2.19.2

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 (64) hide show
  1. package/README.md +0 -300
  2. package/dist/constants.js +3 -206
  3. package/dist/constants.js.map +1 -1
  4. package/dist/meeting/effectsState.js +1 -2
  5. package/dist/meeting/effectsState.js.map +1 -1
  6. package/dist/meeting/index.js +366 -496
  7. package/dist/meeting/index.js.map +1 -1
  8. package/dist/meeting/util.js +4 -213
  9. package/dist/meeting/util.js.map +1 -1
  10. package/dist/meetings/index.js +0 -28
  11. package/dist/meetings/index.js.map +1 -1
  12. package/dist/statsAnalyzer/index.js +145 -86
  13. package/dist/statsAnalyzer/index.js.map +1 -1
  14. package/package.json +6 -8
  15. package/src/constants.ts +1 -214
  16. package/src/meeting/effectsState.js +1 -2
  17. package/src/meeting/index.js +120 -213
  18. package/src/meeting/util.js +4 -252
  19. package/src/meetings/index.js +0 -22
  20. package/src/statsAnalyzer/index.js +164 -99
  21. package/test/integration/spec/journey.js +2 -67
  22. package/test/unit/spec/meeting/effectsState.js +2 -1
  23. package/test/unit/spec/meeting/index.js +88 -29
  24. package/test/unit/spec/meeting/utils.js +0 -2
  25. package/test/unit/spec/stats-analyzer/index.js +209 -1
  26. package/dist/analyzer/analyzer.js +0 -113
  27. package/dist/analyzer/analyzer.js.map +0 -1
  28. package/dist/analyzer/calculator.js +0 -87
  29. package/dist/analyzer/calculator.js.map +0 -1
  30. package/dist/metrics/mqa-processor.js +0 -170
  31. package/dist/metrics/mqa-processor.js.map +0 -1
  32. package/dist/stats/data.js +0 -93
  33. package/dist/stats/data.js.map +0 -1
  34. package/dist/stats/events.js +0 -222
  35. package/dist/stats/events.js.map +0 -1
  36. package/dist/stats/filter.js +0 -84
  37. package/dist/stats/filter.js.map +0 -1
  38. package/dist/stats/history.js +0 -147
  39. package/dist/stats/history.js.map +0 -1
  40. package/dist/stats/index.js +0 -425
  41. package/dist/stats/index.js.map +0 -1
  42. package/dist/stats/metrics.js +0 -112
  43. package/dist/stats/metrics.js.map +0 -1
  44. package/dist/stats/stats.js +0 -592
  45. package/dist/stats/stats.js.map +0 -1
  46. package/dist/stats/stream.js +0 -156
  47. package/dist/stats/stream.js.map +0 -1
  48. package/dist/stats/transformer.js +0 -126
  49. package/dist/stats/transformer.js.map +0 -1
  50. package/dist/stats/util.js +0 -64
  51. package/dist/stats/util.js.map +0 -1
  52. package/src/analyzer/analyzer.js +0 -78
  53. package/src/analyzer/calculator.js +0 -77
  54. package/src/metrics/mqa-processor.js +0 -118
  55. package/src/stats/data.js +0 -56
  56. package/src/stats/events.js +0 -185
  57. package/src/stats/filter.js +0 -40
  58. package/src/stats/history.js +0 -107
  59. package/src/stats/index.js +0 -320
  60. package/src/stats/metrics.js +0 -95
  61. package/src/stats/stats.js +0 -477
  62. package/src/stats/stream.js +0 -108
  63. package/src/stats/transformer.js +0 -109
  64. package/src/stats/util.js +0 -44
@@ -1,112 +0,0 @@
1
- "use strict";
2
-
3
- var _Object$defineProperty = require("@babel/runtime-corejs2/core-js/object/define-property");
4
-
5
- var _interopRequireDefault = require("@babel/runtime-corejs2/helpers/interopRequireDefault");
6
-
7
- _Object$defineProperty(exports, "__esModule", {
8
- value: true
9
- });
10
-
11
- exports.default = void 0;
12
-
13
- var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/classCallCheck"));
14
-
15
- var _createClass2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/createClass"));
16
-
17
- var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/defineProperty"));
18
-
19
- var _constants = require("../constants");
20
-
21
- /**
22
- * Metrics Payload Event
23
- * Emitted when a Metric Payload is available
24
- * @event metrics:payload
25
- * @instance
26
- * @type {Object}
27
- * @memberof MediaMetrics
28
- */
29
-
30
- /**
31
- * @class MediaMetrics
32
- * @private
33
- */
34
- var MediaMetrics = /*#__PURE__*/function () {
35
- /**
36
- * @param {Object} options
37
- * @param {Object} options.config
38
- * @memberof MediaMetrics
39
- * @constructor
40
- */
41
- function MediaMetrics() {
42
- var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
43
- (0, _classCallCheck2.default)(this, MediaMetrics);
44
- (0, _defineProperty2.default)(this, "namespace", _constants.MEETINGS);
45
- this.config = options.config;
46
- this.stats = null;
47
- }
48
- /**
49
- * @param {MeetingStats} stats
50
- * @returns {undefined}
51
- * @memberof MediaMetrics
52
- */
53
-
54
-
55
- (0, _createClass2.default)(MediaMetrics, [{
56
- key: "setStats",
57
- value: function setStats(stats) {
58
- this.stats = stats;
59
- }
60
- /**
61
- * sets up all the default senders and receivers getStats to collect data
62
- * @returns {Object}
63
- * @public
64
- * @memberof MediaMetrics
65
- */
66
-
67
- }, {
68
- key: "initialize",
69
- value: function initialize() {
70
- var mqa = this.config.metrics.autoSendMQA;
71
- return {
72
- useConfig: true,
73
- senders: [{
74
- id: _constants.STATS.AUDIO_SENDER_ID,
75
- correlate: _constants.STATS.AUDIO_CORRELATE,
76
- mqa: mqa,
77
- onData: function onData() {}
78
- }, {
79
- id: _constants.STATS.VIDEO_SENDER_ID,
80
- correlate: _constants.STATS.VIDEO_CORRELATE,
81
- mqa: mqa,
82
- onData: function onData() {}
83
- }, {
84
- id: _constants.STATS.SHARE_SENDER_ID,
85
- correlate: _constants.STATS.SHARE_CORRELATE,
86
- mqa: mqa,
87
- onData: function onData() {}
88
- }],
89
- receivers: [{
90
- id: _constants.STATS.AUDIO_RECEIVER_ID,
91
- correlate: _constants.STATS.AUDIO_CORRELATE,
92
- mqa: mqa,
93
- onData: function onData() {}
94
- }, {
95
- id: _constants.STATS.VIDEO_RECEIVER_ID,
96
- correlate: _constants.STATS.VIDEO_CORRELATE,
97
- mqa: mqa,
98
- onData: function onData() {}
99
- }, {
100
- id: _constants.STATS.SHARE_RECEIVER_ID,
101
- correlate: _constants.STATS.SHARE_CORRELATE,
102
- mqa: mqa,
103
- onData: function onData() {}
104
- }]
105
- };
106
- }
107
- }]);
108
- return MediaMetrics;
109
- }();
110
-
111
- exports.default = MediaMetrics;
112
- //# sourceMappingURL=metrics.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["MediaMetrics","options","MEETINGS","config","stats","mqa","metrics","autoSendMQA","useConfig","senders","id","STATS","AUDIO_SENDER_ID","correlate","AUDIO_CORRELATE","onData","VIDEO_SENDER_ID","VIDEO_CORRELATE","SHARE_SENDER_ID","SHARE_CORRELATE","receivers","AUDIO_RECEIVER_ID","VIDEO_RECEIVER_ID","SHARE_RECEIVER_ID"],"sources":["metrics.js"],"sourcesContent":["import {\n MEETINGS,\n STATS\n} from '../constants';\n\n/**\n * Metrics Payload Event\n * Emitted when a Metric Payload is available\n * @event metrics:payload\n * @instance\n * @type {Object}\n * @memberof MediaMetrics\n */\n\n/**\n * @class MediaMetrics\n * @private\n */\nexport default class MediaMetrics {\n namespace = MEETINGS;\n\n /**\n * @param {Object} options\n * @param {Object} options.config\n * @memberof MediaMetrics\n * @constructor\n */\n constructor(options = {}) {\n this.config = options.config;\n this.stats = null;\n }\n\n /**\n * @param {MeetingStats} stats\n * @returns {undefined}\n * @memberof MediaMetrics\n */\n setStats(stats) {\n this.stats = stats;\n }\n\n /**\n * sets up all the default senders and receivers getStats to collect data\n * @returns {Object}\n * @public\n * @memberof MediaMetrics\n */\n initialize() {\n const mqa = this.config.metrics.autoSendMQA;\n\n return {\n useConfig: true,\n senders: [\n {\n id: STATS.AUDIO_SENDER_ID,\n correlate: STATS.AUDIO_CORRELATE,\n mqa,\n onData: () => {}\n },\n {\n id: STATS.VIDEO_SENDER_ID,\n correlate: STATS.VIDEO_CORRELATE,\n mqa,\n onData: () => {}\n },\n {\n id: STATS.SHARE_SENDER_ID,\n correlate: STATS.SHARE_CORRELATE,\n mqa,\n onData: () => {}\n }\n ],\n receivers: [\n {\n id: STATS.AUDIO_RECEIVER_ID,\n correlate: STATS.AUDIO_CORRELATE,\n mqa,\n onData: () => {}\n },\n {\n id: STATS.VIDEO_RECEIVER_ID,\n correlate: STATS.VIDEO_CORRELATE,\n mqa,\n onData: () => {}\n },\n {\n id: STATS.SHARE_RECEIVER_ID,\n correlate: STATS.SHARE_CORRELATE,\n mqa,\n onData: () => {}\n }\n ]\n };\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;;AAKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;IACqBA,Y;EAGnB;AACF;AACA;AACA;AACA;AACA;EACE,wBAA0B;IAAA,IAAdC,OAAc,uEAAJ,EAAI;IAAA;IAAA,iDARdC,mBAQc;IACxB,KAAKC,MAAL,GAAcF,OAAO,CAACE,MAAtB;IACA,KAAKC,KAAL,GAAa,IAAb;EACD;EAED;AACF;AACA;AACA;AACA;;;;;WACE,kBAASA,KAAT,EAAgB;MACd,KAAKA,KAAL,GAAaA,KAAb;IACD;IAED;AACF;AACA;AACA;AACA;AACA;;;;WACE,sBAAa;MACX,IAAMC,GAAG,GAAG,KAAKF,MAAL,CAAYG,OAAZ,CAAoBC,WAAhC;MAEA,OAAO;QACLC,SAAS,EAAE,IADN;QAELC,OAAO,EAAE,CACP;UACEC,EAAE,EAAEC,gBAAA,CAAMC,eADZ;UAEEC,SAAS,EAAEF,gBAAA,CAAMG,eAFnB;UAGET,GAAG,EAAHA,GAHF;UAIEU,MAAM,EAAE,kBAAM,CAAE;QAJlB,CADO,EAOP;UACEL,EAAE,EAAEC,gBAAA,CAAMK,eADZ;UAEEH,SAAS,EAAEF,gBAAA,CAAMM,eAFnB;UAGEZ,GAAG,EAAHA,GAHF;UAIEU,MAAM,EAAE,kBAAM,CAAE;QAJlB,CAPO,EAaP;UACEL,EAAE,EAAEC,gBAAA,CAAMO,eADZ;UAEEL,SAAS,EAAEF,gBAAA,CAAMQ,eAFnB;UAGEd,GAAG,EAAHA,GAHF;UAIEU,MAAM,EAAE,kBAAM,CAAE;QAJlB,CAbO,CAFJ;QAsBLK,SAAS,EAAE,CACT;UACEV,EAAE,EAAEC,gBAAA,CAAMU,iBADZ;UAEER,SAAS,EAAEF,gBAAA,CAAMG,eAFnB;UAGET,GAAG,EAAHA,GAHF;UAIEU,MAAM,EAAE,kBAAM,CAAE;QAJlB,CADS,EAOT;UACEL,EAAE,EAAEC,gBAAA,CAAMW,iBADZ;UAEET,SAAS,EAAEF,gBAAA,CAAMM,eAFnB;UAGEZ,GAAG,EAAHA,GAHF;UAIEU,MAAM,EAAE,kBAAM,CAAE;QAJlB,CAPS,EAaT;UACEL,EAAE,EAAEC,gBAAA,CAAMY,iBADZ;UAEEV,SAAS,EAAEF,gBAAA,CAAMQ,eAFnB;UAGEd,GAAG,EAAHA,GAHF;UAIEU,MAAM,EAAE,kBAAM,CAAE;QAJlB,CAbS;MAtBN,CAAP;IA2CD"}
@@ -1,592 +0,0 @@
1
- "use strict";
2
-
3
- var _Reflect$construct = require("@babel/runtime-corejs2/core-js/reflect/construct");
4
-
5
- var _Object$defineProperty = require("@babel/runtime-corejs2/core-js/object/define-property");
6
-
7
- var _interopRequireDefault = require("@babel/runtime-corejs2/helpers/interopRequireDefault");
8
-
9
- _Object$defineProperty(exports, "__esModule", {
10
- value: true
11
- });
12
-
13
- exports.default = void 0;
14
-
15
- var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/classCallCheck"));
16
-
17
- var _createClass2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/createClass"));
18
-
19
- var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/assertThisInitialized"));
20
-
21
- var _inherits2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/inherits"));
22
-
23
- var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/possibleConstructorReturn"));
24
-
25
- var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/getPrototypeOf"));
26
-
27
- var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/defineProperty"));
28
-
29
- var _isFunction2 = _interopRequireDefault(require("lodash/isFunction"));
30
-
31
- var _webexCore = require("@webex/webex-core");
32
-
33
- var _uuid = require("uuid");
34
-
35
- var _constants = require("../constants");
36
-
37
- var _history = _interopRequireDefault(require("../stats/history"));
38
-
39
- var _stream = _interopRequireDefault(require("../stats/stream"));
40
-
41
- var _filter = _interopRequireDefault(require("../stats/filter"));
42
-
43
- var _events = _interopRequireDefault(require("../stats/events"));
44
-
45
- var _stats = _interopRequireDefault(require("../common/errors/stats"));
46
-
47
- function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = _Reflect$construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
48
-
49
- function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !_Reflect$construct) return false; if (_Reflect$construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
50
-
51
- /**
52
- * @class MeetingStats
53
- */
54
- var MeetingStats = /*#__PURE__*/function (_StatelessWebexPlugin) {
55
- (0, _inherits2.default)(MeetingStats, _StatelessWebexPlugin);
56
-
57
- var _super = _createSuper(MeetingStats);
58
-
59
- /**
60
- * @param {Object} attrs
61
- * @param {Object} options
62
- * @param {Object} [optionalCreateOptions]
63
- * @param {Boolean} optionalCreateOptions.history
64
- * @param {Boolean} optionalCreateOptions.mqa
65
- * @param {RTCRtpSender|RTCRtpReceiver} optionalCreateOptions.stream
66
- * @param {RTCRtpSender|RTCRtpReceiver} optionalCreateOptions.filter
67
- * @param {RTCPeerConnection} optionalCreateOptions.media
68
- * @param {String} optionalCreateOptions.id
69
- * @param {Function} optionalCreateOptions.onClose
70
- * @param {Function} optionalCreateOptions.onEvent
71
- * @param {Function} optionalCreateOptions.onData
72
- * if using filter or stream, media must also exist
73
- */
74
- function MeetingStats(attrs, options, optionalCreateOptions) {
75
- var _this;
76
-
77
- (0, _classCallCheck2.default)(this, MeetingStats);
78
- _this = _super.call(this, {}, options);
79
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "namespace", _constants.MEETINGS);
80
- _this.attrs = attrs;
81
- _this.options = options; // what this stats object is configured to work with
82
-
83
- /**
84
- * @instance
85
- * @type {RTCPeerConnection}
86
- * @private
87
- * @memberof MeetingStats
88
- */
89
-
90
- _this.peerConnection = null;
91
- /**
92
- * @instance
93
- * @type {RTCRtpSender|RTCRtpReceiver}
94
- * @private
95
- * @memberof MeetingStats
96
- */
97
-
98
- _this.RTCRtpDirection = null; // usable values
99
-
100
- /**
101
- * @instance
102
- * @type {StatsHistory}
103
- * @readonly
104
- * @private
105
- * @memberof MeetingStats
106
- */
107
-
108
- _this.history = null;
109
- /**
110
- * @instance
111
- * @type {StatsHistory}
112
- * @readonly
113
- * @private
114
- * @memberof MeetingStats
115
- */
116
-
117
- _this.mqa = null;
118
- /**
119
- * @instance
120
- * @type {ReadableStream}
121
- * @readonly
122
- * @private
123
- * @memberof MeetingStats
124
- */
125
-
126
- _this.stream = null;
127
- /**
128
- * @instance
129
- * @type {TransformStream}
130
- * @readonly
131
- * @private
132
- * @memberof MeetingStats
133
- */
134
-
135
- _this.filter = null;
136
- /**
137
- * @instance
138
- * @type {StatsEvents}
139
- * @readonly
140
- * @private
141
- * @memberof MeetingStats
142
- */
143
-
144
- _this.events = null;
145
- /**
146
- * @instance
147
- * @type {String}
148
- * @readonly
149
- * @private
150
- * @memberof MeetingStats
151
- */
152
-
153
- _this.id = null;
154
-
155
- _this.populate(optionalCreateOptions);
156
-
157
- return _this;
158
- }
159
- /**
160
- * @param {Object} [optionalCreateOptions]
161
- * @returns {undefined}
162
- * @private
163
- * @memberof MeetingStats
164
- */
165
-
166
-
167
- (0, _createClass2.default)(MeetingStats, [{
168
- key: "populate",
169
- value: function populate(optionalCreateOptions) {
170
- if (optionalCreateOptions) {
171
- if (optionalCreateOptions.history) {
172
- this.withHistory();
173
- }
174
-
175
- if (optionalCreateOptions.mqa) {
176
- this.withMQA();
177
- }
178
-
179
- if (optionalCreateOptions.filter && !optionalCreateOptions.stream && optionalCreateOptions.media) {
180
- this.withFilter(optionalCreateOptions.filter, optionalCreateOptions.media);
181
- }
182
-
183
- if (optionalCreateOptions.stream && !optionalCreateOptions.filter && optionalCreateOptions.media) {
184
- this.withStream(optionalCreateOptions.stream, optionalCreateOptions.media);
185
- }
186
-
187
- if (optionalCreateOptions.id) {
188
- this.withId(optionalCreateOptions.id);
189
- }
190
-
191
- if (optionalCreateOptions.onClose) {
192
- if (!(0, _isFunction2.default)(optionalCreateOptions.onClose)) {
193
- throw new TypeError('stats->populate#onClose must be a callback function for filtered data.');
194
- }
195
-
196
- this.onClose(optionalCreateOptions.onClose);
197
- }
198
-
199
- if (optionalCreateOptions.onEvent) {
200
- if (!(0, _isFunction2.default)(optionalCreateOptions.onEvent)) {
201
- throw new TypeError('stats->populate#onEvent must be a callback function for filtered data.');
202
- }
203
-
204
- if (this.history) {
205
- this.withEventsHistory(this.history, optionalCreateOptions.onEvent);
206
- } else {
207
- this.withEvents(optionalCreateOptions.onEvent);
208
- }
209
- }
210
-
211
- if (optionalCreateOptions.onData) {
212
- if (!(0, _isFunction2.default)(optionalCreateOptions.onData)) {
213
- throw new TypeError('stats->populate#onData must be a callback function for filtered data.');
214
- }
215
-
216
- this.onData(optionalCreateOptions.onData);
217
- }
218
- }
219
-
220
- return this;
221
- }
222
- /**
223
- * @param {WebRTCData} data
224
- * @returns {undefined}
225
- * @public
226
- * @memberof MeetingStats
227
- */
228
-
229
- }, {
230
- key: "doHistory",
231
- value: function doHistory(data) {
232
- if (this.history) {
233
- this.history.add(data);
234
- }
235
- }
236
- /**
237
- * @param {WebRTCData} data
238
- * @returns {undefined}
239
- * @public
240
- * @memberof MeetingStats
241
- */
242
-
243
- }, {
244
- key: "doMQA",
245
- value: function doMQA(data) {
246
- if (this.mqa && data.data) {
247
- if (!data.data.isEmpty()) {
248
- this.mqa.add(data.data.omit());
249
- }
250
- }
251
- }
252
- /**
253
- * @param {WebRTCData} data
254
- * @returns {undefined}
255
- * @public
256
- * @memberof MeetingStats
257
- */
258
-
259
- }, {
260
- key: "doEvents",
261
- value: function doEvents(data) {
262
- if (this.events) {
263
- this.events.event(data);
264
- }
265
- }
266
- /**
267
- * does all the work for the built properties
268
- * calls back a function with data from piped stream filter
269
- * @param {Function} cbFn
270
- * @returns {undefined}
271
- * @throws {Error} if the filter stream does not exist
272
- * @private
273
- * @memberof MeetingStats
274
- */
275
-
276
- }, {
277
- key: "onData",
278
- value: function onData(cbFn) {
279
- var _this2 = this;
280
-
281
- if (!this.filter) {
282
- throw new TypeError('The stats sender/receiver filter must be set up before data can be processed.');
283
- }
284
-
285
- this.filter.on(_constants.STATS.DATA, function (filtered) {
286
- _this2.doHistory(filtered);
287
-
288
- _this2.doMQA(filtered);
289
-
290
- _this2.doEvents(filtered);
291
-
292
- cbFn(filtered);
293
- });
294
- return this;
295
- }
296
- /**
297
- * triggered if the data stream closes
298
- * calls back a function with error
299
- * @param {Function} cbFn
300
- * @returns {undefined}
301
- * @private
302
- * @memberof MeetingStats
303
- */
304
-
305
- }, {
306
- key: "onClose",
307
- value: function onClose(cbFn) {
308
- var _this3 = this;
309
-
310
- if (!this.filter) {
311
- throw new TypeError('the stats sender/receiver filter must be set up before data can be closed.');
312
- }
313
-
314
- this.stream.on(_constants.STATS.END, function (err) {
315
- if (!err) {
316
- err = new _stats.default("The stats stream for id: ".concat(_this3.id, " ended."));
317
- }
318
-
319
- cbFn(err);
320
- });
321
- return this;
322
- }
323
- /**
324
- * constructs an event object on this instance
325
- * @param {StatsHistory} history
326
- * @param {Function} cb
327
- * @returns {MeetingStats}
328
- * @public
329
- * @memberof MeetingStats
330
- */
331
-
332
- }, {
333
- key: "withEventsHistory",
334
- value: function withEventsHistory(history, cb) {
335
- var events = new _events.default(history, cb);
336
- this.setEvents(events);
337
- return this;
338
- }
339
- /**
340
- * constructs an event object on this instance
341
- * @param {Function} cb
342
- * @returns {MeetingStats}
343
- * @public
344
- * @memberof MeetingStats
345
- */
346
-
347
- }, {
348
- key: "withEvents",
349
- value: function withEvents(cb) {
350
- var events = new _events.default(null, cb);
351
- this.setEvents(events);
352
- return this;
353
- }
354
- /**
355
- * constructs a history object on this instance
356
- * @returns {MeetingStats}
357
- * @public
358
- * @memberof MeetingStats
359
- */
360
-
361
- }, {
362
- key: "withHistory",
363
- value: function withHistory() {
364
- var history = new _history.default(this.config.stats.historyMax);
365
- this.setHistory(history);
366
- return this;
367
- }
368
- /**
369
- * constructs a history object on this instance
370
- * @returns {MeetingStats}
371
- * @public
372
- * @memberof MeetingStats
373
- */
374
-
375
- }, {
376
- key: "withMQA",
377
- value: function withMQA() {
378
- var mqa = new _history.default(_constants.MQA_STATS.MQA_SIZE);
379
- this.setMQA(mqa);
380
- return this;
381
- }
382
- /**
383
- * constructs a readable stream object on this instance
384
- * @param {RTCRtpReceiver|RTCRtpSender} transceiverDirection
385
- * @param {RTCPeerConnection} peerConnection
386
- * @returns {MeetingStats}
387
- * @public
388
- * @memberof MeetingStats
389
- */
390
-
391
- }, {
392
- key: "withStream",
393
- value: function withStream(transceiverDirection, peerConnection) {
394
- var stream = new _stream.default({
395
- rTCRtpDirection: transceiverDirection,
396
- peerConnection: peerConnection,
397
- interval: this.config.stats.interval
398
- });
399
- this.setStream(stream);
400
- return this;
401
- }
402
- /**
403
- * @param {RTCRtpReceiver|RTCRtpSender} transceiverDirection
404
- * @param {RTCPeerConnection} peerConnection
405
- * @returns {MeetingStats}
406
- * @public
407
- * @memberof MeetingStats
408
- */
409
-
410
- }, {
411
- key: "withFilter",
412
- value: function withFilter(transceiverDirection, peerConnection) {
413
- this.withStream(transceiverDirection, peerConnection);
414
- this.setFilter(new _filter.default());
415
- this.getStream().pipe(this.getFilter());
416
- return this;
417
- }
418
- /**
419
- * constructs an id to match this stats object
420
- * takes params as precedence
421
- * @param {String} id
422
- * @returns {MeetingStats}
423
- * @public
424
- * @memberof MeetingStats
425
- */
426
-
427
- }, {
428
- key: "withId",
429
- value: function withId(id) {
430
- if (id) {
431
- this.setId(id);
432
- } else {
433
- this.setId(_uuid.uuid.v4());
434
- }
435
-
436
- return this;
437
- }
438
- /**
439
- * @returns {MeetingStats}
440
- * @public
441
- * @memberof MeetingStats
442
- */
443
-
444
- }, {
445
- key: "build",
446
- value: function build() {
447
- return this;
448
- }
449
- /**
450
- * @param {String} id
451
- * @returns {undefined}
452
- * @public
453
- * @memberof MeetingStats
454
- */
455
-
456
- }, {
457
- key: "setId",
458
- value: function setId(id) {
459
- this.id = id;
460
- }
461
- /**
462
- * @param {StatsHistory} history
463
- * @returns {undefined}
464
- * @public
465
- * @memberof MeetingStats
466
- */
467
-
468
- }, {
469
- key: "setHistory",
470
- value: function setHistory(history) {
471
- this.history = history;
472
- }
473
- /**
474
- * @param {StatsHistory} mqa
475
- * @returns {undefined}
476
- * @public
477
- * @memberof MeetingStats
478
- */
479
-
480
- }, {
481
- key: "setMQA",
482
- value: function setMQA(mqa) {
483
- this.mqa = mqa;
484
- }
485
- /**
486
- * @param {StatsEvent} events
487
- * @returns {undefined}
488
- * @public
489
- * @memberof MeetingStats
490
- */
491
-
492
- }, {
493
- key: "setEvents",
494
- value: function setEvents(events) {
495
- this.events = events;
496
- }
497
- /**
498
- * @param {Readable} stream
499
- * @returns {undefined}
500
- * @public
501
- * @memberof MeetingStats
502
- */
503
-
504
- }, {
505
- key: "setStream",
506
- value: function setStream(stream) {
507
- this.stream = stream;
508
- }
509
- /**
510
- * @param {Transform} filter
511
- * @returns {undefined}
512
- * @public
513
- * @memberof MeetingStats
514
- */
515
-
516
- }, {
517
- key: "setFilter",
518
- value: function setFilter(filter) {
519
- this.filter = filter;
520
- }
521
- /**
522
- * @returns {String}
523
- * @public
524
- * @memberof MeetingStats
525
- */
526
-
527
- }, {
528
- key: "getId",
529
- value: function getId() {
530
- return this.id;
531
- }
532
- /**
533
- * @returns {StatsHistory}
534
- * @public
535
- * @memberof MeetingStats
536
- */
537
-
538
- }, {
539
- key: "getHistory",
540
- value: function getHistory() {
541
- return this.history;
542
- }
543
- /**
544
- * @returns {StatsHistory}
545
- * @public
546
- * @memberof MeetingStats
547
- */
548
-
549
- }, {
550
- key: "getMQA",
551
- value: function getMQA() {
552
- return this.mqa;
553
- }
554
- /**
555
- * @returns {StatsEvents}
556
- * @public
557
- * @memberof MeetingStats
558
- */
559
-
560
- }, {
561
- key: "getEvents",
562
- value: function getEvents() {
563
- return this.events;
564
- }
565
- /**
566
- * @returns {Readable}
567
- * @public
568
- * @memberof MeetingStats
569
- */
570
-
571
- }, {
572
- key: "getStream",
573
- value: function getStream() {
574
- return this.stream;
575
- }
576
- /**
577
- * @returns {Transform}
578
- * @public
579
- * @memberof MeetingStats
580
- */
581
-
582
- }, {
583
- key: "getFilter",
584
- value: function getFilter() {
585
- return this.filter;
586
- }
587
- }]);
588
- return MeetingStats;
589
- }(_webexCore.StatelessWebexPlugin);
590
-
591
- exports.default = MeetingStats;
592
- //# sourceMappingURL=stats.js.map