@webex/plugin-meetings 3.0.0-beta.404 → 3.0.0-beta.406

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.
@@ -356,7 +356,7 @@ var StatsAnalyzer = /*#__PURE__*/function (_EventsScope) {
356
356
 
357
357
  // Add stats for individual streams
358
358
  (0, _keys.default)(this.statsResults).forEach(function (mediaType) {
359
- if (mediaType.includes('audio-send')) {
359
+ if (mediaType.startsWith('audio-send')) {
360
360
  var audioSenderStream = (0, _cloneDeep2.default)(_config.emptyAudioTransmitStream);
361
361
  (0, _mqaUtil.getAudioSenderStreamMqa)({
362
362
  audioSenderStream: audioSenderStream,
@@ -366,7 +366,7 @@ var StatsAnalyzer = /*#__PURE__*/function (_EventsScope) {
366
366
  });
367
367
  newMqa.audioTransmit[0].streams.push(audioSenderStream);
368
368
  _this3.lastMqaDataSent[mediaType].send = (0, _cloneDeep2.default)(_this3.statsResults[mediaType].send);
369
- } else if (mediaType.includes('audio-share-send')) {
369
+ } else if (mediaType.startsWith('audio-share-send')) {
370
370
  var _audioSenderStream = (0, _cloneDeep2.default)(_config.emptyAudioTransmitStream);
371
371
  (0, _mqaUtil.getAudioSenderStreamMqa)({
372
372
  audioSenderStream: _audioSenderStream,
@@ -376,7 +376,7 @@ var StatsAnalyzer = /*#__PURE__*/function (_EventsScope) {
376
376
  });
377
377
  newMqa.audioTransmit[1].streams.push(_audioSenderStream);
378
378
  _this3.lastMqaDataSent[mediaType].send = (0, _cloneDeep2.default)(_this3.statsResults[mediaType].send);
379
- } else if (mediaType.includes('audio-recv')) {
379
+ } else if (mediaType.startsWith('audio-recv')) {
380
380
  var audioReceiverStream = (0, _cloneDeep2.default)(_config.emptyAudioReceiveStream);
381
381
  (0, _mqaUtil.getAudioReceiverStreamMqa)({
382
382
  audioReceiverStream: audioReceiverStream,
@@ -386,7 +386,7 @@ var StatsAnalyzer = /*#__PURE__*/function (_EventsScope) {
386
386
  });
387
387
  newMqa.audioReceive[0].streams.push(audioReceiverStream);
388
388
  _this3.lastMqaDataSent[mediaType].recv = (0, _cloneDeep2.default)(_this3.statsResults[mediaType].recv);
389
- } else if (mediaType.includes('audio-share-recv')) {
389
+ } else if (mediaType.startsWith('audio-share-recv')) {
390
390
  var _audioReceiverStream = (0, _cloneDeep2.default)(_config.emptyAudioReceiveStream);
391
391
  (0, _mqaUtil.getAudioReceiverStreamMqa)({
392
392
  audioReceiverStream: _audioReceiverStream,
@@ -396,7 +396,8 @@ var StatsAnalyzer = /*#__PURE__*/function (_EventsScope) {
396
396
  });
397
397
  newMqa.audioReceive[1].streams.push(_audioReceiverStream);
398
398
  _this3.lastMqaDataSent[mediaType].recv = (0, _cloneDeep2.default)(_this3.statsResults[mediaType].recv);
399
- } else if (mediaType.includes('video-send')) {
399
+ } else if (mediaType.startsWith('video-send-layer')) {
400
+ // We only want the stream-specific stats we get with video-send-layer-0, video-send-layer-1, etc.
400
401
  var videoSenderStream = (0, _cloneDeep2.default)(_config.emptyVideoTransmitStream);
401
402
  (0, _mqaUtil.getVideoSenderStreamMqa)({
402
403
  videoSenderStream: videoSenderStream,
@@ -406,7 +407,7 @@ var StatsAnalyzer = /*#__PURE__*/function (_EventsScope) {
406
407
  });
407
408
  newMqa.videoTransmit[0].streams.push(videoSenderStream);
408
409
  _this3.lastMqaDataSent[mediaType].send = (0, _cloneDeep2.default)(_this3.statsResults[mediaType].send);
409
- } else if (mediaType.includes('video-share-send')) {
410
+ } else if (mediaType.startsWith('video-share-send')) {
410
411
  var _videoSenderStream = (0, _cloneDeep2.default)(_config.emptyVideoTransmitStream);
411
412
  (0, _mqaUtil.getVideoSenderStreamMqa)({
412
413
  videoSenderStream: _videoSenderStream,
@@ -416,7 +417,7 @@ var StatsAnalyzer = /*#__PURE__*/function (_EventsScope) {
416
417
  });
417
418
  newMqa.videoTransmit[1].streams.push(_videoSenderStream);
418
419
  _this3.lastMqaDataSent[mediaType].send = (0, _cloneDeep2.default)(_this3.statsResults[mediaType].send);
419
- } else if (mediaType.includes('video-recv')) {
420
+ } else if (mediaType.startsWith('video-recv')) {
420
421
  var videoReceiverStream = (0, _cloneDeep2.default)(_config.emptyVideoReceiveStream);
421
422
  (0, _mqaUtil.getVideoReceiverStreamMqa)({
422
423
  videoReceiverStream: videoReceiverStream,
@@ -426,7 +427,7 @@ var StatsAnalyzer = /*#__PURE__*/function (_EventsScope) {
426
427
  });
427
428
  newMqa.videoReceive[0].streams.push(videoReceiverStream);
428
429
  _this3.lastMqaDataSent[mediaType].recv = (0, _cloneDeep2.default)(_this3.statsResults[mediaType].recv);
429
- } else if (mediaType.includes('video-share-recv')) {
430
+ } else if (mediaType.startsWith('video-share-recv')) {
430
431
  var _videoReceiverStream = (0, _cloneDeep2.default)(_config.emptyVideoReceiveStream);
431
432
  (0, _mqaUtil.getVideoReceiverStreamMqa)({
432
433
  videoReceiverStream: _videoReceiverStream,
@@ -451,9 +452,12 @@ var StatsAnalyzer = /*#__PURE__*/function (_EventsScope) {
451
452
  name: _constants.MEDIA_DEVICES.MICROPHONE
452
453
  });
453
454
  }
454
- if (this.statsResults['video-send']) {
455
+ var existingVideoSender = (0, _keys.default)(this.statsResults).find(function (item) {
456
+ return item.includes('video-send');
457
+ });
458
+ if (existingVideoSender) {
455
459
  newMqa.intervalMetadata.peripherals.push({
456
- information: this.statsResults['video-send'].trackLabel || _constants._UNKNOWN_,
460
+ information: this.statsResults[existingVideoSender].trackLabel || _constants._UNKNOWN_,
457
461
  name: _constants.MEDIA_DEVICES.CAMERA
458
462
  });
459
463
  }
@@ -627,9 +631,20 @@ var StatsAnalyzer = /*#__PURE__*/function (_EventsScope) {
627
631
  _this6.successfulCandidatePair = report;
628
632
  }
629
633
  });
634
+ var videoSenderIndex = 0;
630
635
  statsItem.report.forEach(function (result) {
631
636
  if (types.includes(result.type)) {
632
- _this6.parseGetStatsResult(result, type, isSender);
637
+ // if the video sender has multiple streams in the report, it is a new stream object.
638
+ if (type === 'video-send' && result.type === 'outbound-rtp') {
639
+ var newType = "video-send-layer-".concat(videoSenderIndex);
640
+ _this6.parseGetStatsResult(result, newType, isSender);
641
+ videoSenderIndex += 1;
642
+ _this6.statsResults[newType].direction = statsItem.currentDirection;
643
+ _this6.statsResults[newType].trackLabel = statsItem.localTrackLabel;
644
+ _this6.statsResults[newType].csi = statsItem.csi;
645
+ } else {
646
+ _this6.parseGetStatsResult(result, type, isSender);
647
+ }
633
648
  }
634
649
  });
635
650
  if (this.statsResults[type]) {
@@ -693,7 +708,7 @@ var StatsAnalyzer = /*#__PURE__*/function (_EventsScope) {
693
708
  return key.startsWith(keyPrefix);
694
709
  }).reduce(function (prev, cur) {
695
710
  var _this7$statsResults$c;
696
- return prev + (((_this7$statsResults$c = _this7.statsResults[cur]) === null || _this7$statsResults$c === void 0 ? void 0 : _this7$statsResults$c.recv[value]) || 0);
711
+ return prev + (((_this7$statsResults$c = _this7.statsResults[cur]) === null || _this7$statsResults$c === void 0 ? void 0 : _this7$statsResults$c[keyPrefix.includes('send') ? 'send' : 'recv'][value]) || 0);
697
712
  }, 0);
698
713
  };
699
714
  var getPreviousStatsTotals = function getPreviousStatsTotals(keyPrefix, value) {
@@ -701,7 +716,7 @@ var StatsAnalyzer = /*#__PURE__*/function (_EventsScope) {
701
716
  return key.startsWith(keyPrefix);
702
717
  }).reduce(function (prev, cur) {
703
718
  var _this7$lastStatsResul;
704
- return prev + (((_this7$lastStatsResul = _this7.lastStatsResults[cur]) === null || _this7$lastStatsResul === void 0 ? void 0 : _this7$lastStatsResul.recv[value]) || 0);
719
+ return prev + (((_this7$lastStatsResul = _this7.lastStatsResults[cur]) === null || _this7$lastStatsResul === void 0 ? void 0 : _this7$lastStatsResul[keyPrefix.includes('send') ? 'send' : 'recv'][value]) || 0);
705
720
  }, 0);
706
721
  };
707
722
 
@@ -728,23 +743,31 @@ var StatsAnalyzer = /*#__PURE__*/function (_EventsScope) {
728
743
  var currentAudioPacketsReceived = getCurrentStatsTotals('audio-recv', 'totalPacketsReceived');
729
744
  var previousAudioPacketsReceived = getPreviousStatsTotals('audio-recv', 'totalPacketsReceived');
730
745
  this.emitStartStopEvents('audio', previousAudioPacketsReceived, currentAudioPacketsReceived, false);
746
+ var currentTotalPacketsSent = getCurrentStatsTotals('video-send', 'totalPacketsSent');
747
+ var previousTotalPacketsSent = getPreviousStatsTotals('video-send', 'totalPacketsSent');
748
+ var currentFramesEncoded = getCurrentStatsTotals('video-send', 'framesEncoded');
749
+ var previousFramesEncoded = getPreviousStatsTotals('video-send', 'framesEncoded');
750
+ var currentFramesSent = getCurrentStatsTotals('video-send', 'framesSent');
751
+ var previousFramesSent = getPreviousStatsTotals('video-send', 'framesSent');
752
+ var doesVideoSendExist = (0, _keys.default)(this.lastStatsResults).some(function (item) {
753
+ return item.includes('video-send');
754
+ });
731
755
 
732
756
  // Video Transmit
733
- if (this.lastStatsResults['video-send']) {
757
+ if (doesVideoSendExist) {
734
758
  // compare video stats sent
735
- var _currentStats = this.statsResults['video-send'].send;
736
- var _previousStats = this.lastStatsResults['video-send'].send;
737
- if (this.meetingMediaStatus.expected.sendVideo && (_currentStats.totalPacketsSent === _previousStats.totalPacketsSent || _currentStats.totalPacketsSent === 0)) {
738
- _loggerProxy.default.logger.info("StatsAnalyzer:index#compareLastStatsResult --> No video RTP packets sent", _currentStats.totalPacketsSent);
759
+
760
+ if (this.meetingMediaStatus.expected.sendVideo && (currentTotalPacketsSent === previousTotalPacketsSent || currentTotalPacketsSent === 0)) {
761
+ _loggerProxy.default.logger.info("StatsAnalyzer:index#compareLastStatsResult --> No video RTP packets sent", currentTotalPacketsSent);
739
762
  } else {
740
- if (this.meetingMediaStatus.expected.sendVideo && (_currentStats.framesEncoded === _previousStats.framesEncoded || _currentStats.framesEncoded === 0)) {
741
- _loggerProxy.default.logger.info("StatsAnalyzer:index#compareLastStatsResult --> No video Frames Encoded", _currentStats.framesEncoded);
763
+ if (this.meetingMediaStatus.expected.sendVideo && (currentFramesEncoded === previousFramesEncoded || currentFramesEncoded === 0)) {
764
+ _loggerProxy.default.logger.info("StatsAnalyzer:index#compareLastStatsResult --> No video Frames Encoded", currentFramesEncoded);
742
765
  }
743
- if (this.meetingMediaStatus.expected.sendVideo && (this.statsResults['video-send'].send.framesSent === this.lastStatsResults['video-send'].send.framesSent || this.statsResults['video-send'].send.framesSent === 0)) {
744
- _loggerProxy.default.logger.info("StatsAnalyzer:index#compareLastStatsResult --> No video Frames sent", this.statsResults['video-send'].send.framesSent);
766
+ if (this.meetingMediaStatus.expected.sendVideo && (currentFramesSent === previousFramesSent || currentFramesSent === 0)) {
767
+ _loggerProxy.default.logger.info("StatsAnalyzer:index#compareLastStatsResult --> No video Frames sent", currentFramesSent);
745
768
  }
746
769
  }
747
- this.emitStartStopEvents('video', _previousStats.framesSent, _currentStats.framesSent, true);
770
+ this.emitStartStopEvents('video', previousFramesSent, currentFramesSent, true);
748
771
  }
749
772
 
750
773
  // Video Receive
@@ -756,19 +779,19 @@ var StatsAnalyzer = /*#__PURE__*/function (_EventsScope) {
756
779
  if (this.lastStatsResults['video-share-send']) {
757
780
  // compare share stats sent
758
781
 
759
- var _currentStats2 = this.statsResults['video-share-send'].send;
760
- var _previousStats2 = this.lastStatsResults['video-share-send'].send;
761
- if (this.meetingMediaStatus.expected.sendShare && (_currentStats2.totalPacketsSent === _previousStats2.totalPacketsSent || _currentStats2.totalPacketsSent === 0)) {
762
- _loggerProxy.default.logger.info("StatsAnalyzer:index#compareLastStatsResult --> No share RTP packets sent", _currentStats2.totalPacketsSent);
782
+ var _currentStats = this.statsResults['video-share-send'].send;
783
+ var _previousStats = this.lastStatsResults['video-share-send'].send;
784
+ if (this.meetingMediaStatus.expected.sendShare && (_currentStats.totalPacketsSent === _previousStats.totalPacketsSent || _currentStats.totalPacketsSent === 0)) {
785
+ _loggerProxy.default.logger.info("StatsAnalyzer:index#compareLastStatsResult --> No share RTP packets sent", _currentStats.totalPacketsSent);
763
786
  } else {
764
- if (this.meetingMediaStatus.expected.sendShare && (_currentStats2.framesEncoded === _previousStats2.framesEncoded || _currentStats2.framesEncoded === 0)) {
765
- _loggerProxy.default.logger.info("StatsAnalyzer:index#compareLastStatsResult --> No share frames getting encoded", _currentStats2.framesEncoded);
787
+ if (this.meetingMediaStatus.expected.sendShare && (_currentStats.framesEncoded === _previousStats.framesEncoded || _currentStats.framesEncoded === 0)) {
788
+ _loggerProxy.default.logger.info("StatsAnalyzer:index#compareLastStatsResult --> No share frames getting encoded", _currentStats.framesEncoded);
766
789
  }
767
790
  if (this.meetingMediaStatus.expected.sendShare && (this.statsResults['video-share-send'].send.framesSent === this.lastStatsResults['video-share-send'].send.framesSent || this.statsResults['video-share-send'].send.framesSent === 0)) {
768
791
  _loggerProxy.default.logger.info("StatsAnalyzer:index#compareLastStatsResult --> No share frames sent", this.statsResults['video-share-send'].send.framesSent);
769
792
  }
770
793
  }
771
- this.emitStartStopEvents('share', _previousStats2.framesSent, _currentStats2.framesSent, true);
794
+ this.emitStartStopEvents('share', _previousStats.framesSent, _currentStats.framesSent, true);
772
795
  }
773
796
 
774
797
  // Share receive