@webex/plugin-meetings 3.12.0-next.4 → 3.12.0-next.40

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 (90) hide show
  1. package/AGENTS.md +9 -0
  2. package/dist/aiEnableRequest/index.js +15 -2
  3. package/dist/aiEnableRequest/index.js.map +1 -1
  4. package/dist/breakouts/breakout.js +6 -2
  5. package/dist/breakouts/breakout.js.map +1 -1
  6. package/dist/breakouts/index.js +1 -1
  7. package/dist/constants.js +1 -1
  8. package/dist/constants.js.map +1 -1
  9. package/dist/controls-options-manager/constants.js +11 -1
  10. package/dist/controls-options-manager/constants.js.map +1 -1
  11. package/dist/controls-options-manager/index.js +23 -21
  12. package/dist/controls-options-manager/index.js.map +1 -1
  13. package/dist/controls-options-manager/util.js +91 -0
  14. package/dist/controls-options-manager/util.js.map +1 -1
  15. package/dist/hashTree/constants.js +10 -1
  16. package/dist/hashTree/constants.js.map +1 -1
  17. package/dist/hashTree/hashTreeParser.js +554 -350
  18. package/dist/hashTree/hashTreeParser.js.map +1 -1
  19. package/dist/hashTree/utils.js +22 -0
  20. package/dist/hashTree/utils.js.map +1 -1
  21. package/dist/interceptors/locusRetry.js +23 -8
  22. package/dist/interceptors/locusRetry.js.map +1 -1
  23. package/dist/interpretation/index.js +1 -1
  24. package/dist/interpretation/siLanguage.js +1 -1
  25. package/dist/locus-info/index.js +274 -85
  26. package/dist/locus-info/index.js.map +1 -1
  27. package/dist/locus-info/types.js +16 -0
  28. package/dist/locus-info/types.js.map +1 -1
  29. package/dist/meeting/index.js +710 -499
  30. package/dist/meeting/index.js.map +1 -1
  31. package/dist/meeting/util.js +1 -0
  32. package/dist/meeting/util.js.map +1 -1
  33. package/dist/meetings/index.js +174 -77
  34. package/dist/meetings/index.js.map +1 -1
  35. package/dist/meetings/util.js +49 -5
  36. package/dist/meetings/util.js.map +1 -1
  37. package/dist/member/index.js +10 -0
  38. package/dist/member/index.js.map +1 -1
  39. package/dist/member/types.js.map +1 -1
  40. package/dist/member/util.js +3 -0
  41. package/dist/member/util.js.map +1 -1
  42. package/dist/types/controls-options-manager/constants.d.ts +6 -1
  43. package/dist/types/hashTree/constants.d.ts +1 -0
  44. package/dist/types/hashTree/hashTreeParser.d.ts +53 -15
  45. package/dist/types/hashTree/utils.d.ts +11 -0
  46. package/dist/types/interceptors/locusRetry.d.ts +4 -4
  47. package/dist/types/locus-info/index.d.ts +46 -6
  48. package/dist/types/locus-info/types.d.ts +17 -1
  49. package/dist/types/meeting/index.d.ts +64 -1
  50. package/dist/types/member/index.d.ts +1 -0
  51. package/dist/types/member/types.d.ts +1 -0
  52. package/dist/types/member/util.d.ts +1 -0
  53. package/dist/webinar/index.js +301 -226
  54. package/dist/webinar/index.js.map +1 -1
  55. package/package.json +22 -22
  56. package/src/aiEnableRequest/index.ts +16 -0
  57. package/src/breakouts/breakout.ts +2 -1
  58. package/src/constants.ts +1 -1
  59. package/src/controls-options-manager/constants.ts +14 -1
  60. package/src/controls-options-manager/index.ts +26 -19
  61. package/src/controls-options-manager/util.ts +81 -1
  62. package/src/hashTree/constants.ts +9 -0
  63. package/src/hashTree/hashTreeParser.ts +278 -160
  64. package/src/hashTree/utils.ts +17 -0
  65. package/src/interceptors/locusRetry.ts +25 -4
  66. package/src/locus-info/index.ts +274 -93
  67. package/src/locus-info/types.ts +19 -1
  68. package/src/meeting/index.ts +206 -22
  69. package/src/meeting/util.ts +1 -0
  70. package/src/meetings/index.ts +77 -43
  71. package/src/meetings/util.ts +56 -1
  72. package/src/member/index.ts +10 -0
  73. package/src/member/types.ts +1 -0
  74. package/src/member/util.ts +3 -0
  75. package/src/webinar/index.ts +75 -1
  76. package/test/unit/spec/aiEnableRequest/index.ts +86 -0
  77. package/test/unit/spec/breakouts/breakout.ts +7 -3
  78. package/test/unit/spec/controls-options-manager/index.js +114 -6
  79. package/test/unit/spec/controls-options-manager/util.js +165 -0
  80. package/test/unit/spec/hashTree/hashTreeParser.ts +996 -51
  81. package/test/unit/spec/hashTree/utils.ts +88 -1
  82. package/test/unit/spec/interceptors/locusRetry.ts +205 -4
  83. package/test/unit/spec/locus-info/index.js +397 -81
  84. package/test/unit/spec/meeting/index.js +271 -44
  85. package/test/unit/spec/meeting/utils.js +4 -0
  86. package/test/unit/spec/meetings/index.js +195 -13
  87. package/test/unit/spec/meetings/utils.js +137 -0
  88. package/test/unit/spec/member/index.js +7 -0
  89. package/test/unit/spec/member/util.js +24 -0
  90. package/test/unit/spec/webinar/index.ts +60 -0
@@ -496,6 +496,8 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
496
496
  (0, _defineProperty3.default)(_this, "floorGrantPending", void 0);
497
497
  (0, _defineProperty3.default)(_this, "hasJoinedOnce", void 0);
498
498
  (0, _defineProperty3.default)(_this, "hasWebsocketConnected", void 0);
499
+ (0, _defineProperty3.default)(_this, "mercuryOnlineHandler", void 0);
500
+ (0, _defineProperty3.default)(_this, "mercuryOfflineHandler", void 0);
499
501
  (0, _defineProperty3.default)(_this, "inMeetingActions", void 0);
500
502
  (0, _defineProperty3.default)(_this, "isLocalShareLive", void 0);
501
503
  (0, _defineProperty3.default)(_this, "isRoapInProgress", void 0);
@@ -679,8 +681,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
679
681
  * @returns {null}
680
682
  */
681
683
  (0, _defineProperty3.default)(_this, "handleLLMOnline", function () {
682
- // @ts-ignore
683
- _this.webex.internal.llm.off('online', _this.handleLLMOnline);
684
+ _this.restoreLLMSubscriptionsIfNeeded();
684
685
  _triggerProxy.default.trigger(_this, {
685
686
  file: 'meeting/index',
686
687
  function: 'handleLLMOnline'
@@ -729,11 +730,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
729
730
  // @ts-ignore - Fix type
730
731
  _this.webex.internal.llm.off('online', _this.handleLLMOnline);
731
732
  }
732
- // @ts-ignore - fix types
733
- _this.webex.internal.llm.off('event:relay.event', _this.processRelayEvent);
734
- // @ts-ignore - Fix type
735
- _this.webex.internal.llm.off(_constants.LOCUS_LLM_EVENT, _this.processLocusLLMEvent);
736
- _this.clearLLMHealthCheckTimer();
733
+ _this.stopListeningForLLMEvents();
737
734
  return _context.finish(4);
738
735
  case 5:
739
736
  case "end":
@@ -1550,9 +1547,12 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
1550
1547
  _this.shareStatus = _constants.SHARE_STATUS.NO_SHARE;
1551
1548
  }
1552
1549
  _this.queuedMediaUpdates = [];
1553
- _this.stopTranscription();
1554
- _this.transcription = undefined;
1555
- _this.annotation.deregisterEvents();
1550
+
1551
+ // Listener teardown (transcription, annotation, llm/mercury) runs in
1552
+ // stopListeningForMeetingEvents() before /leave and /end so events
1553
+ // received mid-teardown do not trigger Locus syncs. Calling it here
1554
+ // again would double-emit MEETING_STOPPED_RECEIVING_TRANSCRIPTION
1555
+ // because stopTranscription() always fires its trigger.
1556
1556
  _this.clearDataChannelToken();
1557
1557
  _context5.next = 1;
1558
1558
  return _this.cleanupLLMConneciton({
@@ -1728,7 +1728,9 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
1728
1728
  });
1729
1729
 
1730
1730
  // @ts-ignore
1731
- _this.aiEnableRequest = new _aiEnableRequest.default({}, {
1731
+ _this.aiEnableRequest = new _aiEnableRequest.default({
1732
+ locusUrl: _this.locusUrl
1733
+ }, {
1732
1734
  parent: _this.webex
1733
1735
  });
1734
1736
 
@@ -4087,6 +4089,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
4087
4089
  _this14.breakouts.locusUrlUpdate(url);
4088
4090
  _this14.simultaneousInterpretation.locusUrlUpdate(url);
4089
4091
  _this14.annotation.locusUrlUpdate(url);
4092
+ _this14.aiEnableRequest.locusUrlUpdate(url);
4090
4093
  _this14.locusUrl = url;
4091
4094
  _this14.locusId = (_this14$locusUrl = _this14.locusUrl) === null || _this14$locusUrl === void 0 ? void 0 : _this14$locusUrl.split('/').pop();
4092
4095
  _this14.recordingController.setLocusUrl(_this14.locusUrl);
@@ -4325,44 +4328,34 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
4325
4328
  });
4326
4329
  _this19.updateLLMConnection();
4327
4330
  });
4328
- this.locusInfo.on(_constants.LOCUSINFO.EVENTS.SELF_ADMITTED_GUEST, /*#__PURE__*/function () {
4329
- var _ref37 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee1(payload) {
4330
- var _this19$rtcMetrics;
4331
- return _regenerator.default.wrap(function (_context1) {
4332
- while (1) switch (_context1.prev = _context1.next) {
4333
- case 0:
4334
- _this19.stopKeepAlive();
4335
- if (payload) {
4336
- _triggerProxy.default.trigger(_this19, {
4337
- file: 'meeting/index',
4338
- function: 'setUpLocusInfoSelfListener'
4339
- }, _constants.EVENT_TRIGGERS.MEETING_SELF_GUEST_ADMITTED, {
4340
- payload: payload
4341
- });
4331
+ this.locusInfo.on(_constants.LOCUSINFO.EVENTS.SELF_ADMITTED_GUEST, function (payload) {
4332
+ var _this19$rtcMetrics;
4333
+ _this19.stopKeepAlive();
4334
+ if (payload) {
4335
+ _triggerProxy.default.trigger(_this19, {
4336
+ file: 'meeting/index',
4337
+ function: 'setUpLocusInfoSelfListener'
4338
+ }, _constants.EVENT_TRIGGERS.MEETING_SELF_GUEST_ADMITTED, {
4339
+ payload: payload
4340
+ });
4342
4341
 
4343
- // @ts-ignore
4344
- _this19.webex.internal.newMetrics.submitClientEvent({
4345
- name: 'client.lobby.exited',
4346
- options: {
4347
- meetingId: _this19.id
4348
- }
4349
- });
4350
- _metrics.default.sendBehavioralMetric(_constants2.default.GUEST_EXITED_LOBBY, {
4351
- correlation_id: _this19.correlationId
4352
- });
4353
- }
4354
- (_this19$rtcMetrics = _this19.rtcMetrics) === null || _this19$rtcMetrics === void 0 ? void 0 : _this19$rtcMetrics.sendNextMetrics();
4355
- _this19.updateLLMConnection();
4356
- case 1:
4357
- case "end":
4358
- return _context1.stop();
4342
+ // @ts-ignore
4343
+ _this19.webex.internal.newMetrics.submitClientEvent({
4344
+ name: 'client.lobby.exited',
4345
+ options: {
4346
+ meetingId: _this19.id
4359
4347
  }
4360
- }, _callee1);
4361
- }));
4362
- return function (_x9) {
4363
- return _ref37.apply(this, arguments);
4364
- };
4365
- }());
4348
+ });
4349
+ _metrics.default.sendBehavioralMetric(_constants2.default.GUEST_EXITED_LOBBY, {
4350
+ correlation_id: _this19.correlationId
4351
+ });
4352
+ }
4353
+ (_this19$rtcMetrics = _this19.rtcMetrics) === null || _this19$rtcMetrics === void 0 ? void 0 : _this19$rtcMetrics.sendNextMetrics();
4354
+ _this19.ensureDefaultDatachannelTokenAfterAdmit().catch(function (error) {
4355
+ _loggerProxy.default.logger.warn("Meeting:index#setUpLocusInfoSelfListener --> failed post-admit token prefetch flow: ".concat((error === null || error === void 0 ? void 0 : error.message) || String(error)));
4356
+ });
4357
+ _this19.updateLLMConnection();
4358
+ });
4366
4359
 
4367
4360
  // @ts-ignore - check if MEDIA_INACTIVITY exists
4368
4361
  this.locusInfo.on(_constants.LOCUSINFO.EVENTS.MEDIA_INACTIVITY, function () {
@@ -4482,49 +4475,49 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
4482
4475
  }
4483
4476
  });
4484
4477
  this.locusInfo.on(_constants.EVENTS.DESTROY_MEETING, /*#__PURE__*/function () {
4485
- var _ref38 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee10(payload) {
4478
+ var _ref37 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee1(payload) {
4486
4479
  var _t9;
4487
- return _regenerator.default.wrap(function (_context10) {
4488
- while (1) switch (_context10.prev = _context10.next) {
4480
+ return _regenerator.default.wrap(function (_context1) {
4481
+ while (1) switch (_context1.prev = _context1.next) {
4489
4482
  case 0:
4490
4483
  if (!_this20.wirelessShare) {
4491
- _context10.next = 2;
4484
+ _context1.next = 2;
4492
4485
  break;
4493
4486
  }
4494
4487
  if (!_this20.mediaProperties.shareVideoStream) {
4495
- _context10.next = 1;
4488
+ _context1.next = 1;
4496
4489
  break;
4497
4490
  }
4498
- _context10.next = 1;
4491
+ _context1.next = 1;
4499
4492
  return _this20.setLocalShareVideoStream(undefined);
4500
4493
  case 1:
4501
4494
  if (!_this20.mediaProperties.shareAudioStream) {
4502
- _context10.next = 2;
4495
+ _context1.next = 2;
4503
4496
  break;
4504
4497
  }
4505
- _context10.next = 2;
4498
+ _context1.next = 2;
4506
4499
  return _this20.setLocalShareAudioStream(undefined);
4507
4500
  case 2:
4508
4501
  if (!payload.shouldLeave) {
4509
- _context10.next = 7;
4502
+ _context1.next = 7;
4510
4503
  break;
4511
4504
  }
4512
- _context10.prev = 3;
4513
- _context10.next = 4;
4505
+ _context1.prev = 3;
4506
+ _context1.next = 4;
4514
4507
  return _this20.leave({
4515
4508
  reason: payload.reason
4516
4509
  });
4517
4510
  case 4:
4518
4511
  _loggerProxy.default.logger.warn('Meeting:index#setUpLocusInfoMeetingListener --> DESTROY_MEETING. The meeting has been left, but has not been destroyed, you should see a later event for leave.');
4519
- _context10.next = 6;
4512
+ _context1.next = 6;
4520
4513
  break;
4521
4514
  case 5:
4522
- _context10.prev = 5;
4523
- _t9 = _context10["catch"](3);
4515
+ _context1.prev = 5;
4516
+ _t9 = _context1["catch"](3);
4524
4517
  // @ts-ignore
4525
4518
  _loggerProxy.default.logger.error("Meeting:index#setUpLocusInfoMeetingListener --> DESTROY_MEETING. Issue with leave for meeting, meeting still in collection: ".concat(_this20, ", error: ").concat(_t9));
4526
4519
  case 6:
4527
- _context10.next = 8;
4520
+ _context1.next = 8;
4528
4521
  break;
4529
4522
  case 7:
4530
4523
  _loggerProxy.default.logger.info('Meeting:index#setUpLocusInfoMeetingListener --> MEETING_REMOVED_REASON', payload.reason);
@@ -4538,12 +4531,12 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
4538
4531
  });
4539
4532
  case 8:
4540
4533
  case "end":
4541
- return _context10.stop();
4534
+ return _context1.stop();
4542
4535
  }
4543
- }, _callee10, null, [[3, 5]]);
4536
+ }, _callee1, null, [[3, 5]]);
4544
4537
  }));
4545
- return function (_x0) {
4546
- return _ref38.apply(this, arguments);
4538
+ return function (_x9) {
4539
+ return _ref37.apply(this, arguments);
4547
4540
  };
4548
4541
  }());
