@webex/plugin-meetings 2.19.1 → 2.19.3

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 (60) 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/index.js +352 -489
  5. package/dist/meeting/index.js.map +1 -1
  6. package/dist/meeting/util.js +4 -213
  7. package/dist/meeting/util.js.map +1 -1
  8. package/dist/meetings/index.js +0 -28
  9. package/dist/meetings/index.js.map +1 -1
  10. package/dist/statsAnalyzer/index.js +145 -86
  11. package/dist/statsAnalyzer/index.js.map +1 -1
  12. package/package.json +5 -7
  13. package/src/constants.ts +1 -214
  14. package/src/meeting/index.js +110 -208
  15. package/src/meeting/util.js +4 -252
  16. package/src/meetings/index.js +0 -22
  17. package/src/statsAnalyzer/index.js +164 -99
  18. package/test/integration/spec/journey.js +2 -67
  19. package/test/unit/spec/meeting/index.js +88 -29
  20. package/test/unit/spec/meeting/utils.js +0 -2
  21. package/test/unit/spec/stats-analyzer/index.js +209 -1
  22. package/dist/analyzer/analyzer.js +0 -113
  23. package/dist/analyzer/analyzer.js.map +0 -1
  24. package/dist/analyzer/calculator.js +0 -87
  25. package/dist/analyzer/calculator.js.map +0 -1
  26. package/dist/metrics/mqa-processor.js +0 -170
  27. package/dist/metrics/mqa-processor.js.map +0 -1
  28. package/dist/stats/data.js +0 -93
  29. package/dist/stats/data.js.map +0 -1
  30. package/dist/stats/events.js +0 -222
  31. package/dist/stats/events.js.map +0 -1
  32. package/dist/stats/filter.js +0 -84
  33. package/dist/stats/filter.js.map +0 -1
  34. package/dist/stats/history.js +0 -147
  35. package/dist/stats/history.js.map +0 -1
  36. package/dist/stats/index.js +0 -425
  37. package/dist/stats/index.js.map +0 -1
  38. package/dist/stats/metrics.js +0 -112
  39. package/dist/stats/metrics.js.map +0 -1
  40. package/dist/stats/stats.js +0 -592
  41. package/dist/stats/stats.js.map +0 -1
  42. package/dist/stats/stream.js +0 -156
  43. package/dist/stats/stream.js.map +0 -1
  44. package/dist/stats/transformer.js +0 -126
  45. package/dist/stats/transformer.js.map +0 -1
  46. package/dist/stats/util.js +0 -64
  47. package/dist/stats/util.js.map +0 -1
  48. package/src/analyzer/analyzer.js +0 -78
  49. package/src/analyzer/calculator.js +0 -77
  50. package/src/metrics/mqa-processor.js +0 -118
  51. package/src/stats/data.js +0 -56
  52. package/src/stats/events.js +0 -185
  53. package/src/stats/filter.js +0 -40
  54. package/src/stats/history.js +0 -107
  55. package/src/stats/index.js +0 -320
  56. package/src/stats/metrics.js +0 -95
  57. package/src/stats/stats.js +0 -477
  58. package/src/stats/stream.js +0 -108
  59. package/src/stats/transformer.js +0 -109
  60. package/src/stats/util.js +0 -44
@@ -10,7 +10,9 @@ _Object$defineProperty(exports, "__esModule", {
10
10
  value: true
11
11
  });
12
12
 
13
- exports.default = void 0;
13
+ exports.StatsAnalyzer = exports.EVENTS = void 0;
14
+
15
+ var _promise = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/promise"));
14
16
 
15
17
  var _stringify = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/json/stringify"));
16
18
 
@@ -46,16 +48,13 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
46
48
 
47
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; } }
48
50
 
49
- /**
50
- * Meeting High Packet Loss Event
51
- * Emitted when ever there is high packet loss detected
52
- * @event meeting:highPacketLoss
53
- * @type {Object}
54
- * @property {String} mediaType Type of media experiencing packet loss
55
- * @property {Number} packetLossRatio current packet loss ratio
56
- * @memberof StatsAnalyzer
57
- */
58
-
51
+ var EVENTS = {
52
+ MEDIA_QUALITY: 'MEDIA_QUALITY',
53
+ LOCAL_MEDIA_STARTED: 'LOCAL_MEDIA_STARTED',
54
+ LOCAL_MEDIA_STOPPED: 'LOCAL_MEDIA_STOPPED',
55
+ REMOTE_MEDIA_STARTED: 'REMOTE_MEDIA_STARTED',
56
+ REMOTE_MEDIA_STOPPED: 'REMOTE_MEDIA_STOPPED'
57
+ };
59
58
  /**
60
59
  * Stats Analyzer class that will emit events based on detected quality
61
60
  *
@@ -63,6 +62,9 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !_R
63
62
  * @class StatsAnalyzer
64
63
  * @extends {EventsScope}
65
64
  */
65
+
66
+ exports.EVENTS = EVENTS;
67
+
66
68
  var StatsAnalyzer = /*#__PURE__*/function (_EventsScope) {
67
69
  (0, _inherits2.default)(StatsAnalyzer, _EventsScope);
68
70
 
@@ -83,6 +85,39 @@ var StatsAnalyzer = /*#__PURE__*/function (_EventsScope) {
83
85
  var statsResults = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : _global.default;
84
86
  (0, _classCallCheck2.default)(this, StatsAnalyzer);
85
87
  _this = _super.call(this);
88
+ (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "emitStartStopEvents", function (mediaType, previousValue, currentValue, isLocal) {
89
+ if (mediaType !== 'audio' && mediaType !== 'video' && mediaType !== 'share') {
90
+ throw new Error("Unsupported mediaType: ".concat(mediaType));
91
+ } // eslint-disable-next-line no-param-reassign
92
+
93
+
94
+ if (previousValue === undefined) previousValue = 0; // eslint-disable-next-line no-param-reassign
95
+
96
+ if (currentValue === undefined) currentValue = 0;
97
+ var lastEmittedEvent = isLocal ? _this.lastEmittedStartStopEvent[mediaType].local : _this.lastEmittedStartStopEvent[mediaType].remote;
98
+ var newEvent;
99
+
100
+ if (currentValue - previousValue > 0) {
101
+ newEvent = isLocal ? EVENTS.LOCAL_MEDIA_STARTED : EVENTS.REMOTE_MEDIA_STARTED;
102
+ } else if (currentValue === previousValue && currentValue > 0) {
103
+ newEvent = isLocal ? EVENTS.LOCAL_MEDIA_STOPPED : EVENTS.REMOTE_MEDIA_STOPPED;
104
+ }
105
+
106
+ if (newEvent && lastEmittedEvent !== newEvent) {
107
+ if (isLocal) {
108
+ _this.lastEmittedStartStopEvent[mediaType].local = newEvent;
109
+ } else {
110
+ _this.lastEmittedStartStopEvent[mediaType].remote = newEvent;
111
+ }
112
+
113
+ _this.emit({
114
+ file: 'statsAnalyzer/index',
115
+ function: 'compareLastStatsResult'
116
+ }, newEvent, {
117
+ type: mediaType
118
+ });
119
+ }
120
+ });
86
121
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "parseCandidate", function (result, type, isSender, isRemote) {
87
122
  if (!result || !result.id) {
88
123
  return;
@@ -220,6 +255,20 @@ var StatsAnalyzer = /*#__PURE__*/function (_EventsScope) {
220
255
  }
221
256
  }
222
257
  };
258
+ _this.lastEmittedStartStopEvent = {
259
+ audio: {
260
+ local: undefined,
261
+ remote: undefined
262
+ },
263
+ video: {
264
+ local: undefined,
265
+ remote: undefined
266
+ },
267
+ share: {
268
+ local: undefined,
269
+ remote: undefined
270
+ }
271
+ };
223
272
  return _this;
224
273
  }
225
274
 
@@ -365,7 +414,7 @@ var StatsAnalyzer = /*#__PURE__*/function (_EventsScope) {
365
414
  this.emit({
366
415
  file: 'statsAnalyzer',
367
416
  function: 'sendMqaData'
368
- }, _constants.EVENT_TRIGGERS.MEDIA_QUALITY, {
417
+ }, EVENTS.MEDIA_QUALITY, {
369
418
  data: _config.default.intervals[0],
370
419
  networkType: _config.default.networkType
371
420
  });
@@ -390,7 +439,7 @@ var StatsAnalyzer = /*#__PURE__*/function (_EventsScope) {
390
439
  * @public
391
440
  * @memberof StatsAnalyzer
392
441
  * @param {PeerConnection} peerConnection
393
- * @returns {void}
442
+ * @returns {Promise}
394
443
  */
395
444
 
396
445
  }, {
@@ -401,16 +450,20 @@ var StatsAnalyzer = /*#__PURE__*/function (_EventsScope) {
401
450
  if (!this.statsStarted) {
402
451
  this.statsStarted = true;
403
452
  this.peerConnection = peerConnection;
404
- this.getStatsAndParse();
405
- this.statsInterval = setInterval(function () {
406
- _this2.getStatsAndParse();
407
- }, this.config.analyzerInterval); // Trigger initial fetch
453
+ return this.getStatsAndParse().then(function () {
454
+ _this2.statsInterval = setInterval(function () {
455
+ _this2.getStatsAndParse();
456
+ }, _this2.config.analyzerInterval); // Trigger initial fetch
408
457
 
409
- this.sendMqaData();
410
- this.mqaInterval = setInterval(function () {
411
458
  _this2.sendMqaData();
412
- }, _constants.MQA_INTEVAL);
459
+
460
+ _this2.mqaInterval = setInterval(function () {
461
+ _this2.sendMqaData();
462
+ }, _constants.MQA_INTEVAL);
463
+ });
413
464
  }
465
+
466
+ return _promise.default.resolve();
414
467
  }
415
468
  /**
416
469
  * Cleans up the analyzer when done
@@ -423,19 +476,30 @@ var StatsAnalyzer = /*#__PURE__*/function (_EventsScope) {
423
476
  }, {
424
477
  key: "stopAnalyzer",
425
478
  value: function stopAnalyzer() {
479
+ var _this3 = this;
480
+
481
+ var sendOneLastMqa = this.mqaInterval && this.statsInterval;
482
+
426
483
  if (this.statsInterval) {
427
- this.getStatsAndParse();
428
484
  clearInterval(this.statsInterval);
429
- this.statsInterva = undefined;
485
+ this.statsInterval = undefined;
430
486
  }
431
487
 
432
488
  if (this.mqaInterval) {
433
- this.sendMqaData();
434
489
  clearInterval(this.mqaInterval);
435
- this.statsInterva = undefined;
490
+ this.mqaInterval = undefined;
491
+ }
492
+
493
+ if (sendOneLastMqa) {
494
+ return this.getStatsAndParse().then(function () {
495
+ _this3.sendMqaData();
496
+
497
+ _this3.peerConnection = null;
498
+ });
436
499
  }
437
500
 
438
501
  this.peerConnection = null;
502
+ return _promise.default.resolve();
439
503
  }
440
504
  /**
441
505
  * Parse a single result of get stats
@@ -502,12 +566,12 @@ var StatsAnalyzer = /*#__PURE__*/function (_EventsScope) {
502
566
  }, {
503
567
  key: "filterAndParseGetStatsResults",
504
568
  value: function filterAndParseGetStatsResults(getStatsResults, type, isSender) {
505
- var _this3 = this;
569
+ var _this4 = this;
506
570
 
507
571
  var types = _constants.DEFAULT_GET_STATS_FILTER.types;
508
572
  getStatsResults.forEach(function (result) {
509
573
  if (types.includes(result.type)) {
510
- _this3.parseGetStatsResult(result, type, isSender);
574
+ _this4.parseGetStatsResult(result, type, isSender);
511
575
  }
512
576
  });
513
577
  }
@@ -531,16 +595,31 @@ var StatsAnalyzer = /*#__PURE__*/function (_EventsScope) {
531
595
  }
532
596
  }
533
597
  /**
534
- * compares current and previous stats to check if packets are not sent
598
+ * emits started/stopped events for local/remote media by checking
599
+ * if given values are increasing or not. The previousValue, currentValue
600
+ * params can be any numerical value like number of receive packets or
601
+ * decoded frames, etc.
535
602
  *
536
603
  * @private
604
+ * @param {string} mediaType
605
+ * @param {number} previousValue - value to compare
606
+ * @param {number} currentValue - value to compare (must be same type of value as previousValue)
607
+ * @param {boolean} isLocal - true if stats are for local media being sent out, false for remote media being received
537
608
  * @memberof StatsAnalyzer
538
609
  * @returns {void}
539
610
  */
540
611
 
541
612
  }, {
542
613
  key: "compareLastStatsResult",
543
- value: function compareLastStatsResult() {
614
+ value:
615
+ /**
616
+ * compares current and previous stats to check if packets are not sent
617
+ *
618
+ * @private
619
+ * @memberof StatsAnalyzer
620
+ * @returns {void}
621
+ */
622
+ function compareLastStatsResult() {
544
623
  if (this.lastStatsResults !== null && this.meetingMediaStatus) {
545
624
  // compare audio stats sent
546
625
  var mediaType = _constants.STATS.AUDIO_CORRELATE;
@@ -563,14 +642,7 @@ var StatsAnalyzer = /*#__PURE__*/function (_EventsScope) {
563
642
  }
564
643
  }
565
644
 
566
- if (previousStats.totalPacketsSent === 0 && currentStats.totalPacketsSent > 0) {
567
- this.emit({
568
- file: 'statsAnalyzer/index',
569
- function: 'compareLastStatsResult'
570
- }, _constants.EVENT_TRIGGERS.MEETING_MEDIA_LOCAL_STARTED, {
571
- type: mediaType.AUDIO
572
- });
573
- }
645
+ this.emitStartStopEvents(mediaType, previousStats.totalPacketsSent, currentStats.totalPacketsSent, true);
574
646
  }
575
647
 
576
648
  if (this.meetingMediaStatus.expected.receiveAudio) {
@@ -583,6 +655,8 @@ var StatsAnalyzer = /*#__PURE__*/function (_EventsScope) {
583
655
  } else if (currentStats.totalSamplesReceived === previousStats.totalSamplesReceived || currentStats.totalSamplesReceived === 0) {
584
656
  _loggerProxy.default.logger.info("StatsAnalyzer:index#compareLastStatsResult --> No ".concat(mediaType, " samples received"));
585
657
  }
658
+
659
+ this.emitStartStopEvents(mediaType, previousStats.totalPacketsReceived, currentStats.totalPacketsReceived, false);
586
660
  }
587
661
 
588
662
  mediaType = _constants.STATS.VIDEO_CORRELATE;
@@ -604,14 +678,7 @@ var StatsAnalyzer = /*#__PURE__*/function (_EventsScope) {
604
678
  }
605
679
  }
606
680
 
607
- if (previousStats.framesSent === 0 && currentStats.framesSent > 0) {
608
- this.emit({
609
- file: 'statsAnalyzer/index',
610
- function: 'compareLastStatsResult'
611
- }, _constants.EVENT_TRIGGERS.MEETING_MEDIA_LOCAL_STARTED, {
612
- type: mediaType.VIDEO
613
- });
614
- }
681
+ this.emitStartStopEvents(mediaType, previousStats.framesSent, currentStats.framesSent, true);
615
682
  }
616
683
 
617
684
  if (this.meetingMediaStatus.expected.receiveVideo) {
@@ -626,7 +693,7 @@ var StatsAnalyzer = /*#__PURE__*/function (_EventsScope) {
626
693
  _loggerProxy.default.logger.info("StatsAnalyzer:index#compareLastStatsResult --> No ".concat(mediaType, " frames received"));
627
694
  }
628
695
 
629
- if (this.statsResults.resolutions[mediaType].recv.framesDecoded === this.lastStatsResults.resolutions[mediaType].recv.framesDecoded || this.statsResults.resolutions[mediaType].send.framesDecoded === 0) {
696
+ if (this.statsResults[mediaType].recv.framesDecoded === this.lastStatsResults[mediaType].recv.framesDecoded || this.statsResults.resolutions[mediaType].send.framesDecoded === 0) {
630
697
  _loggerProxy.default.logger.info("StatsAnalyzer:index#compareLastStatsResult --> No ".concat(mediaType, " frames decoded"));
631
698
  }
632
699
 
@@ -634,6 +701,8 @@ var StatsAnalyzer = /*#__PURE__*/function (_EventsScope) {
634
701
  _loggerProxy.default.logger.info("StatsAnalyzer:index#compareLastStatsResult --> ".concat(mediaType, " frames are getting dropped"));
635
702
  }
636
703
  }
704
+
705
+ this.emitStartStopEvents(mediaType, previousStats.framesDecoded, currentStats.framesDecoded, false);
637
706
  }
638
707
 
639
708
  mediaType = _constants.STATS.SHARE_CORRELATE;
@@ -653,15 +722,6 @@ var StatsAnalyzer = /*#__PURE__*/function (_EventsScope) {
653
722
  if (this.statsResults.resolutions[mediaType].send.framesSent === this.lastStatsResults.resolutions[mediaType].send.framesSent || this.statsResults.resolutions[mediaType].send.framesSent === 0) {
654
723
  _loggerProxy.default.logger.info("StatsAnalyzer:index#compareLastStatsResult --> No ".concat(mediaType, " frames sent"));
655
724
  }
656
- }
657
-
658
- if (previousStats.framesSent === 0 && currentStats.framesSent > 0) {
659
- this.emit({
660
- file: 'statsAnalyzer/index',
661
- function: 'compareLastStatsResult'
662
- }, _constants.EVENT_TRIGGERS.MEETING_MEDIA_LOCAL_STARTED, {
663
- type: mediaType.VIDEO
664
- });
665
725
  } // TODO:need to check receive share value
666
726
  // compare share stats reveived
667
727
 
@@ -676,14 +736,17 @@ var StatsAnalyzer = /*#__PURE__*/function (_EventsScope) {
676
736
  _loggerProxy.default.logger.info("StatsAnalyzer:index#compareLastStatsResult --> No ".concat(mediaType, " frames received"));
677
737
  }
678
738
 
679
- if (this.statsResults.resolutions[mediaType].recv.framesDecoded === this.lastStatsResults.resolutions[mediaType].recv.framesDecoded || this.statsResults.resolutions[mediaType].send.framesDecoded === 0) {
739
+ if (this.statsResults[mediaType].recv.framesDecoded === this.lastStatsResults[mediaType].recv.framesDecoded || this.statsResults.resolutions[mediaType].send.framesDecoded === 0) {
680
740
  _loggerProxy.default.logger.info("StatsAnalyzer:index#compareLastStatsResult --> No ".concat(mediaType, " frames decoded"));
681
741
  }
682
742
 
683
743
  if (this.statsResults.resolutions[mediaType].recv.framesDropped - this.lastStatsResults.resolutions[mediaType].recv.framesDropped > 10) {
684
744
  _loggerProxy.default.logger.info("StatsAnalyzer:index#compareLastStatsResult --> ".concat(mediaType, " frames are getting dropped"));
685
745
  }
686
- }
746
+ } // we are not calling emitStartStopEvents() for sending or receiving share because sharing is often started and stopped
747
+ // in meetings and this.meetingMediaStatus.expected values can be out of sync with the actual packet flow
748
+ // so we would send "sharing stopped" events incorrectly
749
+
687
750
  }
688
751
  }