4549
4542
  }
@@ -4661,31 +4654,31 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
4661
4654
  }, {
4662
4655
  key: "beRightBack",
4663
4656
  value: (function () {
4664
- var _beRightBack = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee11(enabled) {
4657
+ var _beRightBack = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee10(enabled) {
4665
4658
  var _this22 = this;
4666
4659
  var errorMessage, error, _errorMessage, _error;
4667
- return _regenerator.default.wrap(function (_context11) {
4668
- while (1) switch (_context11.prev = _context11.next) {
4660
+ return _regenerator.default.wrap(function (_context10) {
4661
+ while (1) switch (_context10.prev = _context10.next) {
4669
4662
  case 0:
4670
4663
  if (this.isMultistream) {
4671
- _context11.next = 1;
4664
+ _context10.next = 1;
4672
4665
  break;
4673
4666
  }
4674
4667
  errorMessage = 'Meeting:index#beRightBack --> Not a multistream meeting';
4675
4668
  error = new Error(errorMessage);
4676
4669
  _loggerProxy.default.logger.error(error);
4677
- return _context11.abrupt("return", _promise.default.reject(error));
4670
+ return _context10.abrupt("return", _promise.default.reject(error));
4678
4671
  case 1:
4679
4672
  if (this.mediaProperties.webrtcMediaConnection) {
4680
- _context11.next = 2;
4673
+ _context10.next = 2;
4681
4674
  break;
4682
4675
  }
4683
4676
  _errorMessage = 'Meeting:index#beRightBack --> WebRTC media connection is not defined';
4684
4677
  _error = new Error(_errorMessage);
4685
4678
  _loggerProxy.default.logger.error(_error);
4686
- return _context11.abrupt("return", _promise.default.reject(_error));
4679
+ return _context10.abrupt("return", _promise.default.reject(_error));
4687
4680
  case 2:
4688
- return _context11.abrupt("return", this.brbState.enable(enabled, this.sendSlotManager).then(function () {
4681
+ return _context10.abrupt("return", this.brbState.enable(enabled, this.sendSlotManager).then(function () {
4689
4682
  if (_this22.audio && enabled) {
4690
4683
  // locus mutes the participant with brb enabled request,
4691
4684
  // so we need to explicitly update remote mute for correct logic flow
@@ -4696,11 +4689,11 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
4696
4689
  }));
4697
4690
  case 3:
4698
4691
  case "end":
4699
- return _context11.stop();
4692
+ return _context10.stop();
4700
4693
  }
4701
- }, _callee11, this);
4694
+ }, _callee10, this);
4702
4695
  }));
4703
- function beRightBack(_x1) {
4696
+ function beRightBack(_x0) {
4704
4697
  return _beRightBack.apply(this, arguments);
4705
4698
  }
4706
4699
  return beRightBack;
@@ -5179,6 +5172,51 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
5179
5172
  this.sipUri = sipUri;
5180
5173
  }
5181
5174
 
5175
+ /**
5176
+ * After initial locus setup, refreshes destination with synced locus data and optionally
5177
+ * performs deferred meeting info fetch when initial locus was incomplete.
5178
+ * @param {LocusDTO} locus
5179
+ * @returns {void}
5180
+ */
5181
+ }, {
5182
+ key: "finalizeMeetingAfterInitialLocusSetup",
5183
+ value: (function () {
5184
+ var _finalizeMeetingAfterInitialLocusSetup = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee11(locus) {
5185
+ var _this$destination;
5186
+ var _t0;
5187
+ return _regenerator.default.wrap(function (_context11) {
5188
+ while (1) switch (_context11.prev = _context11.next) {
5189
+ case 0:
5190
+ if (locus && (this === null || this === void 0 ? void 0 : this.destinationType) === _constants.DESTINATION_TYPE.LOCUS_ID) {
5191
+ // destination is initialized from the initial locus snapshot in constructor,
5192
+ // so refresh it after locus sync to avoid stale partial hash-tree data.
5193
+ this.destination = locus;
5194
+ }
5195
+ if (!((!this.meetingInfo || (0, _lodash.isEmpty)(this.meetingInfo)) && (_this$destination = this.destination) !== null && _this$destination !== void 0 && _this$destination.info && !this.fetchMeetingInfoTimeoutId)) {
5196
+ _context11.next = 4;
5197
+ break;
5198
+ }
5199
+ _context11.prev = 1;
5200
+ _context11.next = 2;
5201
+ return this.fetchMeetingInfo({});
5202
+ case 2:
5203
+ _context11.next = 4;
5204
+ break;
5205
+ case 3:
5206
+ _context11.prev = 3;
5207
+ _t0 = _context11["catch"](1);
5208
+ _loggerProxy.default.logger.info("Meeting:index#finalizeMeetingAfterInitialLocusSetup --> deferred fetchMeetingInfo failed: ".concat(_t0.message));
5209
+ case 4:
5210
+ case "end":
5211
+ return _context11.stop();
5212
+ }
5213
+ }, _callee11, this, [[1, 3]]);
5214
+ }));
5215
+ function finalizeMeetingAfterInitialLocusSetup(_x1) {
5216
+ return _finalizeMeetingAfterInitialLocusSetup.apply(this, arguments);
5217
+ }
5218
+ return finalizeMeetingAfterInitialLocusSetup;
5219
+ }()
5182
5220
  /**
5183
5221
  * Set the locus info the class instance. Should be called with the parsed locus
5184
5222
  * we got in the join response.
@@ -5194,6 +5232,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
5194
5232
  * @private
5195
5233
  * @memberof Meeting
5196
5234
  */
5235
+ )
5197
5236
  }, {
5198
5237
  key: "setLocus",
5199
5238
  value: function setLocus(data) {
@@ -5653,8 +5692,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
5653
5692
  var _this25 = this;
5654
5693
  // Client will have a socket manager and handle reconnecting to mercury, when we reconnect to mercury
5655
5694
  // if the meeting has active peer connections, it should try to reconnect.
5656
- // @ts-ignore
5657
- this.webex.internal.mercury.on(_constants.ONLINE, function () {
5695
+ this.mercuryOnlineHandler = function () {
5658
5696
  _loggerProxy.default.logger.info('Meeting:index#setMercuryListener --> Web socket online');
5659
5697
 
5660
5698
  // Only send restore event when it was disconnected before and for connected later
@@ -5664,15 +5702,48 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
5664
5702
  });
5665
5703
  }
5666
5704
  _this25.hasWebsocketConnected = true;
5667
- });
5668
-
5669
- // @ts-ignore
5670
- this.webex.internal.mercury.on(_constants.OFFLINE, function () {
5705
+ };
5706
+ this.mercuryOfflineHandler = function () {
5671
5707
  _loggerProxy.default.logger.error('Meeting:index#setMercuryListener --> Web socket offline');
5672
5708
  _metrics.default.sendBehavioralMetric(_constants2.default.MERCURY_CONNECTION_FAILURE, {
5673
5709
  correlation_id: _this25.correlationId
5674
5710
  });
5675
- });
5711
+ };
5712
+
5713
+ // @ts-ignore
5714
+ this.webex.internal.mercury.on(_constants.ONLINE, this.mercuryOnlineHandler);
5715
+ // @ts-ignore
5716
+ this.webex.internal.mercury.on(_constants.OFFLINE, this.mercuryOfflineHandler);
5717
+ }
5718
+
5719
+ /**
5720
+ * Removes this meeting's Mercury ONLINE/OFFLINE event listeners registered
5721
+ * by setMercuryListener(). Must be called before Locus /leave to avoid
5722
+ * unnecessary syncs/metrics triggered by events received while leaving
5723
+ * (per Locus team recommendation).
5724
+ *
5725
+ * Mercury is a process-wide singleton shared with other plugins, so we
5726
+ * pass the bound handler refs to .off() to avoid clearing every listener
5727
+ * for ONLINE/OFFLINE on the shared emitter.
5728
+ *
5729
+ * Idempotent: subsequent calls are no-ops because the handler refs are
5730
+ * cleared after detaching.
5731
+ * @private
5732
+ * @returns {void}
5733
+ */
5734
+ }, {
5735
+ key: "stopListeningForMercuryEvents",
5736
+ value: function stopListeningForMercuryEvents() {
5737
+ if (this.mercuryOnlineHandler) {
5738
+ // @ts-ignore
5739
+ this.webex.internal.mercury.off(_constants.ONLINE, this.mercuryOnlineHandler);
5740
+ this.mercuryOnlineHandler = undefined;
5741
+ }
5742
+ if (this.mercuryOfflineHandler) {
5743
+ // @ts-ignore
5744
+ this.webex.internal.mercury.off(_constants.OFFLINE, this.mercuryOfflineHandler);
5745
+ this.mercuryOfflineHandler = undefined;
5746
+ }
5676
5747
  }
5677
5748
 
5678
5749
  /**
@@ -6007,8 +6078,8 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
6007
6078
  _error2,
6008
6079
  _error3,
6009
6080
  _args16 = arguments,
6010
- _t0,
6011
- _t1;
6081
+ _t1,
6082
+ _t10;
6012
6083
  return _regenerator.default.wrap(function (_context16) {
6013
6084
  while (1) switch (_context16.prev = _context16.next) {
6014
6085
  case 0:
@@ -6097,26 +6168,26 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
6097
6168
  });
6098
6169
  case 10:
6099
6170
  _context16.prev = 10;
6100
- _t0 = _context16["catch"](2);
6101
- _loggerProxy.default.logger.error('Meeting:index#joinWithMedia --> ', _t0);
6171
+ _t1 = _context16["catch"](2);
6172
+ _loggerProxy.default.logger.error('Meeting:index#joinWithMedia --> ', _t1);
6102
6173
  this.roap.abortTurnDiscovery();
6103
6174
 
6104
6175
  // if this was the first attempt, let's do a retry
6105
6176
  shouldRetry = !isRetry;
6106
- if (_internalPluginMetrics.CallDiagnosticUtils.isSdpOfferCreationError(_t0) || _internalPluginMetrics.CallDiagnosticUtils.isWebrtcApiNotAvailableError(_t0)) {
6177
+ if (_internalPluginMetrics.CallDiagnosticUtils.isSdpOfferCreationError(_t1) || _internalPluginMetrics.CallDiagnosticUtils.isWebrtcApiNotAvailableError(_t1)) {
6107
6178
  // errors related to offer creation (for example missing H264 codec) will happen again no matter how many times we try,
6108
6179
  // so there is no point doing a retry
6109
6180
  shouldRetry = false;
6110
6181
  }
6111
- if (_internalPluginMetrics.CallDiagnosticUtils.isBrowserMediaError(_t0)) {
6182
+ if (_internalPluginMetrics.CallDiagnosticUtils.isBrowserMediaError(_t1)) {
6112
6183
  shouldRetry = false;
6113
6184
  // eslint-disable-next-line no-ex-assign
6114
- _t0 = (0, _lodash.merge)({
6185
+ _t1 = (0, _lodash.merge)({
6115
6186
  error: {
6116
6187
  body: {
6117
- errorCode: _internalPluginMetrics.CallDiagnosticUtils.getBrowserMediaErrorCode(_t0),
6118
- message: (_error2 = _t0) === null || _error2 === void 0 ? void 0 : _error2.message,
6119
- name: (_error3 = _t0) === null || _error3 === void 0 ? void 0 : _error3.name
6188
+ errorCode: _internalPluginMetrics.CallDiagnosticUtils.getBrowserMediaErrorCode(_t1),
6189
+ message: (_error2 = _t1) === null || _error2 === void 0 ? void 0 : _error2.message,
6190
+ name: (_error3 = _t1) === null || _error3 === void 0 ? void 0 : _error3.name
6120
6191
  }
6121
6192
  }
6122
6193
  });
@@ -6138,20 +6209,20 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
6138
6209
  break;
6139
6210
  case 13:
6140
6211
  _context16.prev = 13;
6141
- _t1 = _context16["catch"](11);
6142
- _loggerProxy.default.logger.error('Meeting:index#joinWithMedia --> leave error', _t1);
6143
- leaveError = _t1;
6212
+ _t10 = _context16["catch"](11);
6213
+ _loggerProxy.default.logger.error('Meeting:index#joinWithMedia --> leave error', _t10);
6214
+ leaveError = _t10;
6144
6215
  case 14:
6145
6216
  _metrics.default.sendBehavioralMetric(_constants2.default.JOIN_WITH_MEDIA_FAILURE, {
6146
6217
  correlation_id: this.correlationId,
6147
6218
  locus_id: (_this$locusUrl = this.locusUrl) === null || _this$locusUrl === void 0 ? void 0 : _this$locusUrl.split('/').pop(),
6148
6219
  // if join fails, we may end up with no locusUrl
6149
- reason: _t0.message,
6150
- stack: _t0.stack,
6220
+ reason: _t1.message,
6221
+ stack: _t1.stack,
6151
6222
  leaveErrorReason: (_leaveError = leaveError) === null || _leaveError === void 0 ? void 0 : _leaveError.message,
6152
6223
  isRetry: isRetry
6153
6224
  }, {
6154
- type: _t0.name
6225
+ type: _t1.name
6155
6226
  });
6156
6227
  if (!shouldRetry) {
6157
6228
  _context16.next = 15;
@@ -6166,7 +6237,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
6166
6237
  isRetry: false,
6167
6238
  prevJoinResponse: undefined
6168
6239
  };
6169
- throw _t0;
6240
+ throw _t1;
6170
6241
  case 16:
6171
6242
  case "end":
6172
6243
  return _context16.stop();
@@ -6356,7 +6427,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
6356
6427
  key: "startTranscription",
6357
6428
  value: (function () {
6358
6429
  var _startTranscription = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee18(options) {
6359
- var _t10;
6430
+ var _t11;
6360
6431
  return _regenerator.default.wrap(function (_context18) {
6361
6432
  while (1) switch (_context18.prev = _context18.next) {
6362
6433
  case 0:
@@ -6378,12 +6449,12 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
6378
6449
  break;
6379
6450
  case 3:
6380
6451
  _context18.prev = 3;
6381
- _t10 = _context18["catch"](1);
6382
- _loggerProxy.default.logger.error("Meeting:index#startTranscription --> ".concat(_t10));
6452
+ _t11 = _context18["catch"](1);
6453
+ _loggerProxy.default.logger.error("Meeting:index#startTranscription --> ".concat(_t11));
6383
6454
  _metrics.default.sendBehavioralMetric(_constants2.default.RECEIVE_TRANSCRIPTION_FAILURE, {
6384
6455
  correlation_id: this.correlationId,
6385
- reason: _t10.message,
6386
- stack: _t10.stack
6456
+ reason: _t11.message,
6457
+ stack: _t11.stack
6387
6458
  });
6388
6459
  case 4:
6389
6460
  _context18.next = 6;
@@ -6443,6 +6514,31 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
6443
6514
  function: 'triggerStopReceivingTranscriptionEvent'
6444
6515
  }, _constants.EVENT_TRIGGERS.MEETING_STOPPED_RECEIVING_TRANSCRIPTION);
6445
6516
  }
6517
+
6518
+ /**
6519
+ * Restores LLM subchannel subscriptions after reconnect when captions are active.
6520
+ * @returns {void}
6521
+ */
6522
+ }, {
6523
+ key: "restoreLLMSubscriptionsIfNeeded",
6524
+ value: function restoreLLMSubscriptionsIfNeeded() {
6525
+ try {
6526
+ var _this$webex$internal$, _this$webex$internal$2;
6527
+ // @ts-ignore
6528
+ var isCaptionBoxOn = (_this$webex$internal$ = this.webex.internal.voicea) === null || _this$webex$internal$ === void 0 ? void 0 : (_this$webex$internal$2 = _this$webex$internal$.getIsCaptionBoxOn) === null || _this$webex$internal$2 === void 0 ? void 0 : _this$webex$internal$2.call(_this$webex$internal$);
6529
+ if (!isCaptionBoxOn) {
6530
+ return;
6531
+ }
6532
+
6533
+ // @ts-ignore
6534
+ this.webex.internal.voicea.updateSubchannelSubscriptions({
6535
+ subscribe: ['transcription']
6536
+ });
6537
+ } catch (error) {
6538
+ var msg = (error === null || error === void 0 ? void 0 : error.message) || String(error);
6539
+ _loggerProxy.default.logger.warn("Meeting:index#restoreLLMSubscriptionsIfNeeded --> failed to restore subscriptions after LLM online: ".concat(msg));
6540
+ }
6541
+ }
6446
6542
  }, {
6447
6543
  key: "join",
6448
6544
  value: (
@@ -6471,7 +6567,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
6471
6567
  _errorMessage3,
6472
6568
  _error5,
6473
6569
  _args19 = arguments,
6474
- _t11;
6570
+ _t12;
6475
6571
  return _regenerator.default.wrap(function (_context19) {
6476
6572
  while (1) switch (_context19.prev = _context19.next) {
6477
6573
  case 0:
@@ -6589,25 +6685,25 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
6589
6685
  break;
6590
6686
  case 9:
6591
6687
  _context19.prev = 9;
6592
- _t11 = _context19["catch"](7);
6593
- _loggerProxy.default.logger.error('Meeting:index#join --> Failed to refresh permission token:', _t11);
6594
- if (!(_t11 instanceof _captchaError.default || _t11 instanceof _passwordError.default || _t11 instanceof _permission.default)) {
6688
+ _t12 = _context19["catch"](7);
6689
+ _loggerProxy.default.logger.error('Meeting:index#join --> Failed to refresh permission token:', _t12);
6690
+ if (!(_t12 instanceof _captchaError.default || _t12 instanceof _passwordError.default || _t12 instanceof _permission.default)) {
6595
6691
  _context19.next = 10;
6596
6692
  break;
6597
6693
  }
6598
- this.meetingFiniteStateMachine.fail(_t11);
6694
+ this.meetingFiniteStateMachine.fail(_t12);
6599
6695
 
6600
6696
  // Upload logs on refreshpermissionToken refresh Failure
6601
6697
  _triggerProxy.default.trigger(this, {
6602
6698
  file: 'meeting/index',
6603
6699
  function: 'join'
6604
6700
  }, _constants.EVENTS.REQUEST_UPLOAD_LOGS, this);
6605
- joinFailed(_t11);
6701
+ joinFailed(_t12);
6606
6702
  this.deferJoin = undefined;
6607
6703
 
6608
6704
  // if refresh permission token requires captcha, password or permission, we are throwing the errors
6609
6705
  // and bubble it up to client
6610
- return _context19.abrupt("return", _promise.default.reject(_t11));
6706
+ return _context19.abrupt("return", _promise.default.reject(_t12));
6611
6707
  case 10:
6612
6708
  return _context19.abrupt("return", _util2.default.joinMeetingOptions(this, options).then(function (join) {
6613
6709
  _this34.meetingFiniteStateMachine.join();
@@ -6646,6 +6742,8 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
6646
6742
  _this34.saveDataChannelToken(join);
6647
6743
  // @ts-ignore - config coming from registerPlugin
6648
6744
  if (_this34.config.enableAutomaticLLM) {
6745
+ // @ts-ignore
6746
+ _this34.webex.internal.llm.off('online', _this34.handleLLMOnline);
6649
6747
  // @ts-ignore
6650
6748
  _this34.webex.internal.llm.on('online', _this34.handleLLMOnline);
6651
6749
  _this34.updateLLMConnection().catch(function (error) {
@@ -6714,6 +6812,53 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
6714
6812
  this.llmHealthCheckTimer = undefined;
6715
6813
  }
6716
6814
  }
6815
+
6816
+ /**
6817
+ * Removes LLM event listeners and clears the health check timer.
6818
+ * Must be called before Locus /leave to avoid unnecessary syncs triggered
6819
+ * by events received while leaving (per Locus team recommendation).
6820
+ * Idempotent: safe to call multiple times; .off() is a no-op when no
6821
+ * matching listener is registered.
6822
+ * @private
6823
+ * @returns {void}
6824
+ */
6825
+ }, {
6826
+ key: "stopListeningForLLMEvents",
6827
+ value: function stopListeningForLLMEvents() {
6828
+ // @ts-ignore - fix types
6829
+ this.webex.internal.llm.off('event:relay.event', this.processRelayEvent);
6830
+ // @ts-ignore - fix types
6831
+ this.webex.internal.llm.off(_constants.LOCUS_LLM_EVENT, this.processLocusLLMEvent);
6832
+ this.clearLLMHealthCheckTimer();
6833
+ }
6834
+
6835
+ /**
6836
+ * Stops listening on every event bus (LLM, Mercury, voicea/transcription,
6837
+ * annotation) that could otherwise deliver events to this meeting while
6838
+ * Locus is processing /leave or /end. Per the Locus team recommendation,
6839
+ * this must run before the Locus request is dispatched to avoid
6840
+ * unnecessary syncs triggered by in-flight events.
6841
+ *
6842
+ * Voicea (transcription) subscribes to llm 'event:relay.event' internally,
6843
+ * and the annotation plugin subscribes to both mercury and llm, so both
6844
+ * must be torn down alongside the direct LLM/Mercury listeners.
6845
+ *
6846
+ * Idempotent: safe to call multiple times; .off() is a no-op when no
6847
+ * matching listener is registered, and stopTranscription is guarded.
6848
+ * @private
6849
+ * @returns {void}
6850
+ */
6851
+ }, {
6852
+ key: "stopListeningForMeetingEvents",
6853
+ value: function stopListeningForMeetingEvents() {
6854
+ this.stopListeningForLLMEvents();
6855
+ this.stopListeningForMercuryEvents();
6856
+ if (this.transcription) {
6857
+ this.stopTranscription();
6858
+ this.transcription = undefined;
6859
+ }
6860
+ this.annotation.deregisterEvents();
6861
+ }
6717
6862
  }, {
6718
6863
  key: "clearDataChannelToken",
6719
6864
  value:
@@ -6749,27 +6894,91 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
6749
6894
  }
6750
6895
  }
6751
6896
 
6897
+ /**
6898
+ * Ensures default-session data channel token exists after lobby admission.
6899
+ * Some lobby users do not receive a token until they are admitted.
6900
+ * @returns {Promise<boolean>} true when a new token is fetched and cached
6901
+ */
6902
+ }, {
6903
+ key: "ensureDefaultDatachannelTokenAfterAdmit",
6904
+ value: (function () {
6905
+ var _ensureDefaultDatachannelTokenAfterAdmit = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee20() {
6906
+ var _response$body, datachannelToken, isDataChannelTokenEnabled, response, fetchedDatachannelToken, msg, _t13;
6907
+ return _regenerator.default.wrap(function (_context20) {
6908
+ while (1) switch (_context20.prev = _context20.next) {
6909
+ case 0:
6910
+ _context20.prev = 0;
6911
+ // @ts-ignore
6912
+ datachannelToken = this.webex.internal.llm.getDatachannelToken(); // @ts-ignore
6913
+ _context20.next = 1;
6914
+ return this.webex.internal.llm.isDataChannelTokenEnabled();
6915
+ case 1:
6916
+ isDataChannelTokenEnabled = _context20.sent;
6917
+ if (!(!isDataChannelTokenEnabled || datachannelToken)) {
6918
+ _context20.next = 2;
6919
+ break;
6920
+ }
6921
+ return _context20.abrupt("return", false);
6922
+ case 2:
6923
+ _context20.next = 3;
6924
+ return this.meetingRequest.fetchDatachannelToken({
6925
+ locusUrl: this.locusUrl,
6926
+ requestingParticipantId: this.members.selfId,
6927
+ isPracticeSession: false
6928
+ });
6929
+ case 3:
6930
+ response = _context20.sent;
6931
+ fetchedDatachannelToken = response === null || response === void 0 ? void 0 : (_response$body = response.body) === null || _response$body === void 0 ? void 0 : _response$body.datachannelToken;
6932
+ if (fetchedDatachannelToken) {
6933
+ _context20.next = 4;
6934
+ break;
6935
+ }
6936
+ return _context20.abrupt("return", false);
6937
+ case 4:
6938
+ // @ts-ignore
6939
+ this.webex.internal.llm.setDatachannelToken(fetchedDatachannelToken, _internalPluginLlm.DataChannelTokenType.Default);
6940
+ return _context20.abrupt("return", true);
6941
+ case 5:
6942
+ _context20.prev = 5;
6943
+ _t13 = _context20["catch"](0);
6944
+ msg = (_t13 === null || _t13 === void 0 ? void 0 : _t13.message) || String(_t13);
6945
+ _loggerProxy.default.logger.warn("Meeting:index#ensureDefaultDatachannelTokenAfterAdmit --> failed to proactively fetch default data channel token after admit: ".concat(msg), {
6946
+ statusCode: _t13 === null || _t13 === void 0 ? void 0 : _t13.statusCode
6947
+ });
6948
+ return _context20.abrupt("return", false);
6949
+ case 6:
6950
+ case "end":
6951
+ return _context20.stop();
6952
+ }
6953
+ }, _callee20, this, [[0, 5]]);
6954
+ }));
6955
+ function ensureDefaultDatachannelTokenAfterAdmit() {
6956
+ return _ensureDefaultDatachannelTokenAfterAdmit.apply(this, arguments);
6957
+ }
6958
+ return ensureDefaultDatachannelTokenAfterAdmit;
6959
+ }()
6752
6960
  /**
6753
6961
  * Connects to low latency mercury and reconnects if the address has changed
6754
6962
  * It will also disconnect if called when the meeting has ended
6755
6963
  * @returns {Promise}
6756
6964
  */
6965
+ )
6757
6966
  }, {
6758
6967
  key: "updateLLMConnection",
6759
6968
  value: (function () {
6760
- var _updateLLMConnection = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee20() {
6969
+ var _updateLLMConnection = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee21() {
6761
6970
  var _this36 = this;
6762
- var _ref40, _ref40$url, url, _ref40$info, _ref40$info2, _ref40$info2$datachan, datachannelUrl, isJoined, datachannelToken, dataChannelUrl;
6763
- return _regenerator.default.wrap(function (_context20) {
6764
- while (1) switch (_context20.prev = _context20.next) {
6971
+ var _ref39, _ref39$url, url, _ref39$info, _ref39$info2, _ref39$info2$datachan, datachannelUrl, isJoined, datachannelToken, dataChannelUrl;
6972
+ return _regenerator.default.wrap(function (_context21) {
6973
+ while (1) switch (_context21.prev = _context21.next) {
6765
6974
  case 0:
6766
6975
  // @ts-ignore - Fix type
6767
- _ref40 = this.locusInfo || {}, _ref40$url = _ref40.url, url = _ref40$url === void 0 ? undefined : _ref40$url, _ref40$info = _ref40.info, _ref40$info2 = _ref40$info === void 0 ? {} : _ref40$info, _ref40$info2$datachan = _ref40$info2.datachannelUrl, datachannelUrl = _ref40$info2$datachan === void 0 ? undefined : _ref40$info2$datachan;
6976
+ _ref39 = this.locusInfo || {}, _ref39$url = _ref39.url, url = _ref39$url === void 0 ? undefined : _ref39$url, _ref39$info = _ref39.info, _ref39$info2 = _ref39$info === void 0 ? {} : _ref39$info, _ref39$info2$datachan = _ref39$info2.datachannelUrl, datachannelUrl = _ref39$info2$datachan === void 0 ? undefined : _ref39$info2$datachan;
6768
6977
  isJoined = this.isJoined(); // @ts-ignore
6769
6978
  datachannelToken = this.webex.internal.llm.getDatachannelToken(_internalPluginLlm.DataChannelTokenType.Default);
6770
6979
  dataChannelUrl = datachannelUrl; // @ts-ignore - Fix type
6771
6980
  if (!this.webex.internal.llm.isConnected()) {
6772
- _context20.next = 2;
6981
+ _context21.next = 2;
6773
6982
  break;
6774
6983
  }
6775
6984
  if (!(
@@ -6777,23 +6986,23 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
6777
6986
  url === this.webex.internal.llm.getLocusUrl() &&
6778
6987
  // @ts-ignore - Fix type
6779
6988
  dataChannelUrl === this.webex.internal.llm.getDatachannelUrl() && isJoined)) {
6780
- _context20.next = 1;
6989
+ _context21.next = 1;
6781
6990
  break;
6782
6991
  }
6783
- return _context20.abrupt("return", undefined);
6992
+ return _context21.abrupt("return", undefined);
6784
6993
  case 1:
6785
- _context20.next = 2;
6994
+ _context21.next = 2;
6786
6995
  return this.cleanupLLMConneciton({
6787
6996
  removeOnlineListener: false
6788
6997
  });
6789
6998
  case 2:
6790
6999
  if (isJoined) {
6791
- _context20.next = 3;
7000
+ _context21.next = 3;
6792
7001
  break;
6793
7002
  }
6794
- return _context20.abrupt("return", undefined);
7003
+ return _context21.abrupt("return", undefined);
6795
7004
  case 3:
6796
- return _context20.abrupt("return", this.webex.internal.llm.registerAndConnect(url, dataChannelUrl, datachannelToken).then(function (registerAndConnectResult) {
7005
+ return _context21.abrupt("return", this.webex.internal.llm.registerAndConnect(url, dataChannelUrl, datachannelToken).then(function (registerAndConnectResult) {
6797
7006
  // @ts-ignore - Fix type
6798
7007
  _this36.webex.internal.llm.off('event:relay.event', _this36.processRelayEvent);
6799
7008
  // @ts-ignore - Fix type
@@ -6808,9 +7017,9 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
6808
7017
  }));
6809
7018
  case 4:
6810
7019
  case "end":
6811
- return _context20.stop();
7020
+ return _context21.stop();
6812
7021
  }
6813
- }, _callee20, this);
7022
+ }, _callee21, this);
6814
7023
  }));
6815
7024
  function updateLLMConnection() {
6816
7025
  return _updateLLMConnection.apply(this, arguments);
@@ -6996,17 +7205,17 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
6996
7205
  meetingId: this.id
6997
7206
  }
6998
7207
  });
6999
- this.locusInfo.once(_constants.LOCUSINFO.EVENTS.SELF_OBSERVING, /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee21() {
7000
- var mediaSettings, _t12;
7001
- return _regenerator.default.wrap(function (_context21) {
7002
- while (1) switch (_context21.prev = _context21.next) {
7208
+ this.locusInfo.once(_constants.LOCUSINFO.EVENTS.SELF_OBSERVING, /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee22() {
7209
+ var mediaSettings, _t14;
7210
+ return _regenerator.default.wrap(function (_context22) {
7211
+ while (1) switch (_context22.prev = _context22.next) {
7003
7212
  case 0:
7004
- _context21.prev = 0;
7213
+ _context22.prev = 0;
7005
7214
  if (!(_this40.screenShareFloorState === ScreenShareFloorStatus.GRANTED)) {
7006
- _context21.next = 1;
7215
+ _context22.next = 1;
7007
7216
  break;
7008
7217
  }
7009
- _context21.next = 1;
7218
+ _context22.next = 1;
7010
7219
  return _this40.releaseScreenShareFloor();
7011
7220
  case 1:
7012
7221
  mediaSettings = {
@@ -7025,23 +7234,23 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7025
7234
  // when a move to is intiated by the client , Locus delets the existing media node from the server as soon the device answers the meeting
7026
7235
  // once the device answers we close the old connection and create new media server connection with only share enabled
7027
7236
  if (!_this40.statsAnalyzer) {
7028
- _context21.next = 2;
7237
+ _context22.next = 2;
7029
7238
  break;
7030
7239
  }
7031
- _context21.next = 2;
7240
+ _context22.next = 2;
7032
7241
  return _this40.statsAnalyzer.stopAnalyzer();
7033
7242
  case 2:
7034
- _context21.next = 3;
7243
+ _context22.next = 3;
7035
7244
  return _this40.closeRemoteStreams();
7036
7245
  case 3:
7037
- _context21.next = 4;
7246
+ _context22.next = 4;
7038
7247
  return _this40.closePeerConnections();
7039
7248
  case 4:
7040
7249
  _this40.cleanupLocalStreams();
7041
7250
  _this40.unsetRemoteStreams();
7042
7251
  _this40.unsetPeerConnections();
7043
7252
  _this40.reconnectionManager.cleanUp();
7044
- _context21.next = 5;
7253
+ _context22.next = 5;
7045
7254
  return _this40.addMedia({
7046
7255
  audioEnabled: false,
7047
7256
  videoEnabled: false,
@@ -7050,24 +7259,24 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7050
7259
  case 5:
7051
7260
  _metrics.default.sendBehavioralMetric(_constants2.default.MOVE_TO_SUCCESS);
7052
7261
  _this40.isMoveToInProgress = false;
7053
- _context21.next = 7;
7262
+ _context22.next = 7;
7054
7263
  break;
7055
7264
  case 6:
7056
- _context21.prev = 6;
7057
- _t12 = _context21["catch"](0);
7058
- _loggerProxy.default.logger.error('Meeting:index#moveTo --> Failed to moveTo resourceId', _t12);
7265
+ _context22.prev = 6;
7266
+ _t14 = _context22["catch"](0);
7267
+ _loggerProxy.default.logger.error('Meeting:index#moveTo --> Failed to moveTo resourceId', _t14);
7059
7268
  _metrics.default.sendBehavioralMetric(_constants2.default.MOVE_TO_FAILURE, {
7060
7269
  correlation_id: _this40.correlationId,
7061
7270
  locus_id: _this40.locusUrl.split('/').pop(),
7062
- reason: _t12.message,
7063
- stack: _t12.stack
7271
+ reason: _t14.message,
7272
+ stack: _t14.stack
7064
7273
  });
7065
7274
  _this40.isMoveToInProgress = false;
7066
7275
  case 7:
7067
7276
  case "end":
7068
- return _context21.stop();
7277
+ return _context22.stop();
7069
7278
  }
7070
- }, _callee21, null, [[0, 6]]);
7279
+ }, _callee22, null, [[0, 6]]);
7071
7280
  })));
7072
7281
  _loggerProxy.default.logger.info('Meeting:index#moveTo --> Initated moved to using resourceId', resourceId);
7073
7282
 
@@ -7155,10 +7364,10 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7155
7364
  }, {
7156
7365
  key: "createMediaConnection",
7157
7366
  value: (function () {
7158
- var _createMediaConnection = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee22(turnServerInfo, bundlePolicy) {
7367
+ var _createMediaConnection = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee23(turnServerInfo, bundlePolicy) {
7159
7368
  var mc, audioEnabled, videoEnabled, shareEnabled;
7160
- return _regenerator.default.wrap(function (_context22) {
7161
- while (1) switch (_context22.prev = _context22.next) {
7369
+ return _regenerator.default.wrap(function (_context23) {
7370
+ while (1) switch (_context23.prev = _context23.next) {
7162
7371
  case 0:
7163
7372
  this.rtcMetrics = this.isMultistream ?
7164
7373
  // @ts-ignore
@@ -7200,40 +7409,40 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7200
7409
 
7201
7410
  // publish the streams
7202
7411
  if (!this.mediaProperties.audioStream) {
7203
- _context22.next = 1;
7412
+ _context23.next = 1;
7204
7413
  break;
7205
7414
  }
7206
7415
  this.setSendNamedMediaGroup(_internalMediaCore.MediaType.AudioMain);
7207
- _context22.next = 1;
7416
+ _context23.next = 1;
7208
7417
  return this.publishStream(_internalMediaCore.MediaType.AudioMain, this.mediaProperties.audioStream);
7209
7418
  case 1:
7210
7419
  if (!this.mediaProperties.videoStream) {
7211
- _context22.next = 2;
7420
+ _context23.next = 2;
7212
7421
  break;
7213
7422
  }
7214
- _context22.next = 2;
7423
+ _context23.next = 2;
7215
7424
  return this.publishStream(_internalMediaCore.MediaType.VideoMain, this.mediaProperties.videoStream);
7216
7425
  case 2:
7217
7426
  if (!this.mediaProperties.shareVideoStream) {
7218
- _context22.next = 3;
7427
+ _context23.next = 3;
7219
7428
  break;
7220
7429
  }
7221
- _context22.next = 3;
7430
+ _context23.next = 3;
7222
7431
  return this.publishStream(_internalMediaCore.MediaType.VideoSlides, this.mediaProperties.shareVideoStream);
7223
7432
  case 3:
7224
7433
  if (!(this.isMultistream && this.mediaProperties.shareAudioStream)) {
7225
- _context22.next = 4;
7434
+ _context23.next = 4;
7226
7435
  break;
7227
7436
  }
7228
- _context22.next = 4;
7437
+ _context23.next = 4;
7229
7438
  return this.publishStream(_internalMediaCore.MediaType.AudioSlides, this.mediaProperties.shareAudioStream);
7230
7439
  case 4:
7231
- return _context22.abrupt("return", mc);
7440
+ return _context23.abrupt("return", mc);
7232
7441
  case 5:
7233
7442
  case "end":
7234
- return _context22.stop();
7443
+ return _context23.stop();
7235
7444
  }
7236
- }, _callee22, this);
7445
+ }, _callee23, this);
7237
7446
  }));
7238
7447
  function createMediaConnection(_x15, _x16) {
7239
7448
  return _createMediaConnection.apply(this, arguments);
@@ -7273,11 +7482,11 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7273
7482
  }, {
7274
7483
  key: "setUpLocalStreamReferences",
7275
7484
  value: (function () {
7276
- var _setUpLocalStreamReferences = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee23(localStreams) {
7485
+ var _setUpLocalStreamReferences = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee24(localStreams) {
7277
7486
  var _localStreams$microph, _localStreams$camera, _localStreams$screenS, _localStreams$screenS2, _localStreams$screenS3, _localStreams$screenS4, _localStreams$screenS5, _localStreams$screenS6;
7278
- var setUpStreamPromises, _t13;
7279
- return _regenerator.default.wrap(function (_context23) {
7280
- while (1) switch (_context23.prev = _context23.next) {
7487
+ var setUpStreamPromises, _t15;
7488
+ return _regenerator.default.wrap(function (_context24) {
7489
+ while (1) switch (_context24.prev = _context24.next) {
7281
7490
  case 0:
7282
7491
  setUpStreamPromises = [];
7283
7492
  if (localStreams !== null && localStreams !== void 0 && localStreams.microphone && (localStreams === null || localStreams === void 0 ? void 0 : (_localStreams$microph = localStreams.microphone) === null || _localStreams$microph === void 0 ? void 0 : _localStreams$microph.readyState) !== 'ended') {
@@ -7292,22 +7501,22 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7292
7501
  if (localStreams !== null && localStreams !== void 0 && (_localStreams$screenS4 = localStreams.screenShare) !== null && _localStreams$screenS4 !== void 0 && _localStreams$screenS4.audio && (localStreams === null || localStreams === void 0 ? void 0 : (_localStreams$screenS5 = localStreams.screenShare) === null || _localStreams$screenS5 === void 0 ? void 0 : (_localStreams$screenS6 = _localStreams$screenS5.audio) === null || _localStreams$screenS6 === void 0 ? void 0 : _localStreams$screenS6.readyState) !== 'ended') {
7293
7502
  setUpStreamPromises.push(this.setLocalShareAudioStream(localStreams.screenShare.audio));
7294
7503
  }
7295
- _context23.prev = 1;
7296
- _context23.next = 2;
7504
+ _context24.prev = 1;
7505
+ _context24.next = 2;
7297
7506
  return _promise.default.all(setUpStreamPromises);
7298
7507
  case 2:
7299
- _context23.next = 4;
7508
+ _context24.next = 4;
7300
7509
  break;
7301
7510
  case 3:
7302
- _context23.prev = 3;
7303
- _t13 = _context23["catch"](1);
7304
- _loggerProxy.default.logger.error("Meeting:index#addMedia():setUpLocalStreamReferences --> Error , ", _t13);
7305
- throw _t13;
7511
+ _context24.prev = 3;
7512
+ _t15 = _context24["catch"](1);
7513
+ _loggerProxy.default.logger.error("Meeting:index#addMedia():setUpLocalStreamReferences --> Error , ", _t15);
7514
+ throw _t15;
7306
7515
  case 4:
7307
7516
  case "end":
7308
- return _context23.stop();
7517
+ return _context24.stop();
7309
7518
  }
7310
- }, _callee23, this, [[1, 3]]);
7519
+ }, _callee24, this, [[1, 3]]);
7311
7520
  }));
7312
7521
  function setUpLocalStreamReferences(_x17) {
7313
7522
  return _setUpLocalStreamReferences.apply(this, arguments);
@@ -7324,72 +7533,72 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7324
7533
  }, {
7325
7534
  key: "waitForMediaConnectionConnected",
7326
7535
  value: (function () {
7327
- var _waitForMediaConnectionConnected = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee24() {
7328
- var iceConnected, _this$mediaProperties9, _this$mediaProperties0, _this$mediaProperties1, _this$mediaProperties10, _this$mediaProperties11, _this$mediaProperties12, _this$mediaProperties13, timedOutError, _t14, _t15, _t16, _t17, _t18, _t19, _t20, _t21, _t22, _t23, _t24, _t25, _t26, _t27, _t28;
7329
- return _regenerator.default.wrap(function (_context24) {
7330
- while (1) switch (_context24.prev = _context24.next) {
7536
+ var _waitForMediaConnectionConnected = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee25() {
7537
+ var iceConnected, _this$mediaProperties9, _this$mediaProperties0, _this$mediaProperties1, _this$mediaProperties10, _this$mediaProperties11, _this$mediaProperties12, _this$mediaProperties13, timedOutError, _t16, _t17, _t18, _t19, _t20, _t21, _t22, _t23, _t24, _t25, _t26, _t27, _t28, _t29, _t30;
7538
+ return _regenerator.default.wrap(function (_context25) {
7539
+ while (1) switch (_context25.prev = _context25.next) {
7331
7540
  case 0:
7332
- _context24.prev = 0;
7333
- _context24.next = 1;
7541
+ _context25.prev = 0;
7542
+ _context25.next = 1;
7334
7543
  return this.mediaProperties.waitForMediaConnectionConnected(this.correlationId);
7335
7544
  case 1:
7336
- _context24.next = 5;
7545
+ _context25.next = 5;
7337
7546
  break;
7338
7547
  case 2:
7339
- _context24.prev = 2;
7340
- _t14 = _context24["catch"](0);
7341
- iceConnected = _t14.iceConnected;
7548
+ _context25.prev = 2;
7549
+ _t16 = _context25["catch"](0);
7550
+ iceConnected = _t16.iceConnected;
7342
7551
  if (this.hasMediaConnectionConnectedAtLeastOnce) {
7343
- _context24.next = 4;
7552
+ _context25.next = 4;
7344
7553
  break;
7345
7554
  }
7346
- _t15 = this.webex.internal.newMetrics;
7347
- _t16 = !this.turnServerUsed;
7348
- _t17 = this.addMediaData.icePhaseCallback();
7349
- _t18 = this.webex.internal.newMetrics.callDiagnosticMetrics;
7350
- _t19 = _internalPluginMetrics.CallDiagnosticUtils;
7351
- _t20 = ((_this$mediaProperties9 = this.mediaProperties.webrtcMediaConnection) === null || _this$mediaProperties9 === void 0 ? void 0 : (_this$mediaProperties0 = _this$mediaProperties9.multistreamConnection) === null || _this$mediaProperties0 === void 0 ? void 0 : (_this$mediaProperties1 = _this$mediaProperties0.pc) === null || _this$mediaProperties1 === void 0 ? void 0 : (_this$mediaProperties10 = _this$mediaProperties1.pc) === null || _this$mediaProperties10 === void 0 ? void 0 : _this$mediaProperties10.signalingState) || ((_this$mediaProperties11 = this.mediaProperties.webrtcMediaConnection) === null || _this$mediaProperties11 === void 0 ? void 0 : (_this$mediaProperties12 = _this$mediaProperties11.mediaConnection) === null || _this$mediaProperties12 === void 0 ? void 0 : (_this$mediaProperties13 = _this$mediaProperties12.pc) === null || _this$mediaProperties13 === void 0 ? void 0 : _this$mediaProperties13.signalingState) || 'unknown';
7352
- _t21 = iceConnected;
7353
- _t22 = this.turnServerUsed;
7354
- _context24.next = 3;
7555
+ _t17 = this.webex.internal.newMetrics;
7556
+ _t18 = !this.turnServerUsed;
7557
+ _t19 = this.addMediaData.icePhaseCallback();
7558
+ _t20 = this.webex.internal.newMetrics.callDiagnosticMetrics;
7559
+ _t21 = _internalPluginMetrics.CallDiagnosticUtils;
7560
+ _t22 = ((_this$mediaProperties9 = this.mediaProperties.webrtcMediaConnection) === null || _this$mediaProperties9 === void 0 ? void 0 : (_this$mediaProperties0 = _this$mediaProperties9.multistreamConnection) === null || _this$mediaProperties0 === void 0 ? void 0 : (_this$mediaProperties1 = _this$mediaProperties0.pc) === null || _this$mediaProperties1 === void 0 ? void 0 : (_this$mediaProperties10 = _this$mediaProperties1.pc) === null || _this$mediaProperties10 === void 0 ? void 0 : _this$mediaProperties10.signalingState) || ((_this$mediaProperties11 = this.mediaProperties.webrtcMediaConnection) === null || _this$mediaProperties11 === void 0 ? void 0 : (_this$mediaProperties12 = _this$mediaProperties11.mediaConnection) === null || _this$mediaProperties12 === void 0 ? void 0 : (_this$mediaProperties13 = _this$mediaProperties12.pc) === null || _this$mediaProperties13 === void 0 ? void 0 : _this$mediaProperties13.signalingState) || 'unknown';
7561
+ _t23 = iceConnected;
7562
+ _t24 = this.turnServerUsed;
7563
+ _context25.next = 3;
7355
7564
  return this.webex.meetings.reachability.isWebexMediaBackendUnreachable().catch(function () {
7356
7565
  return false;
7357
7566
  });
7358
7567
  case 3:
7359
- _t23 = _context24.sent;
7360
- _t24 = _t19.generateClientErrorCodeForIceFailure.call(_t19, {
7361
- signalingState: _t20,
7362
- iceConnected: _t21,
7363
- turnServerUsed: _t22,
7364
- unreachable: _t23
7568
+ _t25 = _context25.sent;
7569
+ _t26 = _t21.generateClientErrorCodeForIceFailure.call(_t21, {
7570
+ signalingState: _t22,
7571
+ iceConnected: _t23,
7572
+ turnServerUsed: _t24,
7573
+ unreachable: _t25
7365
7574
  });
7366
- _t25 = _t18.getErrorPayloadForClientErrorCode.call(_t18, {
7367
- clientErrorCode: _t24
7575
+ _t27 = _t20.getErrorPayloadForClientErrorCode.call(_t20, {
7576
+ clientErrorCode: _t26
7368
7577
  });
7369
- _t26 = [_t25];
7370
- _t27 = {
7371
- canProceed: _t16,
7372
- icePhase: _t17,
7373
- errors: _t26
7578
+ _t28 = [_t27];
7579
+ _t29 = {
7580
+ canProceed: _t18,
7581
+ icePhase: _t19,
7582
+ errors: _t28
7374
7583
  };
7375
- _t28 = {
7584
+ _t30 = {
7376
7585
  meetingId: this.id,
7377
- rawError: _t14
7586
+ rawError: _t16
7378
7587
  };
7379
- _t15.submitClientEvent.call(_t15, {
7588
+ _t17.submitClientEvent.call(_t17, {
7380
7589
  name: 'client.ice.end',
7381
- payload: _t27,
7382
- options: _t28
7590
+ payload: _t29,
7591
+ options: _t30
7383
7592
  });
7384
7593
  case 4:
7385
7594
  timedOutError = new Error("Timed out waiting for media connection to be connected, correlationId=".concat(this.correlationId));
7386
- timedOutError.cause = _t14;
7595
+ timedOutError.cause = _t16;
7387
7596
  throw timedOutError;
7388
7597
  case 5:
7389
7598
  case "end":
7390
- return _context24.stop();
7599
+ return _context25.stop();
7391
7600
  }
7392
- }, _callee24, this, [[0, 2]]);
7601
+ }, _callee25, this, [[0, 2]]);
7393
7602
  }));
7394
7603
  function waitForMediaConnectionConnected() {
7395
7604
  return _waitForMediaConnectionConnected.apply(this, arguments);
@@ -7456,19 +7665,19 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7456
7665
  }, {
7457
7666
  key: "waitForRemoteSDPAnswer",
7458
7667
  value: (function () {
7459
- var _waitForRemoteSDPAnswer = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee25() {
7668
+ var _waitForRemoteSDPAnswer = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee26() {
7460
7669
  var _this44 = this;
7461
7670
  var LOG_HEADER, deferSDPAnswer;
7462
- return _regenerator.default.wrap(function (_context25) {
7463
- while (1) switch (_context25.prev = _context25.next) {
7671
+ return _regenerator.default.wrap(function (_context26) {
7672
+ while (1) switch (_context26.prev = _context26.next) {
7464
7673
  case 0:
7465
7674
  LOG_HEADER = 'Meeting:index#addMedia():waitForRemoteSDPAnswer -->';
7466
7675
  if (this.deferSDPAnswer) {
7467
- _context25.next = 1;
7676
+ _context26.next = 1;
7468
7677
  break;
7469
7678
  }
7470
7679
  _loggerProxy.default.logger.warn("".concat(LOG_HEADER, " offer not created yet"));
7471
- return _context25.abrupt("return", _promise.default.reject(new Error('waitForRemoteSDPAnswer() called before local sdp offer created')));
7680
+ return _context26.abrupt("return", _promise.default.reject(new Error('waitForRemoteSDPAnswer() called before local sdp offer created')));
7472
7681
  case 1:
7473
7682
  deferSDPAnswer = this.deferSDPAnswer;
7474
7683
  this.sdpResponseTimer = setTimeout(function () {
@@ -7494,12 +7703,12 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7494
7703
  deferSDPAnswer.reject(error);
7495
7704
  }, _constants.ROAP_OFFER_ANSWER_EXCHANGE_TIMEOUT);
7496
7705
  _loggerProxy.default.logger.info("".concat(LOG_HEADER, " waiting for REMOTE SDP ANSWER..."));
7497
- return _context25.abrupt("return", deferSDPAnswer.promise);
7706
+ return _context26.abrupt("return", deferSDPAnswer.promise);
7498
7707
  case 2:
7499
7708
  case "end":
7500
- return _context25.stop();
7709
+ return _context26.stop();
7501
7710
  }
7502
- }, _callee25, this);
7711
+ }, _callee26, this);
7503
7712
  }));
7504
7713
  function waitForRemoteSDPAnswer() {
7505
7714
  return _waitForRemoteSDPAnswer.apply(this, arguments);
@@ -7518,28 +7727,28 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7518
7727
  }, {
7519
7728
  key: "retryEstablishMediaConnectionWithForcedTurnDiscovery",
7520
7729
  value: (function () {
7521
- var _retryEstablishMediaConnectionWithForcedTurnDiscovery = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee26(remoteMediaManagerConfig, bundlePolicy) {
7522
- var LOG_HEADER, _t29;
7523
- return _regenerator.default.wrap(function (_context26) {
7524
- while (1) switch (_context26.prev = _context26.next) {
7730
+ var _retryEstablishMediaConnectionWithForcedTurnDiscovery = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee27(remoteMediaManagerConfig, bundlePolicy) {
7731
+ var LOG_HEADER, _t31;
7732
+ return _regenerator.default.wrap(function (_context27) {
7733
+ while (1) switch (_context27.prev = _context27.next) {
7525
7734
  case 0:
7526
7735
  LOG_HEADER = 'Meeting:index#addMedia():retryEstablishMediaConnectionWithForcedTurnDiscovery -->';
7527
- _context26.prev = 1;
7528
- _context26.next = 2;
7736
+ _context27.prev = 1;
7737
+ _context27.next = 2;
7529
7738
  return this.establishMediaConnection(remoteMediaManagerConfig, bundlePolicy, true);
7530
7739
  case 2:
7531
- _context26.next = 4;
7740
+ _context27.next = 4;
7532
7741
  break;
7533
7742
  case 3:
7534
- _context26.prev = 3;
7535
- _t29 = _context26["catch"](1);
7536
- _loggerProxy.default.logger.error("".concat(LOG_HEADER, " retry with TURN-TLS failed, media connection unable to connect, "), _t29);
7537
- throw _t29;
7743
+ _context27.prev = 3;
7744
+ _t31 = _context27["catch"](1);
7745
+ _loggerProxy.default.logger.error("".concat(LOG_HEADER, " retry with TURN-TLS failed, media connection unable to connect, "), _t31);
7746
+ throw _t31;
7538
7747
  case 4:
7539
7748
  case "end":
7540
- return _context26.stop();
7749
+ return _context27.stop();
7541
7750
  }
7542
- }, _callee26, this, [[1, 3]]);
7751
+ }, _callee27, this, [[1, 3]]);
7543
7752
  }));
7544
7753
  function retryEstablishMediaConnectionWithForcedTurnDiscovery(_x18, _x19) {
7545
7754
  return _retryEstablishMediaConnectionWithForcedTurnDiscovery.apply(this, arguments);
@@ -7559,14 +7768,14 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7559
7768
  }, {
7560
7769
  key: "retryWithForcedTurnDiscovery",
7561
7770
  value: (function () {
7562
- var _retryWithForcedTurnDiscovery = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee27(remoteMediaManagerConfig, bundlePolicy) {
7771
+ var _retryWithForcedTurnDiscovery = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee28(remoteMediaManagerConfig, bundlePolicy) {
7563
7772
  var LOG_HEADER;
7564
- return _regenerator.default.wrap(function (_context27) {
7565
- while (1) switch (_context27.prev = _context27.next) {
7773
+ return _regenerator.default.wrap(function (_context28) {
7774
+ while (1) switch (_context28.prev = _context28.next) {
7566
7775
  case 0:
7567
7776
  this.addMediaData.retriedWithTurnServer = true;
7568
7777
  LOG_HEADER = 'Meeting:index#addMedia():retryWithForcedTurnDiscovery -->';
7569
- _context27.next = 1;
7778
+ _context28.next = 1;
7570
7779
  return this.cleanUpBeforeRetryWithTurnServer();
7571
7780
  case 1:
7572
7781
  _metrics.default.sendBehavioralMetric(_constants2.default.ADD_MEDIA_RETRY, {
@@ -7576,22 +7785,22 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7576
7785
  reason: 'forcingTurnTls'
7577
7786
  });
7578
7787
  if (!(this.state === _constants.MEETING_STATE.STATES.LEFT)) {
7579
- _context27.next = 2;
7788
+ _context28.next = 2;
7580
7789
  break;
7581
7790
  }
7582
7791
  _loggerProxy.default.logger.info("".concat(LOG_HEADER, " meeting state was LEFT after first attempt to establish media connection. Attempting to rejoin. "));
7583
- _context27.next = 2;
7792
+ _context28.next = 2;
7584
7793
  return this.join({
7585
7794
  rejoin: true
7586
7795
  });
7587
7796
  case 2:
7588
- _context27.next = 3;
7797
+ _context28.next = 3;
7589
7798
  return this.retryEstablishMediaConnectionWithForcedTurnDiscovery(remoteMediaManagerConfig, bundlePolicy);
7590
7799
  case 3:
7591
7800
  case "end":
7592
- return _context27.stop();
7801
+ return _context28.stop();
7593
7802
  }
7594
- }, _callee27, this);
7803
+ }, _callee28, this);
7595
7804
  }));
7596
7805
  function retryWithForcedTurnDiscovery(_x20, _x21) {
7597
7806
  return _retryWithForcedTurnDiscovery.apply(this, arguments);
@@ -7613,30 +7822,30 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7613
7822
  }, {
7614
7823
  key: "handleWaitForMediaConnectionConnectedError",
7615
7824
  value: (function () {
7616
- var _handleWaitForMediaConnectionConnectedError = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee28(error, remoteMediaManagerConfig, bundlePolicy) {
7825
+ var _handleWaitForMediaConnectionConnectedError = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee29(error, remoteMediaManagerConfig, bundlePolicy) {
7617
7826
  var LOG_HEADER;
7618
- return _regenerator.default.wrap(function (_context28) {
7619
- while (1) switch (_context28.prev = _context28.next) {
7827
+ return _regenerator.default.wrap(function (_context29) {
7828
+ while (1) switch (_context29.prev = _context29.next) {
7620
7829
  case 0:
7621
7830
  LOG_HEADER = 'Meeting:index#addMedia():handleWaitForMediaConnectionConnectedError -->'; // @ts-ignore - config coming from registerPlugin
7622
7831
  if (this.turnServerUsed) {
7623
- _context28.next = 2;
7832
+ _context29.next = 2;
7624
7833
  break;
7625
7834
  }
7626
7835
  _loggerProxy.default.logger.info("".concat(LOG_HEADER, " error waiting for media to connect on UDP, TCP, retrying using TURN-TLS, "), error);
7627
- _context28.next = 1;
7836
+ _context29.next = 1;
7628
7837
  return this.retryWithForcedTurnDiscovery(remoteMediaManagerConfig, bundlePolicy);
7629
7838
  case 1:
7630
- _context28.next = 3;
7839
+ _context29.next = 3;
7631
7840
  break;
7632
7841
  case 2:
7633
7842
  _loggerProxy.default.logger.error("".concat(LOG_HEADER, " error waiting for media to connect using UDP, TCP and TURN-TLS"), error);
7634
7843
  throw new _webexErrors.AddMediaFailed(error);
7635
7844
  case 3:
7636
7845
  case "end":
7637
- return _context28.stop();
7846
+ return _context29.stop();
7638
7847
  }
7639
- }, _callee28, this);
7848
+ }, _callee29, this);
7640
7849
  }));
7641
7850
  function handleWaitForMediaConnectionConnectedError(_x22, _x23, _x24) {
7642
7851
  return _handleWaitForMediaConnectionConnectedError.apply(this, arguments);
@@ -7654,20 +7863,20 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7654
7863
  }, {
7655
7864
  key: "doTurnDiscovery",
7656
7865
  value: (function () {
7657
- var _doTurnDiscovery = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee29(isReconnecting, isForced) {
7866
+ var _doTurnDiscovery = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee30(isReconnecting, isForced) {
7658
7867
  var cdl, turnDiscoveryResult;
7659
- return _regenerator.default.wrap(function (_context29) {
7660
- while (1) switch (_context29.prev = _context29.next) {
7868
+ return _regenerator.default.wrap(function (_context30) {
7869
+ while (1) switch (_context30.prev = _context30.next) {
7661
7870
  case 0:
7662
7871
  // @ts-ignore
7663
7872
  cdl = this.webex.internal.newMetrics.callDiagnosticLatencies; // @ts-ignore
7664
7873
  this.webex.internal.newMetrics.submitInternalEvent({
7665
7874
  name: 'internal.client.add-media.turn-discovery.start'
7666
7875
  });
7667
- _context29.next = 1;
7876
+ _context30.next = 1;
7668
7877
  return this.roap.doTurnDiscovery(this, isReconnecting, isForced);
7669
7878
  case 1:
7670
- turnDiscoveryResult = _context29.sent;
7879
+ turnDiscoveryResult = _context30.sent;
7671
7880
  this.turnDiscoverySkippedReason = turnDiscoveryResult === null || turnDiscoveryResult === void 0 ? void 0 : turnDiscoveryResult.turnDiscoverySkippedReason;
7672
7881
  this.turnServerUsed = !this.turnDiscoverySkippedReason;
7673
7882
 
@@ -7683,12 +7892,12 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7683
7892
  retriedWithTurnServer: this.addMediaData.retriedWithTurnServer
7684
7893
  });
7685
7894
  }
7686
- return _context29.abrupt("return", turnDiscoveryResult);
7895
+ return _context30.abrupt("return", turnDiscoveryResult);
7687
7896
  case 2:
7688
7897
  case "end":
7689
- return _context29.stop();
7898
+ return _context30.stop();
7690
7899
  }
7691
- }, _callee29, this);
7900
+ }, _callee30, this);
7692
7901
  }));
7693
7902
  function doTurnDiscovery(_x25, _x26) {
7694
7903
  return _doTurnDiscovery.apply(this, arguments);
@@ -7709,35 +7918,35 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7709
7918
  }, {
7710
7919
  key: "establishMediaConnection",
7711
7920
  value: (function () {
7712
- var _establishMediaConnection = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee30(remoteMediaManagerConfig, bundlePolicy, isForced, turnServerInfo) {
7921
+ var _establishMediaConnection = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee31(remoteMediaManagerConfig, bundlePolicy, isForced, turnServerInfo) {
7713
7922
  var _this$locusMediaReque;
7714
- var LOG_HEADER, isReconnecting, _yield$this$doTurnDis, mc, _t30, _t31;
7715
- return _regenerator.default.wrap(function (_context30) {
7716
- while (1) switch (_context30.prev = _context30.next) {
7923
+ var LOG_HEADER, isReconnecting, _yield$this$doTurnDis, mc, _t32, _t33;
7924
+ return _regenerator.default.wrap(function (_context31) {
7925
+ while (1) switch (_context31.prev = _context31.next) {
7717
7926
  case 0:
7718
7927
  LOG_HEADER = 'Meeting:index#addMedia():establishMediaConnection -->';
7719
7928
  isReconnecting = this.isMoveToInProgress || !!((_this$locusMediaReque = this.locusMediaRequest) !== null && _this$locusMediaReque !== void 0 && _this$locusMediaReque.isConfluenceCreated()); // We are forcing turn discovery if the case is moveTo and a turn server was used already
7720
7929
  if (this.isMoveToInProgress && this.turnServerUsed) {
7721
7930
  isForced = true;
7722
7931
  }
7723
- _context30.prev = 1;
7932
+ _context31.prev = 1;
7724
7933
  if (turnServerInfo) {
7725
- _context30.next = 3;
7934
+ _context31.next = 3;
7726
7935
  break;
7727
7936
  }
7728
- _context30.next = 2;
7937
+ _context31.next = 2;
7729
7938
  return this.doTurnDiscovery(isReconnecting, isForced);
7730
7939
  case 2:
7731
- _yield$this$doTurnDis = _context30.sent;
7940
+ _yield$this$doTurnDis = _context31.sent;
7732
7941
  turnServerInfo = _yield$this$doTurnDis.turnServerInfo;
7733
7942
  case 3:
7734
- _context30.next = 4;
7943
+ _context31.next = 4;
7735
7944
  return this.createMediaConnection(turnServerInfo, bundlePolicy);
7736
7945
  case 4:
7737
- mc = _context30.sent;
7946
+ mc = _context31.sent;
7738
7947
  _loggerProxy.default.logger.info("".concat(LOG_HEADER, " media connection created this.isMultistream=").concat(this.isMultistream));
7739
7948
  if (!this.isMultistream) {
7740
- _context30.next = 5;
7949
+ _context31.next = 5;
7741
7950
  break;
7742
7951
  }
7743
7952
  this.remoteMediaManager = new _remoteMediaManager.RemoteMediaManager(this.receiveSlotManager, this.mediaRequestManagers, remoteMediaManagerConfig);
@@ -7745,40 +7954,40 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7745
7954
  this.forwardEvent(this.remoteMediaManager, _remoteMediaManager.Event.InterpretationAudioCreated, _constants.EVENT_TRIGGERS.REMOTE_MEDIA_INTERPRETATION_AUDIO_CREATED);
7746
7955
  this.forwardEvent(this.remoteMediaManager, _remoteMediaManager.Event.ScreenShareAudioCreated, _constants.EVENT_TRIGGERS.REMOTE_MEDIA_SCREEN_SHARE_AUDIO_CREATED);
7747
7956
  this.forwardEvent(this.remoteMediaManager, _remoteMediaManager.Event.VideoLayoutChanged, _constants.EVENT_TRIGGERS.REMOTE_MEDIA_VIDEO_LAYOUT_CHANGED);
7748
- _context30.next = 5;
7957
+ _context31.next = 5;
7749
7958
  return this.remoteMediaManager.start();
7750
7959
  case 5:
7751
- _context30.next = 6;
7960
+ _context31.next = 6;
7752
7961
  return mc.initiateOffer();
7753
7962
  case 6:
7754
- _context30.next = 7;
7963
+ _context31.next = 7;
7755
7964
  return this.waitForRemoteSDPAnswer();
7756
7965
  case 7:
7757
7966
  this.handleMediaLogging(this.mediaProperties);
7758
- _context30.next = 9;
7967
+ _context31.next = 9;
7759
7968
  break;
7760
7969
  case 8:
7761
- _context30.prev = 8;
7762
- _t30 = _context30["catch"](1);
7763
- _loggerProxy.default.logger.error("".concat(LOG_HEADER, " error establishing media connection, "), _t30);
7764
- throw _t30;
7970
+ _context31.prev = 8;
7971
+ _t32 = _context31["catch"](1);
7972
+ _loggerProxy.default.logger.error("".concat(LOG_HEADER, " error establishing media connection, "), _t32);
7973
+ throw _t32;
7765
7974
  case 9:
7766
- _context30.prev = 9;
7767
- _context30.next = 10;
7975
+ _context31.prev = 9;
7976
+ _context31.next = 10;
7768
7977
  return this.waitForMediaConnectionConnected();
7769
7978
  case 10:
7770
- _context30.next = 12;
7979
+ _context31.next = 12;
7771
7980
  break;
7772
7981
  case 11:
7773
- _context30.prev = 11;
7774
- _t31 = _context30["catch"](9);
7775
- _context30.next = 12;
7776
- return this.handleWaitForMediaConnectionConnectedError(_t31, remoteMediaManagerConfig, bundlePolicy);
7982
+ _context31.prev = 11;
7983
+ _t33 = _context31["catch"](9);
7984
+ _context31.next = 12;
7985
+ return this.handleWaitForMediaConnectionConnectedError(_t33, remoteMediaManagerConfig, bundlePolicy);
7777
7986
  case 12:
7778
7987
  case "end":
7779
- return _context30.stop();
7988
+ return _context31.stop();
7780
7989
  }
7781
- }, _callee30, this, [[1, 8], [9, 11]]);
7990
+ }, _callee31, this, [[1, 8], [9, 11]]);
7782
7991
  }));
7783
7992
  function establishMediaConnection(_x27, _x28, _x29, _x30) {
7784
7993
  return _establishMediaConnection.apply(this, arguments);
@@ -7795,16 +8004,16 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7795
8004
  }, {
7796
8005
  key: "cleanUpOnAddMediaFailure",
7797
8006
  value: (function () {
7798
- var _cleanUpOnAddMediaFailure = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee31() {
8007
+ var _cleanUpOnAddMediaFailure = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee32() {
7799
8008
  var _this$networkQualityM, _this$statsMonitor;
7800
- return _regenerator.default.wrap(function (_context31) {
7801
- while (1) switch (_context31.prev = _context31.next) {
8009
+ return _regenerator.default.wrap(function (_context32) {
8010
+ while (1) switch (_context32.prev = _context32.next) {
7802
8011
  case 0:
7803
8012
  if (!this.statsAnalyzer) {
7804
- _context31.next = 1;
8013
+ _context32.next = 1;
7805
8014
  break;
7806
8015
  }
7807
- _context31.next = 1;
8016
+ _context32.next = 1;
7808
8017
  return this.statsAnalyzer.stopAnalyzer();
7809
8018
  case 1:
7810
8019
  this.statsAnalyzer = null;
@@ -7815,7 +8024,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7815
8024
 
7816
8025
  // when media fails, we want to upload a webrtc dump to see whats going on
7817
8026
  // this function is async, but returns once the stats have been gathered
7818
- _context31.next = 2;
8027
+ _context32.next = 2;
7819
8028
  return this.forceSendStatsReport({
7820
8029
  callFrom: 'addMedia'
7821
8030
  });
@@ -7826,9 +8035,9 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7826
8035
  }
7827
8036
  case 3:
7828
8037
  case "end":
7829
- return _context31.stop();
8038
+ return _context32.stop();
7830
8039
  }
7831
- }, _callee31, this);
8040
+ }, _callee32, this);
7832
8041
  }));
7833
8042
  function cleanUpOnAddMediaFailure() {
7834
8043
  return _cleanUpOnAddMediaFailure.apply(this, arguments);
@@ -7846,16 +8055,16 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7846
8055
  }, {
7847
8056
  key: "downgradeFromMultistreamToTranscoded",
7848
8057
  value: (function () {
7849
- var _downgradeFromMultistreamToTranscoded = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee32() {
8058
+ var _downgradeFromMultistreamToTranscoded = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee33() {
7850
8059
  var _this$networkQualityM2, _this$statsMonitor2, _this$locusMediaReque2;
7851
- return _regenerator.default.wrap(function (_context32) {
7852
- while (1) switch (_context32.prev = _context32.next) {
8060
+ return _regenerator.default.wrap(function (_context33) {
8061
+ while (1) switch (_context33.prev = _context33.next) {
7853
8062
  case 0:
7854
8063
  if (!this.statsAnalyzer) {
7855
- _context32.next = 1;
8064
+ _context33.next = 1;
7856
8065
  break;
7857
8066
  }
7858
- _context32.next = 1;
8067
+ _context33.next = 1;
7859
8068
  return this.statsAnalyzer.stopAnalyzer();
7860
8069
  case 1:
7861
8070
  this.statsAnalyzer = null;
@@ -7873,9 +8082,9 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7873
8082
  this.createStatsAnalyzer();
7874
8083
  case 2:
7875
8084
  case "end":
7876
- return _context32.stop();
8085
+ return _context33.stop();
7877
8086
  }
7878
- }, _callee32, this);
8087
+ }, _callee33, this);
7879
8088
  }));
7880
8089
  function downgradeFromMultistreamToTranscoded() {
7881
8090
  return _downgradeFromMultistreamToTranscoded.apply(this, arguments);
@@ -7893,11 +8102,11 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7893
8102
  }, {
7894
8103
  key: "cleanUpBeforeRetryWithTurnServer",
7895
8104
  value: (function () {
7896
- var _cleanUpBeforeRetryWithTurnServer = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee33() {
7897
- return _regenerator.default.wrap(function (_context33) {
7898
- while (1) switch (_context33.prev = _context33.next) {
8105
+ var _cleanUpBeforeRetryWithTurnServer = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee34() {
8106
+ return _regenerator.default.wrap(function (_context34) {
8107
+ while (1) switch (_context34.prev = _context34.next) {
7899
8108
  case 0:
7900
- _context33.next = 1;
8109
+ _context34.next = 1;
7901
8110
  return this.forceSendStatsReport({
7902
8111
  callFrom: 'cleanUpBeforeRetryWithTurnServer'
7903
8112
  });
@@ -7917,9 +8126,9 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7917
8126
  }
7918
8127
  case 2:
7919
8128
  case "end":
7920
- return _context33.stop();
8129
+ return _context34.stop();
7921
8130
  }
7922
- }, _callee33, this);
8131
+ }, _callee34, this);
7923
8132
  }));
7924
8133
  function cleanUpBeforeRetryWithTurnServer() {
7925
8134
  return _cleanUpBeforeRetryWithTurnServer.apply(this, arguments);
@@ -7929,35 +8138,35 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7929
8138
  }, {
7930
8139
  key: "cleanUpBeforeReconnection",
7931
8140
  value: function () {
7932
- var _cleanUpBeforeReconnection = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee34() {
7933
- var _t32;
7934
- return _regenerator.default.wrap(function (_context34) {
7935
- while (1) switch (_context34.prev = _context34.next) {
8141
+ var _cleanUpBeforeReconnection = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee35() {
8142
+ var _t34;
8143
+ return _regenerator.default.wrap(function (_context35) {
8144
+ while (1) switch (_context35.prev = _context35.next) {
7936
8145
  case 0:
7937
- _context34.prev = 0;
7938
- _context34.next = 1;
8146
+ _context35.prev = 0;
8147
+ _context35.next = 1;
7939
8148
  return this.forceSendStatsReport({
7940
8149
  callFrom: 'cleanUpBeforeReconnection'
7941
8150
  });
7942
8151
  case 1:
7943
8152
  if (!this.statsAnalyzer) {
7944
- _context34.next = 2;
8153
+ _context35.next = 2;
7945
8154
  break;
7946
8155
  }
7947
- _context34.next = 2;
8156
+ _context35.next = 2;
7948
8157
  return this.statsAnalyzer.stopAnalyzer();
7949
8158
  case 2:
7950
- _context34.next = 4;
8159
+ _context35.next = 4;
7951
8160
  break;
7952
8161
  case 3:
7953
- _context34.prev = 3;
7954
- _t32 = _context34["catch"](0);
7955
- _loggerProxy.default.logger.error('Meeting:index#cleanUpBeforeReconnection --> Error during cleanup: ', _t32);
8162
+ _context35.prev = 3;
8163
+ _t34 = _context35["catch"](0);
8164
+ _loggerProxy.default.logger.error('Meeting:index#cleanUpBeforeReconnection --> Error during cleanup: ', _t34);
7956
8165
  case 4:
7957
8166
  case "end":
7958
- return _context34.stop();
8167
+ return _context35.stop();
7959
8168
  }
7960
- }, _callee34, this, [[0, 3]]);
8169
+ }, _callee35, this, [[0, 3]]);
7961
8170
  }));
7962
8171
  function cleanUpBeforeReconnection() {
7963
8172
  return _cleanUpBeforeReconnection.apply(this, arguments);
@@ -8025,7 +8234,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
8025
8234
  }, {
8026
8235
  key: "addMediaInternal",
8027
8236
  value: (function () {
8028
- var _addMediaInternal = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee35(icePhaseCallback, turnServerInfo, forceTurnDiscovery) {
8237
+ var _addMediaInternal = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee36(icePhaseCallback, turnServerInfo, forceTurnDiscovery) {
8029
8238
  var options,
8030
8239
  LOG_HEADER,
8031
8240
  localStreams,
@@ -8087,26 +8296,26 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
8087
8296
  _selectedCandidatePairChanges,
8088
8297
  _numTransports,
8089
8298
  _iceCandidateErrors,
8090
- _args35 = arguments,
8091
- _t33,
8092
- _t34;
8093
- return _regenerator.default.wrap(function (_context35) {
8094
- while (1) switch (_context35.prev = _context35.next) {
8299
+ _args36 = arguments,
8300
+ _t35,
8301
+ _t36;
8302
+ return _regenerator.default.wrap(function (_context36) {
8303
+ while (1) switch (_context36.prev = _context36.next) {
8095
8304
  case 0:
8096
- options = _args35.length > 3 && _args35[3] !== undefined ? _args35[3] : {};
8305
+ options = _args36.length > 3 && _args36[3] !== undefined ? _args36[3] : {};
8097
8306
  this.addMediaData.retriedWithTurnServer = false;
8098
8307
  this.addMediaData.icePhaseCallback = icePhaseCallback;
8099
8308
  this.hasMediaConnectionConnectedAtLeastOnce = false;
8100
8309
  LOG_HEADER = 'Meeting:index#addMedia -->';
8101
8310
  _loggerProxy.default.logger.info("".concat(LOG_HEADER, " called with: options=").concat((0, _stringify.default)(options), ", turnServerInfo=").concat((0, _stringify.default)(turnServerInfo), ", forceTurnDiscovery=").concat(forceTurnDiscovery));
8102
8311
  if (!(options.allowMediaInLobby !== true && this.meetingState !== _constants.FULL_STATE.ACTIVE)) {
8103
- _context35.next = 1;
8312
+ _context36.next = 1;
8104
8313
  break;
8105
8314
  }
8106
8315
  throw new _webexErrors.MeetingNotActiveError();
8107
8316
  case 1:
8108
8317
  if (!_util2.default.isUserInLeftState(this.locusInfo)) {
8109
- _context35.next = 2;
8318
+ _context36.next = 2;
8110
8319
  break;
8111
8320
  }
8112
8321
  throw new _webexErrors.UserNotJoinedError();
@@ -8123,7 +8332,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
8123
8332
  ipver = _util2.default.getIpVersion(this.webex); // used just for metrics
8124
8333
  // If the user is unjoined or guest waiting in lobby dont allow the user to addMedia
8125
8334
  if (!(this.isUserUnadmitted && !this.wirelessShare && !this.allowMediaInLobby)) {
8126
- _context35.next = 3;
8335
+ _context36.next = 3;
8127
8336
  break;
8128
8337
  }
8129
8338
  throw new _webexErrors.UserInLobbyError();
@@ -8167,62 +8376,62 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
8167
8376
  this.audio = (0, _muteState.createMuteState)(_constants.AUDIO, this, audioEnabled);
8168
8377
  this.video = (0, _muteState.createMuteState)(_constants.VIDEO, this, videoEnabled);
8169
8378
  this.brbState = (0, _brbState.createBrbState)(this, false);
8170
- _context35.prev = 4;
8379
+ _context36.prev = 4;
8171
8380
  if (!(allowPublishMediaInLobby || !this.isUserUnadmitted)) {
8172
- _context35.next = 5;
8381
+ _context36.next = 5;
8173
8382
  break;
8174
8383
  }
8175
- _context35.next = 5;
8384
+ _context36.next = 5;
8176
8385
  return this.setUpLocalStreamReferences(localStreams);
8177
8386
  case 5:
8178
8387
  this.setMercuryListener();
8179
8388
  this.createStatsAnalyzer();
8180
- _context35.prev = 6;
8181
- _context35.next = 7;
8389
+ _context36.prev = 6;
8390
+ _context36.next = 7;
8182
8391
  return this.establishMediaConnection(remoteMediaManagerConfig, bundlePolicy, forceTurnDiscovery, turnServerInfo);
8183
8392
  case 7:
8184
- _context35.next = 12;
8393
+ _context36.next = 12;
8185
8394
  break;
8186
8395
  case 8:
8187
- _context35.prev = 8;
8188
- _t33 = _context35["catch"](6);
8189
- if (!(_t33 instanceof _multistreamNotSupportedError.default)) {
8190
- _context35.next = 11;
8396
+ _context36.prev = 8;
8397
+ _t35 = _context36["catch"](6);
8398
+ if (!(_t35 instanceof _multistreamNotSupportedError.default)) {
8399
+ _context36.next = 11;
8191
8400
  break;
8192
8401
  }
8193
8402
  _loggerProxy.default.logger.warn("".concat(LOG_HEADER, " we asked for multistream backend (Homer), but got transcoded backend, recreating media connection..."));
8194
- _context35.next = 9;
8403
+ _context36.next = 9;
8195
8404
  return this.downgradeFromMultistreamToTranscoded();
8196
8405
  case 9:
8197
- _context35.next = 10;
8406
+ _context36.next = 10;
8198
8407
  return this.establishMediaConnection(remoteMediaManagerConfig, bundlePolicy, true, undefined);
8199
8408
  case 10:
8200
- _context35.next = 12;
8409
+ _context36.next = 12;
8201
8410
  break;
8202
8411
  case 11:
8203
- throw _t33;
8412
+ throw _t35;
8204
8413
  case 12:
8205
8414
  _loggerProxy.default.logger.info("".concat(LOG_HEADER, " media connected, finalizing..."));
8206
8415
  if (!this.mediaProperties.hasLocalShareStream()) {
8207
- _context35.next = 13;
8416
+ _context36.next = 13;
8208
8417
  break;
8209
8418
  }
8210
- _context35.next = 13;
8419
+ _context36.next = 13;
8211
8420
  return this.enqueueScreenShareFloorRequest();
8212
8421
  case 13:
8213
- _context35.next = 14;
8422
+ _context36.next = 14;
8214
8423
  return this.mediaProperties.getCurrentConnectionInfo();
8215
8424
  case 14:
8216
- _yield$this$mediaProp = _context35.sent;
8425
+ _yield$this$mediaProp = _context36.sent;
8217
8426
  connectionType = _yield$this$mediaProp.connectionType;
8218
8427
  ipVersion = _yield$this$mediaProp.ipVersion;
8219
8428
  selectedCandidatePairChanges = _yield$this$mediaProp.selectedCandidatePairChanges;
8220
8429
  numTransports = _yield$this$mediaProp.numTransports;
8221
8430
  iceCandidateErrors = Object.fromEntries(this.iceCandidateErrors);
8222
- _context35.next = 15;
8431
+ _context36.next = 15;
8223
8432
  return this.getMediaReachabilityMetricFields();
8224
8433
  case 15:
8225
- reachabilityMetrics = _context35.sent;
8434
+ reachabilityMetrics = _context36.sent;
8226
8435
  _metrics.default.sendBehavioralMetric(_constants2.default.ADD_MEDIA_SUCCESS, _objectSpread(_objectSpread(_objectSpread({
8227
8436
  correlation_id: this.correlationId,
8228
8437
  locus_id: this.locusUrl.split('/').pop(),
@@ -8252,31 +8461,31 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
8252
8461
  // We can log ReceiveSlot SSRCs only after the SDP exchange, so doing it here:
8253
8462
  (_this$remoteMediaMana = this.remoteMediaManager) === null || _this$remoteMediaMana === void 0 ? void 0 : _this$remoteMediaMana.logAllReceiveSlots();
8254
8463
  this.startPeriodicLogUpload();
8255
- _context35.next = 20;
8464
+ _context36.next = 20;
8256
8465
  break;
8257
8466
  case 16:
8258
- _context35.prev = 16;
8259
- _t34 = _context35["catch"](4);
8260
- _loggerProxy.default.logger.error("".concat(LOG_HEADER, " failed to establish media connection: "), _t34);
8467
+ _context36.prev = 16;
8468
+ _t36 = _context36["catch"](4);
8469
+ _loggerProxy.default.logger.error("".concat(LOG_HEADER, " failed to establish media connection: "), _t36);
8261
8470
 
8262
8471
  // @ts-ignore
8263
- _context35.next = 17;
8472
+ _context36.next = 17;
8264
8473
  return this.getMediaReachabilityMetricFields();
8265
8474
  case 17:
8266
- _reachabilityMetrics = _context35.sent;
8267
- _context35.next = 18;
8475
+ _reachabilityMetrics = _context36.sent;
8476
+ _context36.next = 18;
8268
8477
  return this.mediaProperties.getCurrentConnectionInfo();
8269
8478
  case 18:
8270
- _yield$this$mediaProp2 = _context35.sent;
8479
+ _yield$this$mediaProp2 = _context36.sent;
8271
8480
  _selectedCandidatePairChanges = _yield$this$mediaProp2.selectedCandidatePairChanges;
8272
8481
  _numTransports = _yield$this$mediaProp2.numTransports;
8273
8482
  _iceCandidateErrors = Object.fromEntries(this.iceCandidateErrors);
8274
8483
  _metrics.default.sendBehavioralMetric(_constants2.default.ADD_MEDIA_FAILURE, _objectSpread(_objectSpread(_objectSpread({
8275
8484
  correlation_id: this.correlationId,
8276
8485
  locus_id: this.locusUrl.split('/').pop(),
8277
- reason: _t34.message,
8278
- stack: _t34.stack,
8279
- code: _t34.code,
8486
+ reason: _t36.message,
8487
+ stack: _t36.stack,
8488
+ code: _t36.code,
8280
8489
  selectedCandidatePairChanges: _selectedCandidatePairChanges,
8281
8490
  numTransports: _numTransports,
8282
8491
  turnDiscoverySkippedReason: this.turnDiscoverySkippedReason,
@@ -8291,7 +8500,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
8291
8500
  iceCandidatesCount: this.iceCandidatesCount,
8292
8501
  ipver: ipver
8293
8502
  }));
8294
- _context35.next = 19;
8503
+ _context36.next = 19;
8295
8504
  return this.cleanUpOnAddMediaFailure();
8296
8505
  case 19:
8297
8506
  // Upload logs on error while adding media
@@ -8299,21 +8508,21 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
8299
8508
  file: 'meeting/index',
8300
8509
  function: 'addMedia'
8301
8510
  }, _constants.EVENTS.REQUEST_UPLOAD_LOGS, this);
8302
- if (_t34 instanceof _internalMediaCore.Errors.SdpError) {
8511
+ if (_t36 instanceof _internalMediaCore.Errors.SdpError) {
8303
8512
  this.leave({
8304
8513
  reason: _constants.MEETING_REMOVED_REASON.MEETING_CONNECTION_FAILED
8305
8514
  });
8306
8515
  }
8307
- throw _t34;
8516
+ throw _t36;
8308
8517
  case 20:
8309
- _context35.prev = 20;
8518
+ _context36.prev = 20;
8310
8519
  this.addMediaData.icePhaseCallback = DEFAULT_ICE_PHASE_CALLBACK;
8311
- return _context35.finish(20);
8520
+ return _context36.finish(20);
8312
8521
  case 21:
8313
8522
  case "end":
8314
- return _context35.stop();
8523
+ return _context36.stop();
8315
8524
  }
8316
- }, _callee35, this, [[4, 16, 20, 21], [6, 8]]);
8525
+ }, _callee36, this, [[4, 16, 20, 21], [6, 8]]);
8317
8526
  }));
8318
8527
  function addMediaInternal(_x31, _x32, _x33) {
8319
8528
  return _addMediaInternal.apply(this, arguments);
@@ -8381,35 +8590,35 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
8381
8590
  * @memberof Meeting
8382
8591
  */
8383
8592
  function () {
8384
- var _updateMedia = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee36(options) {
8593
+ var _updateMedia = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee37(options) {
8385
8594
  var audioEnabled, videoEnabled, shareAudioEnabled, shareVideoEnabled, _this$audio3, _this$video3;
8386
- return _regenerator.default.wrap(function (_context36) {
8387
- while (1) switch (_context36.prev = _context36.next) {
8595
+ return _regenerator.default.wrap(function (_context37) {
8596
+ while (1) switch (_context37.prev = _context37.next) {
8388
8597
  case 0:
8389
8598
  this.checkMediaConnection();
8390
8599
  audioEnabled = options.audioEnabled, videoEnabled = options.videoEnabled, shareAudioEnabled = options.shareAudioEnabled, shareVideoEnabled = options.shareVideoEnabled;
8391
8600
  _loggerProxy.default.logger.log("Meeting:index#updateMedia --> called with options=".concat((0, _stringify.default)(options)));
8392
8601
  if (this.canUpdateMedia()) {
8393
- _context36.next = 1;
8602
+ _context37.next = 1;
8394
8603
  break;
8395
8604
  }
8396
- return _context36.abrupt("return", this.enqueueMediaUpdate(MEDIA_UPDATE_TYPE.UPDATE_MEDIA, options));
8605
+ return _context37.abrupt("return", this.enqueueMediaUpdate(MEDIA_UPDATE_TYPE.UPDATE_MEDIA, options));
8397
8606
  case 1:
8398
8607
  if (!this.isMultistream) {
8399
- _context36.next = 3;
8608
+ _context37.next = 3;
8400
8609
  break;
8401
8610
  }
8402
8611
  if (!(shareAudioEnabled !== undefined || shareVideoEnabled !== undefined)) {
8403
- _context36.next = 2;
8612
+ _context37.next = 2;
8404
8613
  break;
8405
8614
  }
8406
8615
  throw new Error('toggling shareAudioEnabled or shareVideoEnabled in a multistream meeting is not supported, to control receiving screen share call meeting.remoteMediaManager.setLayout() with appropriate layout');
8407
8616
  case 2:
8408
- _context36.next = 4;
8617
+ _context37.next = 4;
8409
8618
  break;
8410
8619
  case 3:
8411
8620
  if (!(shareAudioEnabled !== undefined)) {
8412
- _context36.next = 4;
8621
+ _context37.next = 4;
8413
8622
  break;
8414
8623
  }
8415
8624
  throw new Error('toggling shareAudioEnabled in a transcoded meeting is not supported as of now');
@@ -8434,18 +8643,18 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
8434
8643
  this.mediaProperties.mediaDirection.receiveShare = !!(shareAudioEnabled || shareVideoEnabled);
8435
8644
  }
8436
8645
  if (this.isMultistream) {
8437
- _context36.next = 5;
8646
+ _context37.next = 5;
8438
8647
  break;
8439
8648
  }
8440
- _context36.next = 5;
8649
+ _context37.next = 5;
8441
8650
  return this.updateTranscodedMediaConnection();
8442
8651
  case 5:
8443
- return _context36.abrupt("return", undefined);
8652
+ return _context37.abrupt("return", undefined);
8444
8653
  case 6:
8445
8654
  case "end":
8446
- return _context36.stop();
8655
+ return _context37.stop();
8447
8656
  }
8448
- }, _callee36, this);
8657
+ }, _callee37, this);
8449
8658
  }));
8450
8659
  function updateMedia(_x34) {
8451
8660
  return _updateMedia.apply(this, arguments);
@@ -8587,15 +8796,16 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
8587
8796
  );
8588
8797
  };
8589
8798
  _loggerProxy.default.logger.log('Meeting:index#leave --> Leaving a meeting');
8799
+ this.stopListeningForMeetingEvents();
8590
8800
  return _util2.default.leaveMeeting(this, options).then(/*#__PURE__*/function () {
8591
- var _ref42 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee37(leave) {
8592
- return _regenerator.default.wrap(function (_context37) {
8593
- while (1) switch (_context37.prev = _context37.next) {
8801
+ var _ref41 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee38(leave) {
8802
+ return _regenerator.default.wrap(function (_context38) {
8803
+ while (1) switch (_context38.prev = _context38.next) {
8594
8804
  case 0:
8595
8805
  // CA team recommends submitting this *after* locus /leave
8596
8806
  submitLeaveMetric();
8597
8807
  _this49.meetingFiniteStateMachine.leave();
8598
- _context37.next = 1;
8808
+ _context38.next = 1;
8599
8809
  return _this49.clearMeetingData();
8600
8810
  case 1:
8601
8811
  // upload logs on leave irrespective of meeting delete
@@ -8616,15 +8826,15 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
8616
8826
  });
8617
8827
  }
8618
8828
  _loggerProxy.default.logger.log('Meeting:index#leave --> LEAVE REASON ', leaveReason);
8619
- return _context37.abrupt("return", leave);
8829
+ return _context38.abrupt("return", leave);
8620
8830
  case 2:
8621
8831
  case "end":
8622
- return _context37.stop();
8832
+ return _context38.stop();
8623
8833
  }
8624
- }, _callee37);
8834
+ }, _callee38);
8625
8835
  }));
8626
8836
  return function (_x35) {
8627
- return _ref42.apply(this, arguments);
8837
+ return _ref41.apply(this, arguments);
8628
8838
  };
8629
8839
  }()).catch(function (error) {
8630
8840
  // CA team recommends submitting this *after* locus /leave
@@ -9288,13 +9498,14 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
9288
9498
  correlation_id: this.correlationId,
9289
9499
  locus_id: this.locusId
9290
9500
  });
9501
+ this.stopListeningForMeetingEvents();
9291
9502
  return _util2.default.endMeetingForAll(this).then(/*#__PURE__*/function () {
9292
- var _ref43 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee38(end) {
9293
- return _regenerator.default.wrap(function (_context38) {
9294
- while (1) switch (_context38.prev = _context38.next) {
9503
+ var _ref42 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee39(end) {
9504
+ return _regenerator.default.wrap(function (_context39) {
9505
+ while (1) switch (_context39.prev = _context39.next) {
9295
9506
  case 0:
9296
9507
  _this56.meetingFiniteStateMachine.end();
9297
- _context38.next = 1;
9508
+ _context39.next = 1;
9298
9509
  return _this56.clearMeetingData();
9299
9510
  case 1:
9300
9511
  // upload logs on leave irrespective of meeting delete
@@ -9302,15 +9513,15 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
9302
9513
  file: 'meeting/index',
9303
9514
  function: 'endMeetingForAll'
9304
9515
  }, _constants.EVENTS.REQUEST_UPLOAD_LOGS, _this56);
9305
- return _context38.abrupt("return", end);
9516
+ return _context39.abrupt("return", end);
9306
9517
  case 2:
9307
9518
  case "end":
9308
- return _context38.stop();
9519
+ return _context39.stop();
9309
9520
  }
9310
- }, _callee38);
9521
+ }, _callee39);
9311
9522
  }));
9312
9523
  return function (_x36) {
9313
- return _ref43.apply(this, arguments);
9524
+ return _ref42.apply(this, arguments);
9314
9525
  };
9315
9526
  }()).catch(function (error) {
9316
9527
  _this56.meetingFiniteStateMachine.fail(error);
@@ -9374,12 +9585,12 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
9374
9585
  */
9375
9586
  }, {
9376
9587
  key: "extendMeeting",
9377
- value: function extendMeeting(_ref44) {
9378
- var meetingPolicyUrl = _ref44.meetingPolicyUrl,
9379
- meetingInstanceId = _ref44.meetingInstanceId,
9380
- participantId = _ref44.participantId,
9381
- _ref44$extensionMinut = _ref44.extensionMinutes,
9382
- extensionMinutes = _ref44$extensionMinut === void 0 ? 30 : _ref44$extensionMinut;
9588
+ value: function extendMeeting(_ref43) {
9589
+ var meetingPolicyUrl = _ref43.meetingPolicyUrl,
9590
+ meetingInstanceId = _ref43.meetingInstanceId,
9591
+ participantId = _ref43.participantId,
9592
+ _ref43$extensionMinut = _ref43.extensionMinutes,
9593
+ extensionMinutes = _ref43$extensionMinut === void 0 ? 30 : _ref43$extensionMinut;
9383
9594
  if (!meetingInstanceId || !participantId) {
9384
9595
  return _promise.default.reject(new Error('Missing meetingInstanceId or participantId'));
9385
9596
  }
@@ -9460,37 +9671,37 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
9460
9671
  }, {
9461
9672
  key: "enableMusicMode",
9462
9673
  value: (function () {
9463
- var _enableMusicMode = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee39(shouldEnableMusicMode) {
9464
- return _regenerator.default.wrap(function (_context39) {
9465
- while (1) switch (_context39.prev = _context39.next) {
9674
+ var _enableMusicMode = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee40(shouldEnableMusicMode) {
9675
+ return _regenerator.default.wrap(function (_context40) {
9676
+ while (1) switch (_context40.prev = _context40.next) {
9466
9677
  case 0:
9467
9678
  this.checkMediaConnection();
9468
9679
  if (this.isMultistream) {
9469
- _context39.next = 1;
9680
+ _context40.next = 1;
9470
9681
  break;
9471
9682
  }
9472
9683
  throw new Error('enableMusicMode() only supported with multistream');
9473
9684
  case 1:
9474
9685
  if (!shouldEnableMusicMode) {
9475
- _context39.next = 3;
9686
+ _context40.next = 3;
9476
9687
  break;
9477
9688
  }
9478
- _context39.next = 2;
9689
+ _context40.next = 2;
9479
9690
  return this.sendSlotManager.setCustomCodecParameters(_internalMediaCore.MediaType.AudioMain, _internalMediaCore.MediaCodecMimeType.OPUS, {
9480
9691
  maxaveragebitrate: '64000',
9481
9692
  maxplaybackrate: '48000'
9482
9693
  });
9483
9694
  case 2:
9484
- _context39.next = 4;
9695
+ _context40.next = 4;
9485
9696
  break;
9486
9697
  case 3:
9487
- _context39.next = 4;
9698
+ _context40.next = 4;
9488
9699
  return this.sendSlotManager.markCustomCodecParametersForDeletion(_internalMediaCore.MediaType.AudioMain, _internalMediaCore.MediaCodecMimeType.OPUS, ['maxaveragebitrate', 'maxplaybackrate']);
9489
9700
  case 4:
9490
9701
  case "end":
9491
- return _context39.stop();
9702
+ return _context40.stop();
9492
9703
  }
9493
- }, _callee39, this);
9704
+ }, _callee40, this);
9494
9705
  }));
9495
9706
  function enableMusicMode(_x37) {
9496
9707
  return _enableMusicMode.apply(this, arguments);
@@ -9583,25 +9794,25 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
9583
9794
  }, {
9584
9795
  key: "publishStream",
9585
9796
  value: (function () {
9586
- var _publishStream = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee40(mediaType, stream) {
9587
- return _regenerator.default.wrap(function (_context40) {
9588
- while (1) switch (_context40.prev = _context40.next) {
9797
+ var _publishStream = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee41(mediaType, stream) {
9798
+ return _regenerator.default.wrap(function (_context41) {
9799
+ while (1) switch (_context41.prev = _context41.next) {
9589
9800
  case 0:
9590
9801
  if (stream) {
9591
- _context40.next = 1;
9802
+ _context41.next = 1;
9592
9803
  break;
9593
9804
  }
9594
- return _context40.abrupt("return");
9805
+ return _context41.abrupt("return");
9595
9806
  case 1:
9596
9807
  if (!this.mediaProperties.webrtcMediaConnection) {
9597
- _context40.next = 3;
9808
+ _context41.next = 3;
9598
9809
  break;
9599
9810
  }
9600
9811
  if (!(this.isMultistream && this.mediaProperties.webrtcMediaConnection)) {
9601
- _context40.next = 2;
9812
+ _context41.next = 2;
9602
9813
  break;
9603
9814
  }
9604
- _context40.next = 2;
9815
+ _context41.next = 2;
9605
9816
  return this.sendSlotManager.publishStream(mediaType, stream);
9606
9817
  case 2:
9607
9818
  this.emitPublishStateChangeEvent({
@@ -9612,9 +9823,9 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
9612
9823
  });
9613
9824
  case 3:
9614
9825
  case "end":
9615
- return _context40.stop();
9826
+ return _context41.stop();
9616
9827
  }
9617
- }, _callee40, this);
9828
+ }, _callee41, this);
9618
9829
  }));
9619
9830
  function publishStream(_x38, _x39) {
9620
9831
  return _publishStream.apply(this, arguments);
@@ -9632,21 +9843,21 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
9632
9843
  }, {
9633
9844
  key: "unpublishStream",
9634
9845
  value: (function () {
9635
- var _unpublishStream = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee41(mediaType, stream) {
9636
- return _regenerator.default.wrap(function (_context41) {
9637
- while (1) switch (_context41.prev = _context41.next) {
9846
+ var _unpublishStream = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee42(mediaType, stream) {
9847
+ return _regenerator.default.wrap(function (_context42) {
9848
+ while (1) switch (_context42.prev = _context42.next) {
9638
9849
  case 0:
9639
9850
  if (stream) {
9640
- _context41.next = 1;
9851
+ _context42.next = 1;
9641
9852
  break;
9642
9853
  }
9643
- return _context41.abrupt("return");
9854
+ return _context42.abrupt("return");
9644
9855
  case 1:
9645
9856
  if (!(this.isMultistream && this.mediaProperties.webrtcMediaConnection)) {
9646
- _context41.next = 2;
9857
+ _context42.next = 2;
9647
9858
  break;
9648
9859
  }
9649
- _context41.next = 2;
9860
+ _context42.next = 2;
9650
9861
  return this.sendSlotManager.unpublishStream(mediaType);
9651
9862
  case 2:
9652
9863
  this.emitPublishStateChangeEvent({
@@ -9657,9 +9868,9 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
9657
9868
  });
9658
9869
  case 3:
9659
9870
  case "end":
9660
- return _context41.stop();
9871
+ return _context42.stop();
9661
9872
  }
9662
- }, _callee41, this);
9873
+ }, _callee42, this);
9663
9874
  }));
9664
9875
  function unpublishStream(_x40, _x41) {
9665
9876
  return _unpublishStream.apply(this, arguments);
@@ -9676,19 +9887,19 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
9676
9887
  }, {
9677
9888
  key: "publishStreams",
9678
9889
  value: (function () {
9679
- var _publishStreams = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee42(streams) {
9890
+ var _publishStreams = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee43(streams) {
9680
9891
  var _streams$screenShare, _streams$screenShare2, _streams$screenShare3, _streams$screenShare4, _streams$screenShare5, _streams$screenShare6;
9681
9892
  var streamChecks, _i, _streamChecks, _streamChecks$_i, stream, name, floorRequestNeeded, _streams$screenShare7;
9682
- return _regenerator.default.wrap(function (_context42) {
9683
- while (1) switch (_context42.prev = _context42.next) {
9893
+ return _regenerator.default.wrap(function (_context43) {
9894
+ while (1) switch (_context43.prev = _context43.next) {
9684
9895
  case 0:
9685
9896
  _loggerProxy.default.logger.info("Meeting:index#publishStreams --> called with: ".concat((0, _stringify.default)(streams)));
9686
9897
  this.checkMediaConnection();
9687
9898
  if (!(!streams.microphone && !streams.camera && !((_streams$screenShare = streams.screenShare) !== null && _streams$screenShare !== void 0 && _streams$screenShare.audio) && !((_streams$screenShare2 = streams.screenShare) !== null && _streams$screenShare2 !== void 0 && _streams$screenShare2.video))) {
9688
- _context42.next = 1;
9899
+ _context43.next = 1;
9689
9900
  break;
9690
9901
  }
9691
- return _context42.abrupt("return");
9902
+ return _context43.abrupt("return");
9692
9903
  case 1:
9693
9904
  streamChecks = [{
9694
9905
  stream: streams === null || streams === void 0 ? void 0 : streams.microphone,
@@ -9706,62 +9917,62 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
9706
9917
  _i = 0, _streamChecks = streamChecks;
9707
9918
  case 2:
9708
9919
  if (!(_i < _streamChecks.length)) {
9709
- _context42.next = 4;
9920
+ _context43.next = 4;
9710
9921
  break;
9711
9922
  }
9712
9923
  _streamChecks$_i = _streamChecks[_i], stream = _streamChecks$_i.stream, name = _streamChecks$_i.name;
9713
9924
  if (!((stream === null || stream === void 0 ? void 0 : stream.readyState) === 'ended')) {
9714
- _context42.next = 3;
9925
+ _context43.next = 3;
9715
9926
  break;
9716
9927
  }
9717
9928
  throw new Error("Attempted to publish ".concat(name, " stream with ended readyState, correlationId=").concat(this.correlationId));
9718
9929
  case 3:
9719
9930
  _i++;
9720
- _context42.next = 2;
9931
+ _context43.next = 2;
9721
9932
  break;
9722
9933
  case 4:
9723
9934
  floorRequestNeeded = false; // Screenshare Audio is supported only in multi stream. So we check for screenshare audio presence only if it's a multi stream meeting
9724
9935
  if (!(this.isMultistream && (_streams$screenShare5 = streams.screenShare) !== null && _streams$screenShare5 !== void 0 && _streams$screenShare5.audio)) {
9725
- _context42.next = 6;
9936
+ _context43.next = 6;
9726
9937
  break;
9727
9938
  }
9728
- _context42.next = 5;
9939
+ _context43.next = 5;
9729
9940
  return this.setLocalShareAudioStream(streams.screenShare.audio);
9730
9941
  case 5:
9731
9942
  floorRequestNeeded = this.screenShareFloorState === ScreenShareFloorStatus.RELEASED;
9732
9943
  case 6:
9733
9944
  if (!((_streams$screenShare6 = streams.screenShare) !== null && _streams$screenShare6 !== void 0 && _streams$screenShare6.video)) {
9734
- _context42.next = 8;
9945
+ _context43.next = 8;
9735
9946
  break;
9736
9947
  }
9737
- _context42.next = 7;
9948
+ _context43.next = 7;
9738
9949
  return this.setLocalShareVideoStream((_streams$screenShare7 = streams.screenShare) === null || _streams$screenShare7 === void 0 ? void 0 : _streams$screenShare7.video);
9739
9950
  case 7:
9740
9951
  floorRequestNeeded = this.screenShareFloorState === ScreenShareFloorStatus.RELEASED;
9741
9952
  case 8:
9742
9953
  if (!streams.microphone) {
9743
- _context42.next = 9;
9954
+ _context43.next = 9;
9744
9955
  break;
9745
9956
  }
9746
- _context42.next = 9;
9957
+ _context43.next = 9;
9747
9958
  return this.setLocalAudioStream(streams.microphone);
9748
9959
  case 9:
9749
9960
  if (!streams.camera) {
9750
- _context42.next = 10;
9961
+ _context43.next = 10;
9751
9962
  break;
9752
9963
  }
9753
- _context42.next = 10;
9964
+ _context43.next = 10;
9754
9965
  return this.setLocalVideoStream(streams.camera);
9755
9966
  case 10:
9756
9967
  if (this.isMultistream) {
9757
- _context42.next = 11;
9968
+ _context43.next = 11;
9758
9969
  break;
9759
9970
  }
9760
- _context42.next = 11;
9971
+ _context43.next = 11;
9761
9972
  return this.updateTranscodedMediaConnection();
9762
9973
  case 11:
9763
9974
  if (!floorRequestNeeded) {
9764
- _context42.next = 12;
9975
+ _context43.next = 12;
9765
9976
  break;
9766
9977
  }
9767
9978
  this.localShareInstanceId = _uuid.default.v4();
@@ -9792,13 +10003,13 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
9792
10003
  // we're sending the http request to Locus to request the screen share floor
9793
10004
  // only after the SDP update, because that's how it's always been done for transcoded meetings
9794
10005
  // and also if sharing from the start, we need confluence to have been created
9795
- _context42.next = 12;
10006
+ _context43.next = 12;
9796
10007
  return this.enqueueScreenShareFloorRequest();
9797
10008
  case 12:
9798
10009
  case "end":
9799
- return _context42.stop();
10010
+ return _context43.stop();
9800
10011
  }
9801
- }, _callee42, this);
10012
+ }, _callee43, this);
9802
10013
  }));
9803
10014
  function publishStreams(_x42) {
9804
10015
  return _publishStreams.apply(this, arguments);
@@ -9815,10 +10026,10 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
9815
10026
  }, {
9816
10027
  key: "unpublishStreams",
9817
10028
  value: (function () {
9818
- var _unpublishStreams = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee43(streams) {
10029
+ var _unpublishStreams = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee44(streams) {
9819
10030
  var promises, _iterator, _step, stream;
9820
- return _regenerator.default.wrap(function (_context43) {
9821
- while (1) switch (_context43.prev = _context43.next) {
10031
+ return _regenerator.default.wrap(function (_context44) {
10032
+ while (1) switch (_context44.prev = _context44.next) {
9822
10033
  case 0:
9823
10034
  _loggerProxy.default.logger.info("Meeting:index#unpublishStreams --> called with: ".concat((0, _stringify.default)(streams)));
9824
10035
  this.checkMediaConnection();
@@ -9850,7 +10061,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
9850
10061
  if (!this.isMultistream) {
9851
10062
  promises.push(this.updateTranscodedMediaConnection());
9852
10063
  }
9853
- _context43.next = 1;
10064
+ _context44.next = 1;
9854
10065
  return _promise.default.all(promises);
9855
10066
  case 1:
9856
10067
  // we're allowing for the SDK to support just audio share as well
@@ -9871,9 +10082,9 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
9871
10082
  }
9872
10083
  case 2:
9873
10084
  case "end":
9874
- return _context43.stop();
10085
+ return _context44.stop();
9875
10086
  }
9876
- }, _callee43, this);
10087
+ }, _callee44, this);
9877
10088
  }));
9878
10089
  function unpublishStreams(_x43) {
9879
10090
  return _unpublishStreams.apply(this, arguments);
@@ -9941,16 +10152,16 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
9941
10152
  }, {
9942
10153
  key: "getMediaReachabilityMetricFields",
9943
10154
  value: (function () {
9944
- var _getMediaReachabilityMetricFields = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee44() {
10155
+ var _getMediaReachabilityMetricFields = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee45() {
9945
10156
  var _this$mediaServerIp, _this$mediaConnection, _this$mediaConnection2, _this$mediaConnection3;
9946
10157
  var reachabilityMetrics, successKeys, totalSuccessCases, selectedSubnetFirstOctet, isSubnetReachable, selectedCluster;
9947
- return _regenerator.default.wrap(function (_context44) {
9948
- while (1) switch (_context44.prev = _context44.next) {
10158
+ return _regenerator.default.wrap(function (_context45) {
10159
+ while (1) switch (_context45.prev = _context45.next) {
9949
10160
  case 0:
9950
- _context44.next = 1;
10161
+ _context45.next = 1;
9951
10162
  return this.webex.meetings.reachability.getReachabilityMetrics();
9952
10163
  case 1:
9953
- reachabilityMetrics = _context44.sent;
10164
+ reachabilityMetrics = _context45.sent;
9954
10165
  successKeys = ['reachability_public_udp_success', 'reachability_public_tcp_success', 'reachability_public_xtls_success', 'reachability_vmn_udp_success', 'reachability_vmn_tcp_success', 'reachability_vmn_xtls_success'];
9955
10166
  totalSuccessCases = successKeys.reduce(function (total, key) {
9956
10167
  var value = reachabilityMetrics[key];
@@ -9967,16 +10178,16 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
9967
10178
  this.webex.meetings.reachability.isSubnetReachable(selectedSubnetFirstOctet);
9968
10179
  }
9969
10180
  selectedCluster = (_this$mediaConnection = (_this$mediaConnection2 = this.mediaConnections) === null || _this$mediaConnection2 === void 0 ? void 0 : (_this$mediaConnection3 = _this$mediaConnection2[0]) === null || _this$mediaConnection3 === void 0 ? void 0 : _this$mediaConnection3.mediaAgentCluster) !== null && _this$mediaConnection !== void 0 ? _this$mediaConnection : null;
9970
- return _context44.abrupt("return", _objectSpread(_objectSpread({}, reachabilityMetrics), {}, {
10181
+ return _context45.abrupt("return", _objectSpread(_objectSpread({}, reachabilityMetrics), {}, {
9971
10182
  subnet_reachable: isSubnetReachable,
9972
10183
  selected_cluster: selectedCluster,
9973
10184
  selected_subnet: selectedSubnetFirstOctet ? "".concat(selectedSubnetFirstOctet, ".X.X.X") : null
9974
10185
  }));
9975
10186
  case 2:
9976
10187
  case "end":
9977
- return _context44.stop();
10188
+ return _context45.stop();
9978
10189
  }
9979
- }, _callee44, this);
10190
+ }, _callee45, this);
9980
10191
  }));
9981
10192
  function getMediaReachabilityMetricFields() {
9982
10193
  return _getMediaReachabilityMetricFields.apply(this, arguments);
@@ -9993,17 +10204,17 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
9993
10204
  }, {
9994
10205
  key: "setStage",
9995
10206
  value: function setStage() {
9996
- var _ref45 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
9997
- _ref45$activeSpeakerP = _ref45.activeSpeakerProportion,
9998
- activeSpeakerProportion = _ref45$activeSpeakerP === void 0 ? 0.5 : _ref45$activeSpeakerP,
9999
- customBackground = _ref45.customBackground,
10000
- customLogo = _ref45.customLogo,
10001
- customNameLabel = _ref45.customNameLabel,
10002
- importantParticipants = _ref45.importantParticipants,
10003
- _ref45$lockAttendeeVi = _ref45.lockAttendeeViewOnStage,
10004
- lockAttendeeViewOnStage = _ref45$lockAttendeeVi === void 0 ? false : _ref45$lockAttendeeVi,
10005
- _ref45$showActiveSpea = _ref45.showActiveSpeaker,
10006
- showActiveSpeaker = _ref45$showActiveSpea === void 0 ? false : _ref45$showActiveSpea;
10207
+ var _ref44 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
10208
+ _ref44$activeSpeakerP = _ref44.activeSpeakerProportion,
10209
+ activeSpeakerProportion = _ref44$activeSpeakerP === void 0 ? 0.5 : _ref44$activeSpeakerP,
10210
+ customBackground = _ref44.customBackground,
10211
+ customLogo = _ref44.customLogo,
10212
+ customNameLabel = _ref44.customNameLabel,
10213
+ importantParticipants = _ref44.importantParticipants,
10214
+ _ref44$lockAttendeeVi = _ref44.lockAttendeeViewOnStage,
10215
+ lockAttendeeViewOnStage = _ref44$lockAttendeeVi === void 0 ? false : _ref44$lockAttendeeVi,
10216
+ _ref44$showActiveSpea = _ref44.showActiveSpeaker,
10217
+ showActiveSpeaker = _ref44$showActiveSpea === void 0 ? false : _ref44$showActiveSpea;
10007
10218
  var videoLayout = {
10008
10219
  overrideDefault: true,
10009
10220
  lockAttendeeViewOnStageOnly: lockAttendeeViewOnStage,
@@ -10107,41 +10318,41 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
10107
10318
  }, {
10108
10319
  key: "refreshDataChannelToken",
10109
10320
  value: (function () {
10110
- var _refreshDataChannelToken = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee45() {
10111
- var isPracticeSession, dataChannelTokenType, res, msg, _t35;
10112
- return _regenerator.default.wrap(function (_context45) {
10113
- while (1) switch (_context45.prev = _context45.next) {
10321
+ var _refreshDataChannelToken = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee46() {
10322
+ var isPracticeSession, dataChannelTokenType, res, msg, _t37;
10323
+ return _regenerator.default.wrap(function (_context46) {
10324
+ while (1) switch (_context46.prev = _context46.next) {
10114
10325
  case 0:
10115
10326
  isPracticeSession = this.webinar.isJoinPracticeSessionDataChannel();
10116
10327
  dataChannelTokenType = this.getDataChannelTokenType();
10117
- _context45.prev = 1;
10118
- _context45.next = 2;
10328
+ _context46.prev = 1;
10329
+ _context46.next = 2;
10119
10330
  return this.meetingRequest.fetchDatachannelToken({
10120
10331
  locusUrl: this.locusUrl,
10121
10332
  requestingParticipantId: this.members.selfId,
10122
10333
  isPracticeSession: isPracticeSession
10123
10334
  });
10124
10335
  case 2:
10125
- res = _context45.sent;
10126
- return _context45.abrupt("return", {
10336
+ res = _context46.sent;
10337
+ return _context46.abrupt("return", {
10127
10338
  body: {
10128
10339
  datachannelToken: res.body.datachannelToken,
10129
10340
  dataChannelTokenType: dataChannelTokenType
10130
10341
  }
10131
10342
  });
10132
10343
  case 3:
10133
- _context45.prev = 3;
10134
- _t35 = _context45["catch"](1);
10135
- msg = (_t35 === null || _t35 === void 0 ? void 0 : _t35.message) || String(_t35);
10344
+ _context46.prev = 3;
10345
+ _t37 = _context46["catch"](1);
10346
+ msg = (_t37 === null || _t37 === void 0 ? void 0 : _t37.message) || String(_t37);
10136
10347
  _loggerProxy.default.logger.warn("Meeting:index#refreshDataChannelToken --> DataChannel token refresh failed (likely locus changed or participant left): ".concat(msg), {
10137
- statusCode: _t35 === null || _t35 === void 0 ? void 0 : _t35.statusCode
10348
+ statusCode: _t37 === null || _t37 === void 0 ? void 0 : _t37.statusCode
10138
10349
  });
10139
- return _context45.abrupt("return", null);
10350
+ return _context46.abrupt("return", null);
10140
10351
  case 4:
10141
10352
  case "end":
10142
- return _context45.stop();
10353
+ return _context46.stop();
10143
10354
  }
10144
- }, _callee45, this, [[1, 3]]);
10355
+ }, _callee46, this, [[1, 3]]);
10145
10356
  }));
10146
10357
  function refreshDataChannelToken() {
10147
10358
  return _refreshDataChannelToken.apply(this, arguments);