689
752
  }
@@ -692,56 +755,51 @@ var StatsAnalyzer = /*#__PURE__*/function (_EventsScope) {
692
755
  *
693
756
  * @private
694
757
  * @memberof StatsAnalyzer
695
- * @returns {void}
758
+ * @returns {Promise}
696
759
  */
697
760
 
698
761
  }, {
699
762
  key: "getStatsAndParse",
700
763
  value: function getStatsAndParse() {
701
- var _this4 = this;
764
+ var _this5 = this;
702
765
 
703
766
  if (!this.peerConnection) {
704
- return;
767
+ return _promise.default.resolve();
705
768
  }
706
769
 
707
770
  if (this.peerConnection && this.peerConnection.connectionState === _constants.CONNECTION_STATE.FAILED) {
708
771
  _loggerProxy.default.logger.trace('StatsAnalyzer:index#getStatsAndParse --> PeerConnection is in failed state');
709
772
 
710
- return;
773
+ return _promise.default.resolve();
711
774
  }
712
775
 
713
776
  _loggerProxy.default.logger.trace('StatsAnalyzer:index#getStatsAndParse --> Collecting Stats');
714
777
 
715
- this.peerConnection.videoTransceiver.sender.getStats().then(function (res) {
716
- _this4.filterAndParseGetStatsResults(res, _constants.STATS.VIDEO_CORRELATE, true);
717
- });
718
- this.peerConnection.videoTransceiver.receiver.getStats().then(function (res) {
719
- _this4.filterAndParseGetStatsResults(res, _constants.STATS.VIDEO_CORRELATE, false);
720
- });
721
- this.peerConnection.audioTransceiver.sender.getStats().then(function (res) {
722
- _this4.filterAndParseGetStatsResults(res, _constants.STATS.AUDIO_CORRELATE, true);
723
- });
724
- this.peerConnection.audioTransceiver.receiver.getStats().then(function (res) {
725
- _this4.filterAndParseGetStatsResults(res, _constants.STATS.AUDIO_CORRELATE, false);
726
- }); // TODO: add checks for screen share
727
-
778
+ return _promise.default.all([this.peerConnection.videoTransceiver.sender.getStats().then(function (res) {
779
+ _this5.filterAndParseGetStatsResults(res, _constants.STATS.VIDEO_CORRELATE, true);
780
+ }), this.peerConnection.videoTransceiver.receiver.getStats().then(function (res) {
781
+ _this5.filterAndParseGetStatsResults(res, _constants.STATS.VIDEO_CORRELATE, false);
782
+ }), this.peerConnection.audioTransceiver.sender.getStats().then(function (res) {
783
+ _this5.filterAndParseGetStatsResults(res, _constants.STATS.AUDIO_CORRELATE, true);
784
+ }), this.peerConnection.audioTransceiver.receiver.getStats().then(function (res) {
785
+ _this5.filterAndParseGetStatsResults(res, _constants.STATS.AUDIO_CORRELATE, false);
786
+ }), // TODO: add checks for screen share
728
787
  this.peerConnection.shareTransceiver.sender.getStats().then(function (res) {
729
- _this4.filterAndParseGetStatsResults(res, _constants.STATS.SHARE_CORRELATE, true);
730
- });
731
- this.peerConnection.shareTransceiver.receiver.getStats().then(function (res) {
732
- _this4.filterAndParseGetStatsResults(res, _constants.STATS.SHARE_CORRELATE, false);
733
- }); // updates the current direction of media
788
+ _this5.filterAndParseGetStatsResults(res, _constants.STATS.SHARE_CORRELATE, true);
789
+ }), this.peerConnection.shareTransceiver.receiver.getStats().then(function (res) {
790
+ _this5.filterAndParseGetStatsResults(res, _constants.STATS.SHARE_CORRELATE, false);
791
+ })]).then(function () {
792
+ _this5.statsResults[_constants.STATS.AUDIO_CORRELATE].direction = _this5.peerConnection.audioTransceiver.currentDirection;
793
+ _this5.statsResults[_constants.STATS.VIDEO_CORRELATE].direction = _this5.peerConnection.videoTransceiver.currentDirection;
794
+ _this5.statsResults[_constants.STATS.SHARE_CORRELATE].direction = _this5.peerConnection.shareTransceiver.currentDirection; // Process Stats results every 5 seconds
734
795
 
735
- this.statsResults[_constants.STATS.AUDIO_CORRELATE].direction = this.peerConnection.audioTransceiver.currentDirection;
736
- this.statsResults[_constants.STATS.VIDEO_CORRELATE].direction = this.peerConnection.videoTransceiver.currentDirection;
737
- this.statsResults[_constants.STATS.SHARE_CORRELATE].direction = this.peerConnection.shareTransceiver.currentDirection; // Process Stats results every 5 seconds
796
+ _this5.compareLastStatsResult(); // Save the last results to compare with the current
738
797
 
739
- this.compareLastStatsResult(); // Save the last results to compare with the current
740
- // DO Deep copy, for some reason it takes the reference all the time rather then old value set
741
798
 
742
- this.lastStatsResults = JSON.parse((0, _stringify.default)(this.statsResults));
799
+ _this5.lastStatsResults = JSON.parse((0, _stringify.default)(_this5.statsResults));
743
800
 
744
- _loggerProxy.default.logger.trace('StatsAnalyzer:index#getStatsAndParse --> Finished Collecting Stats');
801
+ _loggerProxy.default.logger.trace('StatsAnalyzer:index#getStatsAndParse --> Finished Collecting Stats');
802
+ });
745
803
  }
746
804
  /**
747
805
  * Processes OutboundRTP stats result and stores
@@ -793,6 +851,7 @@ var StatsAnalyzer = /*#__PURE__*/function (_EventsScope) {
793
851
  this.statsResults[mediaType][sendrecvType].totalPliCount = result.pliCount;
794
852
  this.statsResults[mediaType][sendrecvType].totalPacketsSent = result.packetsSent;
795
853
  this.statsResults[mediaType][sendrecvType].totalFirCount = result.firCount;
854
+ this.statsResults[mediaType][sendrecvType].framesSent = result.framesSent;
796
855
  this.statsResults[mediaType][sendrecvType].framesEncoded = result.framesEncoded;
797
856
  this.statsResults[mediaType][sendrecvType].encoderImplementation = result.encoderImplementation;
798
857
  this.statsResults[mediaType][sendrecvType].qualityLimitationReason = result.qualityLimitationReason;
@@ -999,5 +1058,5 @@ var StatsAnalyzer = /*#__PURE__*/function (_EventsScope) {
999
1058
  return StatsAnalyzer;
1000
1059
  }(_eventsScope.default);
1001
1060
 
1002
- exports.default = StatsAnalyzer;
1061
+ exports.StatsAnalyzer = StatsAnalyzer;
1003
1062
  //# sourceMappingURL=index.js.map