@webex/plugin-meetings 3.7.0-next.9 → 3.7.0-wxcc.1

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 (124) hide show
  1. package/dist/annotation/index.js +17 -0
  2. package/dist/annotation/index.js.map +1 -1
  3. package/dist/breakouts/breakout.js +1 -1
  4. package/dist/breakouts/index.js +1 -1
  5. package/dist/common/errors/join-forbidden-error.js +52 -0
  6. package/dist/common/errors/join-forbidden-error.js.map +1 -0
  7. package/dist/common/errors/{webinar-registration-error.js → join-webinar-error.js} +12 -12
  8. package/dist/common/errors/join-webinar-error.js.map +1 -0
  9. package/dist/common/errors/multistream-not-supported-error.js +53 -0
  10. package/dist/common/errors/multistream-not-supported-error.js.map +1 -0
  11. package/dist/config.js +1 -1
  12. package/dist/config.js.map +1 -1
  13. package/dist/constants.js +46 -5
  14. package/dist/constants.js.map +1 -1
  15. package/dist/index.js +16 -11
  16. package/dist/index.js.map +1 -1
  17. package/dist/interpretation/index.js +1 -1
  18. package/dist/interpretation/siLanguage.js +1 -1
  19. package/dist/locus-info/index.js +14 -3
  20. package/dist/locus-info/index.js.map +1 -1
  21. package/dist/locus-info/selfUtils.js +30 -17
  22. package/dist/locus-info/selfUtils.js.map +1 -1
  23. package/dist/meeting/in-meeting-actions.js +2 -0
  24. package/dist/meeting/in-meeting-actions.js.map +1 -1
  25. package/dist/meeting/index.js +960 -832
  26. package/dist/meeting/index.js.map +1 -1
  27. package/dist/meeting/locusMediaRequest.js +9 -0
  28. package/dist/meeting/locusMediaRequest.js.map +1 -1
  29. package/dist/meeting/request.js +30 -0
  30. package/dist/meeting/request.js.map +1 -1
  31. package/dist/meeting/request.type.js.map +1 -1
  32. package/dist/meeting/util.js +16 -16
  33. package/dist/meeting/util.js.map +1 -1
  34. package/dist/meeting-info/meeting-info-v2.js +96 -33
  35. package/dist/meeting-info/meeting-info-v2.js.map +1 -1
  36. package/dist/meeting-info/utilv2.js +1 -1
  37. package/dist/meeting-info/utilv2.js.map +1 -1
  38. package/dist/meetings/index.js +103 -54
  39. package/dist/meetings/index.js.map +1 -1
  40. package/dist/meetings/meetings.types.js +2 -0
  41. package/dist/meetings/meetings.types.js.map +1 -1
  42. package/dist/meetings/util.js +1 -1
  43. package/dist/meetings/util.js.map +1 -1
  44. package/dist/member/index.js +9 -0
  45. package/dist/member/index.js.map +1 -1
  46. package/dist/member/types.js.map +1 -1
  47. package/dist/member/util.js +39 -28
  48. package/dist/member/util.js.map +1 -1
  49. package/dist/metrics/constants.js +3 -2
  50. package/dist/metrics/constants.js.map +1 -1
  51. package/dist/multistream/remoteMedia.js +30 -15
  52. package/dist/multistream/remoteMedia.js.map +1 -1
  53. package/dist/multistream/sendSlotManager.js +24 -0
  54. package/dist/multistream/sendSlotManager.js.map +1 -1
  55. package/dist/roap/index.js +10 -8
  56. package/dist/roap/index.js.map +1 -1
  57. package/dist/types/annotation/index.d.ts +5 -0
  58. package/dist/types/common/errors/join-forbidden-error.d.ts +15 -0
  59. package/dist/types/common/errors/{webinar-registration-error.d.ts → join-webinar-error.d.ts} +2 -2
  60. package/dist/types/common/errors/multistream-not-supported-error.d.ts +17 -0
  61. package/dist/types/constants.d.ts +38 -1
  62. package/dist/types/index.d.ts +3 -3
  63. package/dist/types/locus-info/index.d.ts +2 -1
  64. package/dist/types/meeting/in-meeting-actions.d.ts +2 -0
  65. package/dist/types/meeting/index.d.ts +19 -12
  66. package/dist/types/meeting/locusMediaRequest.d.ts +4 -0
  67. package/dist/types/meeting/request.d.ts +12 -1
  68. package/dist/types/meeting/request.type.d.ts +6 -0
  69. package/dist/types/meeting/util.d.ts +1 -1
  70. package/dist/types/meeting-info/meeting-info-v2.d.ts +27 -4
  71. package/dist/types/meetings/index.d.ts +16 -1
  72. package/dist/types/meetings/meetings.types.d.ts +8 -0
  73. package/dist/types/member/index.d.ts +1 -0
  74. package/dist/types/member/types.d.ts +7 -0
  75. package/dist/types/metrics/constants.d.ts +2 -1
  76. package/dist/types/multistream/sendSlotManager.d.ts +8 -1
  77. package/dist/webinar/index.js +354 -3
  78. package/dist/webinar/index.js.map +1 -1
  79. package/package.json +23 -22
  80. package/src/annotation/index.ts +16 -0
  81. package/src/common/errors/join-forbidden-error.ts +26 -0
  82. package/src/common/errors/join-webinar-error.ts +24 -0
  83. package/src/common/errors/multistream-not-supported-error.ts +30 -0
  84. package/src/config.ts +1 -1
  85. package/src/constants.ts +43 -3
  86. package/src/index.ts +5 -3
  87. package/src/locus-info/index.ts +20 -3
  88. package/src/locus-info/selfUtils.ts +19 -6
  89. package/src/meeting/in-meeting-actions.ts +4 -0
  90. package/src/meeting/index.ts +259 -80
  91. package/src/meeting/locusMediaRequest.ts +7 -0
  92. package/src/meeting/request.ts +26 -1
  93. package/src/meeting/request.type.ts +7 -0
  94. package/src/meeting/util.ts +8 -10
  95. package/src/meeting-info/meeting-info-v2.ts +74 -11
  96. package/src/meeting-info/utilv2.ts +3 -1
  97. package/src/meetings/index.ts +73 -20
  98. package/src/meetings/meetings.types.ts +10 -0
  99. package/src/meetings/util.ts +2 -1
  100. package/src/member/index.ts +9 -0
  101. package/src/member/types.ts +8 -0
  102. package/src/member/util.ts +34 -24
  103. package/src/metrics/constants.ts +2 -1
  104. package/src/multistream/remoteMedia.ts +28 -15
  105. package/src/multistream/sendSlotManager.ts +31 -0
  106. package/src/roap/index.ts +10 -8
  107. package/src/webinar/index.ts +197 -3
  108. package/test/unit/spec/annotation/index.ts +46 -1
  109. package/test/unit/spec/locus-info/index.js +292 -60
  110. package/test/unit/spec/locus-info/selfConstant.js +7 -0
  111. package/test/unit/spec/locus-info/selfUtils.js +91 -1
  112. package/test/unit/spec/meeting/in-meeting-actions.ts +2 -0
  113. package/test/unit/spec/meeting/index.js +722 -105
  114. package/test/unit/spec/meeting/utils.js +22 -19
  115. package/test/unit/spec/meeting-info/meetinginfov2.js +46 -4
  116. package/test/unit/spec/meeting-info/utilv2.js +17 -0
  117. package/test/unit/spec/meetings/index.js +150 -13
  118. package/test/unit/spec/meetings/utils.js +10 -0
  119. package/test/unit/spec/member/util.js +52 -11
  120. package/test/unit/spec/multistream/remoteMedia.ts +11 -7
  121. package/test/unit/spec/roap/index.ts +47 -0
  122. package/test/unit/spec/webinar/index.ts +457 -0
  123. package/dist/common/errors/webinar-registration-error.js.map +0 -1
  124. package/src/common/errors/webinar-registration-error.ts +0 -27
@@ -18,10 +18,10 @@ _Object$defineProperty(exports, "__esModule", {
18
18
  exports.default = exports.ScreenShareFloorStatus = exports.MEDIA_UPDATE_TYPE = void 0;
19
19
  var _regenerator = _interopRequireDefault(require("@babel/runtime-corejs2/regenerator"));
20
20
  var _stringify = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/json/stringify"));
21
+ var _values = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/object/values"));
21
22
  var _promise = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/promise"));
22
23
  var _map = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/map"));
23
24
  var _keys = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/object/keys"));
24
- var _values = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/object/values"));
25
25
  var _weakMap = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/weak-map"));
26
26
  var _typeof2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/typeof"));
27
27
  var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/asyncToGenerator"));
@@ -87,7 +87,9 @@ var _controlsOptionsManager = _interopRequireDefault(require("../controls-option
87
87
  var _permission = _interopRequireDefault(require("../common/errors/permission"));
88
88
  var _locusMediaRequest = require("./locusMediaRequest");
89
89
  var _connectionStateHandler = require("./connectionStateHandler");
90
- var _webinarRegistrationError = _interopRequireDefault(require("../common/errors/webinar-registration-error"));
90
+ var _joinWebinarError = _interopRequireDefault(require("../common/errors/join-webinar-error"));
91
+ var _multistreamNotSupportedError = _interopRequireDefault(require("../common/errors/multistream-not-supported-error"));
92
+ var _joinForbiddenError = _interopRequireDefault(require("../common/errors/join-forbidden-error"));
91
93
  function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof _Symbol !== "undefined" && o[_Symbol$iterator] || o["@@iterator"]; if (!it) { if (_Array$isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
92
94
  function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return _Array$from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
93
95
  function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
@@ -567,8 +569,13 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
567
569
  if (
568
570
  // @ts-ignore - config coming from registerPlugin
569
571
  (_this.config.receiveReactions || options.receiveReactions) && _this.isReactionsSupported()) {
570
- var _this$members$members = _this.members.membersCollection.get(e.data.sender.participantId),
571
- name = _this$members$members.name;
572
+ var member = _this.members.membersCollection.get(e.data.sender.participantId);
573
+ if (!member) {
574
+ // @ts-ignore -- fix type
575
+ _loggerProxy.default.logger.warn("Meeting:index#processRelayEvent --> Skipping handling of ".concat(_constants3.REACTION_RELAY_TYPES.REACTION, " for ").concat(_this.id, ". participantId ").concat(e.data.sender.participantId, " does not exist in membersCollection."));
576
+ break;
577
+ }
578
+ var name = member.name;
572
579
  var processedReaction = {
573
580
  reaction: e.data.reaction,
574
581
  sender: {
@@ -675,6 +682,9 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
675
682
  */
676
683
  (0, _defineProperty3.default)((0, _assertThisInitialized2.default)(_this), "roapMessageReceived", function (roapMessage) {
677
684
  var mediaServer = _util3.default.getMediaServer(roapMessage.sdp);
685
+ if (_this.isMultistream && mediaServer !== 'homer') {
686
+ throw new _multistreamNotSupportedError.default("Client asked for multistream backend (Homer), but got ".concat(mediaServer, " instead"));
687
+ }
678
688
  _this.mediaProperties.webrtcMediaConnection.roapMessageReceived(roapMessage);
679
689
  if (mediaServer) {
680
690
  _this.mediaProperties.webrtcMediaConnection.mediaServer = mediaServer;
@@ -769,15 +779,17 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
769
779
  }), {
770
780
  logText: "".concat(LOG_HEADER, " Roap Offer")
771
781
  }).catch(function (error) {
782
+ var multistreamNotSupported = error instanceof _multistreamNotSupportedError.default;
783
+
772
784
  // @ts-ignore
773
785
  _this.webex.internal.newMetrics.submitClientEvent({
774
786
  name: 'client.media-engine.remote-sdp-received',
775
787
  payload: {
776
- canProceed: false,
788
+ canProceed: multistreamNotSupported,
777
789
  errors: [
778
790
  // @ts-ignore
779
791
  _this.webex.internal.newMetrics.callDiagnosticMetrics.getErrorPayloadForClientErrorCode({
780
- clientErrorCode: _internalPluginMetrics.CALL_DIAGNOSTIC_CONFIG.MISSING_ROAP_ANSWER_CLIENT_CODE
792
+ clientErrorCode: multistreamNotSupported ? _internalPluginMetrics.CALL_DIAGNOSTIC_CONFIG.MULTISTREAM_NOT_AVAILABLE_CLIENT_CODE : _internalPluginMetrics.CALL_DIAGNOSTIC_CONFIG.MISSING_ROAP_ANSWER_CLIENT_CODE
781
793
  })]
782
794
  },
783
795
  options: {
@@ -785,7 +797,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
785
797
  rawError: error
786
798
  }
787
799
  });
788
- _this.deferSDPAnswer.reject(new Error('failed to send ROAP SDP offer'));
800
+ _this.deferSDPAnswer.reject(error);
789
801
  clearTimeout(_this.sdpResponseTimer);
790
802
  _this.sdpResponseTimer = undefined;
791
803
  });
@@ -1027,6 +1039,13 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
1027
1039
  options.data.intervalMetadata.peerReflexiveIP =
1028
1040
  // @ts-ignore
1029
1041
  ((_this$webex$meetings$ = _this.webex.meetings.geoHintInfo) === null || _this$webex$meetings$ === void 0 ? void 0 : _this$webex$meetings$.clientAddress) || options.data.intervalMetadata.peerReflexiveIP || _constants.MQA_STATS.DEFAULT_IP;
1042
+ var members = _this.getMembers().membersCollection.members;
1043
+
1044
+ // Count members that are in the meeting
1045
+ options.data.intervalMetadata.meetingUserCount = (0, _values.default)(members).filter(function (member) {
1046
+ return member.isInMeeting;
1047
+ }).length;
1048
+
1030
1049
  // @ts-ignore
1031
1050
  _this.webex.internal.newMetrics.submitMQE({
1032
1051
  name: 'client.mediaquality.event',
@@ -1260,12 +1279,18 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
1260
1279
  * @returns {undefined}
1261
1280
  */
1262
1281
  (0, _defineProperty3.default)((0, _assertThisInitialized2.default)(_this), "handleShareVideoStreamMuteStateChange", function (muted) {
1263
- var _this$statsAnalyzer;
1282
+ var _this$statsAnalyzer, _this$mediaProperties3, _this$mediaProperties4;
1264
1283
  _loggerProxy.default.logger.log("Meeting:index#handleShareVideoStreamMuteStateChange --> Share video stream mute state changed to muted ".concat(muted));
1265
1284
  _metrics.default.sendBehavioralMetric(_constants2.default.MEETING_SHARE_VIDEO_MUTE_STATE_CHANGE, {
1266
1285
  correlationId: _this.correlationId,
1267
1286
  muted: muted,
1268
- encoderImplementation: (_this$statsAnalyzer = _this.statsAnalyzer) === null || _this$statsAnalyzer === void 0 ? void 0 : _this$statsAnalyzer.shareVideoEncoderImplementation
1287
+ encoderImplementation: (_this$statsAnalyzer = _this.statsAnalyzer) === null || _this$statsAnalyzer === void 0 ? void 0 : _this$statsAnalyzer.shareVideoEncoderImplementation,
1288
+ // TypeScript 4 does not recognize the `displaySurface` property. Instead of upgrading the
1289
+ // SDK to TypeScript 5, which may affect other packages, use bracket notation for now, since
1290
+ // all we're doing here is adding metrics.
1291
+ // eslint-disable-next-line dot-notation
1292
+ displaySurface: (_this$mediaProperties3 = _this.mediaProperties) === null || _this$mediaProperties3 === void 0 ? void 0 : (_this$mediaProperties4 = _this$mediaProperties3.shareVideoStream) === null || _this$mediaProperties4 === void 0 ? void 0 : _this$mediaProperties4.getSettings()['displaySurface'],
1293
+ isMultistream: _this.isMultistream
1269
1294
  });
1270
1295
  });
1271
1296
  /**
@@ -1344,6 +1369,10 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
1344
1369
  _this.stopTranscription();
1345
1370
  _this.transcription = undefined;
1346
1371
  }
1372
+ _this.annotation.deregisterEvents();
1373
+
1374
+ // @ts-ignore - fix types
1375
+ _this.webex.internal.llm.off('event:relay.event', _this.processRelayEvent);
1347
1376
  });
1348
1377
  /**
1349
1378
  * starts keepAlives being sent
@@ -1369,10 +1398,10 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
1369
1398
  _loggerProxy.default.logger.warn('Meeting:index#startKeepAlive --> keepAlive not started: keepAliveSecs <= 1');
1370
1399
  return;
1371
1400
  }
1372
- var keepAliveUrl = _this.joinedWith.keepAliveUrl;
1373
1401
  var keepAliveInterval = (_this.joinedWith.keepAliveSecs - 1) * 750; // taken from UCF
1374
1402
 
1375
1403
  _this.keepAliveTimerId = setInterval(function () {
1404
+ var keepAliveUrl = _this.joinedWith.keepAliveUrl;
1376
1405
  _this.meetingRequest.keepAlive({
1377
1406
  keepAliveUrl: keepAliveUrl
1378
1407
  }).catch(function (error) {
@@ -1520,15 +1549,17 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
1520
1549
  * @memberof Meeting
1521
1550
  */
1522
1551
  // @ts-ignore
1523
- _this.webinar = new _webinar.default({}, {
1552
+ _this.webinar = new _webinar.default({
1553
+ meetingId: _this.id
1554
+ }, {
1524
1555
  parent: _this.webex
1525
1556
  });
1526
1557
  /**
1527
1558
  * helper class for managing receive slots (for multistream media connections)
1528
1559
  */
1529
1560
  _this.receiveSlotManager = new _receiveSlotManager.ReceiveSlotManager(function (mediaType) {
1530
- var _this$mediaProperties3;
1531
- if (!((_this$mediaProperties3 = _this.mediaProperties) !== null && _this$mediaProperties3 !== void 0 && _this$mediaProperties3.webrtcMediaConnection)) {
1561
+ var _this$mediaProperties5;
1562
+ if (!((_this$mediaProperties5 = _this.mediaProperties) !== null && _this$mediaProperties5 !== void 0 && _this$mediaProperties5.webrtcMediaConnection)) {
1532
1563
  return _promise.default.reject(new Error('Webrtc media connection is missing'));
1533
1564
  }
1534
1565
  return _this.mediaProperties.webrtcMediaConnection.createReceiveSlot(mediaType);
@@ -2427,19 +2458,40 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
2427
2458
  }
2428
2459
  throw new _permission.default();
2429
2460
  case 21:
2430
- if (!(_context5.t0 instanceof _meetingInfoV.MeetingInfoV2WebinarRegistrationError)) {
2431
- _context5.next = 28;
2461
+ if (!(_context5.t0 instanceof _meetingInfoV.MeetingInfoV2JoinWebinarError)) {
2462
+ _context5.next = 29;
2432
2463
  break;
2433
2464
  }
2434
2465
  this.meetingInfoFailureReason = _constants.MEETING_INFO_FAILURE_REASON.WEBINAR_REGISTRATION;
2466
+ if (_constants.WEBINAR_ERROR_WEBCAST.includes(_context5.t0.wbxAppApiCode)) {
2467
+ this.meetingInfoFailureReason = _constants.MEETING_INFO_FAILURE_REASON.NEED_JOIN_WITH_WEBCAST;
2468
+ } else if (_constants.WEBINAR_ERROR_REGISTRATIONID.includes(_context5.t0.wbxAppApiCode)) {
2469
+ this.meetingInfoFailureReason = _constants.MEETING_INFO_FAILURE_REASON.WEBINAR_NEED_REGISTRATIONID;
2470
+ }
2435
2471
  this.meetingInfoFailureCode = _context5.t0.wbxAppApiCode;
2436
2472
  if (_context5.t0.meetingInfo) {
2437
2473
  this.meetingInfo = _context5.t0.meetingInfo;
2438
2474
  }
2439
- throw new _webinarRegistrationError.default();
2440
- case 28:
2475
+ throw new _joinWebinarError.default();
2476
+ case 29:
2477
+ if (!(_context5.t0 instanceof _meetingInfoV.MeetingInfoV2JoinForbiddenError)) {
2478
+ _context5.next = 37;
2479
+ break;
2480
+ }
2481
+ this.meetingInfoFailureReason = _constants.MEETING_INFO_FAILURE_REASON.JOIN_FORBIDDEN;
2482
+ this.meetingInfoFailureCode = _context5.t0.wbxAppApiCode;
2483
+ if (_context5.t0.meetingInfo) {
2484
+ this.meetingInfo = _context5.t0.meetingInfo;
2485
+ }
2486
+
2487
+ // Handle the case where user hasn't reached Join Before Host (JBH) time (error code 403003)
2488
+ if (_constants.JOIN_BEFORE_HOST === _context5.t0.wbxAppApiCode) {
2489
+ this.meetingInfoFailureReason = _constants.MEETING_INFO_FAILURE_REASON.NOT_REACH_JBH;
2490
+ }
2491
+ throw new _joinForbiddenError.default(this.meetingInfoFailureReason, _context5.t0);
2492
+ case 37:
2441
2493
  if (!(_context5.t0 instanceof _meetingInfoV.MeetingInfoV2PasswordError)) {
2442
- _context5.next = 40;
2494
+ _context5.next = 49;
2443
2495
  break;
2444
2496
  }
2445
2497
  _loggerProxy.default.logger.info( // @ts-ignore
@@ -2454,16 +2506,16 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
2454
2506
  this.passwordStatus = _constants.PASSWORD_STATUS.REQUIRED;
2455
2507
  this.meetingInfoFailureReason = _constants.MEETING_INFO_FAILURE_REASON.WRONG_PASSWORD;
2456
2508
  if (!this.requiredCaptcha) {
2457
- _context5.next = 37;
2509
+ _context5.next = 46;
2458
2510
  break;
2459
2511
  }
2460
- _context5.next = 37;
2512
+ _context5.next = 46;
2461
2513
  return this.refreshCaptcha();
2462
- case 37:
2514
+ case 46:
2463
2515
  throw new _passwordError.default();
2464
- case 40:
2516
+ case 49:
2465
2517
  if (!(_context5.t0 instanceof _meetingInfoV.MeetingInfoV2CaptchaError)) {
2466
- _context5.next = 49;
2518
+ _context5.next = 58;
2467
2519
  break;
2468
2520
  }
2469
2521
  _loggerProxy.default.logger.info( // @ts-ignore
@@ -2475,10 +2527,10 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
2475
2527
  }
2476
2528
  this.requiredCaptcha = _context5.t0.captchaInfo;
2477
2529
  throw new _captchaError.default();
2478
- case 49:
2530
+ case 58:
2479
2531
  this.meetingInfoFailureReason = _constants.MEETING_INFO_FAILURE_REASON.OTHER;
2480
2532
  throw _context5.t0;
2481
- case 51:
2533
+ case 60:
2482
2534
  case "end":
2483
2535
  return _context5.stop();
2484
2536
  }
@@ -3311,7 +3363,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
3311
3363
  this.locusInfo.on(_constants.EVENTS.LOCUS_INFO_UPDATE_MEDIA_SHARES, /*#__PURE__*/function () {
3312
3364
  var _ref27 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee8(payload) {
3313
3365
  var _payload$previous, _payload$previous2;
3314
- var _payload$current, contentShare, whiteboardShare, previousContentShare, previousWhiteboardShare, newShareStatus, oldShareStatus, sendStartedSharingRemote, _this14$mediaProperti;
3366
+ var _payload$current, contentShare, whiteboardShare, previousContentShare, previousWhiteboardShare, newShareStatus, _this14$locusInfo, _this14$locusInfo$inf, _this14$webinar, oldShareStatus, sendStartedSharingRemote, _this14$mediaProperti;
3315
3367
  return _regenerator.default.wrap(function _callee8$(_context8) {
3316
3368
  while (1) switch (_context8.prev = _context8.next) {
3317
3369
  case 0:
@@ -3319,7 +3371,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
3319
3371
  previousContentShare = (_payload$previous = payload.previous) === null || _payload$previous === void 0 ? void 0 : _payload$previous.content;
3320
3372
  previousWhiteboardShare = (_payload$previous2 = payload.previous) === null || _payload$previous2 === void 0 ? void 0 : _payload$previous2.whiteboard;
3321
3373
  _this14.triggerAnnotationInfoEvent(contentShare, previousContentShare);
3322
- if (!(contentShare.beneficiaryId === (previousContentShare === null || previousContentShare === void 0 ? void 0 : previousContentShare.beneficiaryId) && contentShare.disposition === (previousContentShare === null || previousContentShare === void 0 ? void 0 : previousContentShare.disposition) && contentShare.deviceUrlSharing === previousContentShare.deviceUrlSharing && whiteboardShare.beneficiaryId === (previousWhiteboardShare === null || previousWhiteboardShare === void 0 ? void 0 : previousWhiteboardShare.beneficiaryId) && whiteboardShare.disposition === (previousWhiteboardShare === null || previousWhiteboardShare === void 0 ? void 0 : previousWhiteboardShare.disposition) && whiteboardShare.resourceUrl === (previousWhiteboardShare === null || previousWhiteboardShare === void 0 ? void 0 : previousWhiteboardShare.resourceUrl) && contentShare.resourceType === (previousContentShare === null || previousContentShare === void 0 ? void 0 : previousContentShare.resourceType))) {
3374
+ if (!(!payload.forceUpdate && contentShare.beneficiaryId === (previousContentShare === null || previousContentShare === void 0 ? void 0 : previousContentShare.beneficiaryId) && contentShare.disposition === (previousContentShare === null || previousContentShare === void 0 ? void 0 : previousContentShare.disposition) && contentShare.deviceUrlSharing === previousContentShare.deviceUrlSharing && whiteboardShare.beneficiaryId === (previousWhiteboardShare === null || previousWhiteboardShare === void 0 ? void 0 : previousWhiteboardShare.beneficiaryId) && whiteboardShare.disposition === (previousWhiteboardShare === null || previousWhiteboardShare === void 0 ? void 0 : previousWhiteboardShare.disposition) && whiteboardShare.resourceUrl === (previousWhiteboardShare === null || previousWhiteboardShare === void 0 ? void 0 : previousWhiteboardShare.resourceUrl) && contentShare.resourceType === (previousContentShare === null || previousContentShare === void 0 ? void 0 : previousContentShare.resourceType))) {
3323
3375
  _context8.next = 6;
3324
3376
  break;
3325
3377
  }
@@ -3345,7 +3397,8 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
3345
3397
  // It does not matter who requested to share the whiteboard, everyone gets the same view
3346
3398
  else if (whiteboardShare.disposition === _constants.FLOOR_ACTION.GRANTED) {
3347
3399
  // WHITEBOARD - sharing whiteboard
3348
- newShareStatus = _constants.SHARE_STATUS.WHITEBOARD_SHARE_ACTIVE;
3400
+ // Webinar attendee should receive whiteboard as remote share
3401
+ newShareStatus = (_this14$locusInfo = _this14.locusInfo) !== null && _this14$locusInfo !== void 0 && (_this14$locusInfo$inf = _this14$locusInfo.info) !== null && _this14$locusInfo$inf !== void 0 && _this14$locusInfo$inf.isWebinar && (_this14$webinar = _this14.webinar) !== null && _this14$webinar !== void 0 && _this14$webinar.selfIsAttendee ? _constants.SHARE_STATUS.REMOTE_SHARE_ACTIVE : _constants.SHARE_STATUS.WHITEBOARD_SHARE_ACTIVE;
3349
3402
  }
3350
3403
  // or if content share is either released or null and whiteboard share is either released or null, no one is sharing
3351
3404
  else if ((previousContentShare && contentShare.disposition === _constants.FLOOR_ACTION.RELEASED || contentShare.disposition === null) && (previousWhiteboardShare && whiteboardShare.disposition === _constants.FLOOR_ACTION.RELEASED || whiteboardShare.disposition === null)) {
@@ -3579,7 +3632,15 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
3579
3632
  value: function setUpLocusResourcesListener() {
3580
3633
  var _this17 = this;
3581
3634
  this.locusInfo.on(_constants.LOCUSINFO.EVENTS.LINKS_RESOURCES, function (payload) {
3582
- _this17.webinar.updateWebcastUrl(payload);
3635
+ if (payload) {
3636
+ _this17.webinar.updateWebcastUrl(payload);
3637
+ _triggerProxy.default.trigger(_this17, {
3638
+ file: 'meeting/index',
3639
+ function: 'setUpLocusInfoMeetingInfoListener'
3640
+ }, _constants.EVENT_TRIGGERS.MEETING_RESOURCE_LINKS_UPDATE, {
3641
+ payload: payload
3642
+ });
3643
+ }
3583
3644
  });
3584
3645
  }
3585
3646
 
@@ -3845,6 +3906,14 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
3845
3906
  _this20.setSendNamedMediaGroup(_internalMediaCore.MediaType.AudioMain);
3846
3907
  }
3847
3908
  });
3909
+ this.locusInfo.on(_constants.LOCUSINFO.EVENTS.SELF_MEETING_BRB_CHANGED, function (payload) {
3910
+ _triggerProxy.default.trigger(_this20, {
3911
+ file: 'meeting/index',
3912
+ function: 'setUpLocusInfoSelfListener'
3913
+ }, _constants.EVENT_TRIGGERS.MEETING_SELF_BRB_UPDATE, {
3914
+ payload: payload
3915
+ });
3916
+ });
3848
3917
  this.locusInfo.on(_constants.LOCUSINFO.EVENTS.SELF_ROLES_CHANGED, function (payload) {
3849
3918
  var _payload$newRoles, _payload$newRoles2, _payload$newRoles3;
3850
3919
  var isModeratorOrCohost = ((_payload$newRoles = payload.newRoles) === null || _payload$newRoles === void 0 ? void 0 : _payload$newRoles.includes(_constants.SELF_ROLES.MODERATOR)) || ((_payload$newRoles2 = payload.newRoles) === null || _payload$newRoles2 === void 0 ? void 0 : _payload$newRoles2.includes(_constants.SELF_ROLES.COHOST));
@@ -4043,6 +4112,62 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
4043
4112
  return this.members.admitMembers(memberIds, locusUrls);
4044
4113
  }
4045
4114
 
4115
+ /**
4116
+ * Manages be right back status updates for the current participant.
4117
+ *
4118
+ * @param {boolean} enabled - Indicates whether the user enabled brb or not.
4119
+ * @returns {Promise<void>} resolves when the brb status is updated or does nothing if not in a multistream meeting.
4120
+ * @throws {Error} - Throws an error if the request fails.
4121
+ */
4122
+ }, {
4123
+ key: "beRightBack",
4124
+ value: (function () {
4125
+ var _beRightBack = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee11(enabled) {
4126
+ var _this23 = this;
4127
+ var errorMessage, error, _errorMessage, _error;
4128
+ return _regenerator.default.wrap(function _callee11$(_context11) {
4129
+ while (1) switch (_context11.prev = _context11.next) {
4130
+ case 0:
4131
+ if (this.isMultistream) {
4132
+ _context11.next = 5;
4133
+ break;
4134
+ }
4135
+ errorMessage = 'Meeting:index#beRightBack --> Not a multistream meeting';
4136
+ error = new Error(errorMessage);
4137
+ _loggerProxy.default.logger.error(error);
4138
+ return _context11.abrupt("return", _promise.default.reject(error));
4139
+ case 5:
4140
+ if (this.mediaProperties.webrtcMediaConnection) {
4141
+ _context11.next = 10;
4142
+ break;
4143
+ }
4144
+ _errorMessage = 'Meeting:index#beRightBack --> WebRTC media connection is not defined';
4145
+ _error = new Error(_errorMessage);
4146
+ _loggerProxy.default.logger.error(_error);
4147
+ return _context11.abrupt("return", _promise.default.reject(_error));
4148
+ case 10:
4149
+ return _context11.abrupt("return", this.meetingRequest.setBrb({
4150
+ enabled: enabled,
4151
+ locusUrl: this.locusUrl,
4152
+ deviceUrl: this.deviceUrl,
4153
+ selfId: this.selfId
4154
+ }).then(function () {
4155
+ _this23.sendSlotManager.setSourceStateOverride(_internalMediaCore.MediaType.VideoMain, enabled ? 'away' : null);
4156
+ }).catch(function (error) {
4157
+ _loggerProxy.default.logger.error('Meeting:index#beRightBack --> Error ', error);
4158
+ return _promise.default.reject(error);
4159
+ }));
4160
+ case 11:
4161
+ case "end":
4162
+ return _context11.stop();
4163
+ }
4164
+ }, _callee11, this);
4165
+ }));
4166
+ function beRightBack(_x11) {
4167
+ return _beRightBack.apply(this, arguments);
4168
+ }
4169
+ return beRightBack;
4170
+ }()
4046
4171
  /**
4047
4172
  * Remove the member from the meeting, boot them
4048
4173
  * @param {String} memberId
@@ -4050,6 +4175,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
4050
4175
  * @public
4051
4176
  * @memberof Meeting
4052
4177
  */
4178
+ )
4053
4179
  }, {
4054
4180
  key: "remove",
4055
4181
  value: function remove(memberId) {
@@ -4247,6 +4373,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
4247
4373
  waitingForOthersToJoin: _util2.default.waitingForOthersToJoin(this.userDisplayHints),
4248
4374
  canSendReactions: _util2.default.canSendReactions(this.inMeetingActions.canSendReactions, this.userDisplayHints),
4249
4375
  canManageBreakout: _util2.default.canManageBreakout(this.userDisplayHints),
4376
+ canStartBreakout: _util2.default.canStartBreakout(this.userDisplayHints),
4250
4377
  canBroadcastMessageToBreakout: _util2.default.canBroadcastMessageToBreakout(this.userDisplayHints, this.selfUserPolicies),
4251
4378
  canAdmitLobbyToBreakout: _util2.default.canAdmitLobbyToBreakout(this.userDisplayHints),
4252
4379
  isBreakoutPreassignmentsEnabled: _util2.default.isBreakoutPreassignmentsEnabled(this.userDisplayHints),
@@ -4524,25 +4651,26 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
4524
4651
  }, {
4525
4652
  key: "setLogUploadTimer",
4526
4653
  value: function setLogUploadTimer() {
4527
- var _this23 = this;
4654
+ var _this24 = this;
4528
4655
  // start with short timeouts and increase them later on so in case users have very long multi-hour meetings we don't get too fragmented logs
4529
- var LOG_UPLOAD_INTERVALS = [0.1, 1, 15, 15, 30, 30, 30, 60];
4530
- var delay = 1000 *
4656
+ var LOG_UPLOAD_INTERVALS = [0.1, 15, 30, 60]; // in minutes
4657
+
4658
+ var delay = 1000 * 60 *
4531
4659
  // @ts-ignore - config coming from registerPlugin
4532
4660
  this.config.logUploadIntervalMultiplicationFactor * LOG_UPLOAD_INTERVALS[this.logUploadIntervalIndex];
4533
4661
  if (this.logUploadIntervalIndex < LOG_UPLOAD_INTERVALS.length - 1) {
4534
4662
  this.logUploadIntervalIndex += 1;
4535
4663
  }
4536
4664
  this.uploadLogsTimer = (0, _commonTimers.safeSetTimeout)(function () {
4537
- _this23.uploadLogsTimer = undefined;
4538
- _this23.uploadLogs();
4665
+ _this24.uploadLogsTimer = undefined;
4666
+ _this24.uploadLogs();
4539
4667
 
4540
4668
  // just as an extra precaution, to avoid uploading logs forever in case something goes wrong
4541
4669
  // and the page remains opened, we stop it if there is no media connection
4542
- if (!_this23.mediaProperties.webrtcMediaConnection) {
4670
+ if (!_this24.mediaProperties.webrtcMediaConnection) {
4543
4671
  return;
4544
4672
  }
4545
- _this23.setLogUploadTimer();
4673
+ _this24.setLogUploadTimer();
4546
4674
  }, delay);
4547
4675
  }
4548
4676
 
@@ -4609,11 +4737,11 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
4609
4737
  }, {
4610
4738
  key: "closeRemoteStreams",
4611
4739
  value: function closeRemoteStreams() {
4612
- var _this24 = this;
4613
- var _this$mediaProperties4 = this.mediaProperties,
4614
- remoteAudioStream = _this$mediaProperties4.remoteAudioStream,
4615
- remoteVideoStream = _this$mediaProperties4.remoteVideoStream,
4616
- remoteShareStream = _this$mediaProperties4.remoteShareStream;
4740
+ var _this25 = this;
4741
+ var _this$mediaProperties6 = this.mediaProperties,
4742
+ remoteAudioStream = _this$mediaProperties6.remoteAudioStream,
4743
+ remoteVideoStream = _this$mediaProperties6.remoteVideoStream,
4744
+ remoteShareStream = _this$mediaProperties6.remoteShareStream;
4617
4745
 
4618
4746
  /**
4619
4747
  * Triggers an event to the developer
@@ -4623,7 +4751,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
4623
4751
  */
4624
4752
  // eslint-disable-next-line @typescript-eslint/no-shadow
4625
4753
  var triggerMediaStoppedEvent = function triggerMediaStoppedEvent(mediaType) {
4626
- _triggerProxy.default.trigger(_this24, {
4754
+ _triggerProxy.default.trigger(_this25, {
4627
4755
  file: 'meeting/index',
4628
4756
  function: 'closeRemoteStreams'
4629
4757
  }, _constants.EVENT_TRIGGERS.MEDIA_STOPPED, {
@@ -4657,11 +4785,11 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
4657
4785
  }, {
4658
4786
  key: "setLocalAudioStream",
4659
4787
  value: (function () {
4660
- var _setLocalAudioStream = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee11(localStream) {
4788
+ var _setLocalAudioStream = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee12(localStream) {
4661
4789
  var _this$audio2;
4662
4790
  var oldStream;
4663
- return _regenerator.default.wrap(function _callee11$(_context11) {
4664
- while (1) switch (_context11.prev = _context11.next) {
4791
+ return _regenerator.default.wrap(function _callee12$(_context12) {
4792
+ while (1) switch (_context12.prev = _context12.next) {
4665
4793
  case 0:
4666
4794
  oldStream = this.mediaProperties.audioStream;
4667
4795
  oldStream === null || oldStream === void 0 ? void 0 : oldStream.off(_mediaHelpers.LocalStreamEventNames.UserMuteStateChange, this.localAudioStreamMuteStateHandler);
@@ -4675,21 +4803,21 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
4675
4803
  localStream === null || localStream === void 0 ? void 0 : localStream.on(_mediaHelpers.LocalStreamEventNames.SystemMuteStateChange, this.localAudioStreamMuteStateHandler);
4676
4804
  localStream === null || localStream === void 0 ? void 0 : localStream.on(_mediaHelpers.LocalStreamEventNames.OutputTrackChange, this.localOutputTrackChangeHandler);
4677
4805
  if (!(!this.isMultistream || !localStream)) {
4678
- _context11.next = 12;
4806
+ _context12.next = 12;
4679
4807
  break;
4680
4808
  }
4681
- _context11.next = 12;
4809
+ _context12.next = 12;
4682
4810
  return this.unpublishStream(_internalMediaCore.MediaType.AudioMain, oldStream);
4683
4811
  case 12:
4684
- _context11.next = 14;
4812
+ _context12.next = 14;
4685
4813
  return this.publishStream(_internalMediaCore.MediaType.AudioMain, this.mediaProperties.audioStream);
4686
4814
  case 14:
4687
4815
  case "end":
4688
- return _context11.stop();
4816
+ return _context12.stop();
4689
4817
  }
4690
- }, _callee11, this);
4818
+ }, _callee12, this);
4691
4819
  }));
4692
- function setLocalAudioStream(_x11) {
4820
+ function setLocalAudioStream(_x12) {
4693
4821
  return _setLocalAudioStream.apply(this, arguments);
4694
4822
  }
4695
4823
  return setLocalAudioStream;
@@ -4705,11 +4833,11 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
4705
4833
  }, {
4706
4834
  key: "setLocalVideoStream",
4707
4835
  value: (function () {
4708
- var _setLocalVideoStream = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee12(localStream) {
4836
+ var _setLocalVideoStream = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee13(localStream) {
4709
4837
  var _this$video2;
4710
4838
  var oldStream;
4711
- return _regenerator.default.wrap(function _callee12$(_context12) {
4712
- while (1) switch (_context12.prev = _context12.next) {
4839
+ return _regenerator.default.wrap(function _callee13$(_context13) {
4840
+ while (1) switch (_context13.prev = _context13.next) {
4713
4841
  case 0:
4714
4842
  oldStream = this.mediaProperties.videoStream;
4715
4843
  oldStream === null || oldStream === void 0 ? void 0 : oldStream.off(_mediaHelpers.LocalStreamEventNames.UserMuteStateChange, this.localVideoStreamMuteStateHandler);
@@ -4723,21 +4851,21 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
4723
4851
  localStream === null || localStream === void 0 ? void 0 : localStream.on(_mediaHelpers.LocalStreamEventNames.SystemMuteStateChange, this.localVideoStreamMuteStateHandler);
4724
4852
  localStream === null || localStream === void 0 ? void 0 : localStream.on(_mediaHelpers.LocalStreamEventNames.OutputTrackChange, this.localOutputTrackChangeHandler);
4725
4853
  if (!(!this.isMultistream || !localStream)) {
4726
- _context12.next = 12;
4854
+ _context13.next = 12;
4727
4855
  break;
4728
4856
  }
4729
- _context12.next = 12;
4857
+ _context13.next = 12;
4730
4858
  return this.unpublishStream(_internalMediaCore.MediaType.VideoMain, oldStream);
4731
4859
  case 12:
4732
- _context12.next = 14;
4860
+ _context13.next = 14;
4733
4861
  return this.publishStream(_internalMediaCore.MediaType.VideoMain, this.mediaProperties.videoStream);
4734
4862
  case 14:
4735
4863
  case "end":
4736
- return _context12.stop();
4864
+ return _context13.stop();
4737
4865
  }
4738
- }, _callee12, this);
4866
+ }, _callee13, this);
4739
4867
  }));
4740
- function setLocalVideoStream(_x12) {
4868
+ function setLocalVideoStream(_x13) {
4741
4869
  return _setLocalVideoStream.apply(this, arguments);
4742
4870
  }
4743
4871
  return setLocalVideoStream;
@@ -4754,10 +4882,10 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
4754
4882
  }, {
4755
4883
  key: "setLocalShareVideoStream",
4756
4884
  value: (function () {
4757
- var _setLocalShareVideoStream = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee13(localDisplayStream) {
4885
+ var _setLocalShareVideoStream = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee14(localDisplayStream) {
4758
4886
  var oldStream;
4759
- return _regenerator.default.wrap(function _callee13$(_context13) {
4760
- while (1) switch (_context13.prev = _context13.next) {
4887
+ return _regenerator.default.wrap(function _callee14$(_context14) {
4888
+ while (1) switch (_context14.prev = _context14.next) {
4761
4889
  case 0:
4762
4890
  oldStream = this.mediaProperties.shareVideoStream;
4763
4891
  oldStream === null || oldStream === void 0 ? void 0 : oldStream.off(_mediaHelpers.LocalStreamEventNames.SystemMuteStateChange, this.handleShareVideoStreamMuteStateChange);
@@ -4769,21 +4897,21 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
4769
4897
  localDisplayStream === null || localDisplayStream === void 0 ? void 0 : localDisplayStream.on(_mediaHelpers.LocalStreamEventNames.OutputTrackChange, this.localOutputTrackChangeHandler);
4770
4898
  this.mediaProperties.mediaDirection.sendShare = this.mediaProperties.hasLocalShareStream();
4771
4899
  if (!(!this.isMultistream || !localDisplayStream)) {
4772
- _context13.next = 12;
4900
+ _context14.next = 12;
4773
4901
  break;
4774
4902
  }
4775
- _context13.next = 12;
4903
+ _context14.next = 12;
4776
4904
  return this.unpublishStream(_internalMediaCore.MediaType.VideoSlides, oldStream);
4777
4905
  case 12:
4778
- _context13.next = 14;
4906
+ _context14.next = 14;
4779
4907
  return this.publishStream(_internalMediaCore.MediaType.VideoSlides, this.mediaProperties.shareVideoStream);
4780
4908
  case 14:
4781
4909
  case "end":
4782
- return _context13.stop();
4910
+ return _context14.stop();
4783
4911
  }
4784
- }, _callee13, this);
4912
+ }, _callee14, this);
4785
4913
  }));
4786
- function setLocalShareVideoStream(_x13) {
4914
+ function setLocalShareVideoStream(_x14) {
4787
4915
  return _setLocalShareVideoStream.apply(this, arguments);
4788
4916
  }
4789
4917
  return setLocalShareVideoStream;
@@ -4799,10 +4927,10 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
4799
4927
  }, {
4800
4928
  key: "setLocalShareAudioStream",
4801
4929
  value: (function () {
4802
- var _setLocalShareAudioStream = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee14(localSystemAudioStream) {
4930
+ var _setLocalShareAudioStream = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee15(localSystemAudioStream) {
4803
4931
  var oldStream;
4804
- return _regenerator.default.wrap(function _callee14$(_context14) {
4805
- while (1) switch (_context14.prev = _context14.next) {
4932
+ return _regenerator.default.wrap(function _callee15$(_context15) {
4933
+ while (1) switch (_context15.prev = _context15.next) {
4806
4934
  case 0:
4807
4935
  oldStream = this.mediaProperties.shareAudioStream;
4808
4936
  oldStream === null || oldStream === void 0 ? void 0 : oldStream.off(_mediaHelpers.StreamEventNames.Ended, this.handleShareAudioStreamEnded);
@@ -4812,21 +4940,21 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
4812
4940
  localSystemAudioStream === null || localSystemAudioStream === void 0 ? void 0 : localSystemAudioStream.on(_mediaHelpers.LocalStreamEventNames.OutputTrackChange, this.localOutputTrackChangeHandler);
4813
4941
  this.mediaProperties.mediaDirection.sendShare = this.mediaProperties.hasLocalShareStream();
4814
4942
  if (!(!this.isMultistream || !localSystemAudioStream)) {
4815
- _context14.next = 10;
4943
+ _context15.next = 10;
4816
4944
  break;
4817
4945
  }
4818
- _context14.next = 10;
4946
+ _context15.next = 10;
4819
4947
  return this.unpublishStream(_internalMediaCore.MediaType.AudioSlides, oldStream);
4820
4948
  case 10:
4821
- _context14.next = 12;
4949
+ _context15.next = 12;
4822
4950
  return this.publishStream(_internalMediaCore.MediaType.AudioSlides, this.mediaProperties.shareAudioStream);
4823
4951
  case 12:
4824
4952
  case "end":
4825
- return _context14.stop();
4953
+ return _context15.stop();
4826
4954
  }
4827
- }, _callee14, this);
4955
+ }, _callee15, this);
4828
4956
  }));
4829
- function setLocalShareAudioStream(_x14) {
4957
+ function setLocalShareAudioStream(_x15) {
4830
4958
  return _setLocalShareAudioStream.apply(this, arguments);
4831
4959
  }
4832
4960
  return setLocalShareAudioStream;
@@ -4865,11 +4993,11 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
4865
4993
  }, {
4866
4994
  key: "cleanupLocalStreams",
4867
4995
  value: function cleanupLocalStreams() {
4868
- var _this$mediaProperties5 = this.mediaProperties,
4869
- audioStream = _this$mediaProperties5.audioStream,
4870
- videoStream = _this$mediaProperties5.videoStream,
4871
- shareAudioStream = _this$mediaProperties5.shareAudioStream,
4872
- shareVideoStream = _this$mediaProperties5.shareVideoStream;
4996
+ var _this$mediaProperties7 = this.mediaProperties,
4997
+ audioStream = _this$mediaProperties7.audioStream,
4998
+ videoStream = _this$mediaProperties7.videoStream,
4999
+ shareAudioStream = _this$mediaProperties7.shareAudioStream,
5000
+ shareVideoStream = _this$mediaProperties7.shareVideoStream;
4873
5001
  audioStream === null || audioStream === void 0 ? void 0 : audioStream.off(_mediaHelpers.LocalStreamEventNames.UserMuteStateChange, this.localAudioStreamMuteStateHandler);
4874
5002
  audioStream === null || audioStream === void 0 ? void 0 : audioStream.off(_mediaHelpers.LocalStreamEventNames.SystemMuteStateChange, this.localAudioStreamMuteStateHandler);
4875
5003
  audioStream === null || audioStream === void 0 ? void 0 : audioStream.off(_mediaHelpers.LocalStreamEventNames.OutputTrackChange, this.localOutputTrackChangeHandler);
@@ -4931,7 +5059,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
4931
5059
  }, {
4932
5060
  key: "setMercuryListener",
4933
5061
  value: function setMercuryListener() {
4934
- var _this25 = this;
5062
+ var _this26 = this;
4935
5063
  // Client will have a socket manager and handle reconnecting to mercury, when we reconnect to mercury
4936
5064
  // if the meeting has active peer connections, it should try to reconnect.
4937
5065
  // @ts-ignore
@@ -4939,33 +5067,33 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
4939
5067
  _loggerProxy.default.logger.info('Meeting:index#setMercuryListener --> Web socket online');
4940
5068
 
4941
5069
  // Only send restore event when it was disconnected before and for connected later
4942
- if (!_this25.hasWebsocketConnected) {
5070
+ if (!_this26.hasWebsocketConnected) {
4943
5071
  // @ts-ignore
4944
- _this25.webex.internal.newMetrics.submitClientEvent({
5072
+ _this26.webex.internal.newMetrics.submitClientEvent({
4945
5073
  name: 'client.mercury.connection.restored',
4946
5074
  options: {
4947
- meetingId: _this25.id
5075
+ meetingId: _this26.id
4948
5076
  }
4949
5077
  });
4950
5078
  _metrics.default.sendBehavioralMetric(_constants2.default.MERCURY_CONNECTION_RESTORED, {
4951
- correlation_id: _this25.correlationId
5079
+ correlation_id: _this26.correlationId
4952
5080
  });
4953
5081
  }
4954
- _this25.hasWebsocketConnected = true;
5082
+ _this26.hasWebsocketConnected = true;
4955
5083
  });
4956
5084
 
4957
5085
  // @ts-ignore
4958
5086
  this.webex.internal.mercury.on(_constants.OFFLINE, function () {
4959
5087
  _loggerProxy.default.logger.error('Meeting:index#setMercuryListener --> Web socket offline');
4960
5088
  // @ts-ignore
4961
- _this25.webex.internal.newMetrics.submitClientEvent({
5089
+ _this26.webex.internal.newMetrics.submitClientEvent({
4962
5090
  name: 'client.mercury.connection.lost',
4963
5091
  options: {
4964
- meetingId: _this25.id
5092
+ meetingId: _this26.id
4965
5093
  }
4966
5094
  });
4967
5095
  _metrics.default.sendBehavioralMetric(_constants2.default.MERCURY_CONNECTION_FAILURE, {
4968
- correlation_id: _this25.correlationId
5096
+ correlation_id: _this26.correlationId
4969
5097
  });
4970
5098
  });
4971
5099
  }
@@ -4974,6 +5102,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
4974
5102
  * Close the peer connections and remove them from the class.
4975
5103
  * Cleanup any media connection related things.
4976
5104
  *
5105
+ * @param {boolean} resetMuteStates whether to also reset the audio/video mute state information
4977
5106
  * @returns {Promise}
4978
5107
  * @public
4979
5108
  * @memberof Meeting
@@ -4981,6 +5110,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
4981
5110
  }, {
4982
5111
  key: "closePeerConnections",
4983
5112
  value: function closePeerConnections() {
5113
+ var resetMuteStates = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
4984
5114
  if (this.mediaProperties.webrtcMediaConnection) {
4985
5115
  if (this.remoteMediaManager) {
4986
5116
  this.remoteMediaManager.stop();
@@ -4991,11 +5121,14 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
4991
5121
  });
4992
5122
  this.receiveSlotManager.reset();
4993
5123
  this.mediaProperties.webrtcMediaConnection.close();
5124
+ this.mediaProperties.unsetPeerConnection();
4994
5125
  this.sendSlotManager.reset();
4995
5126
  this.setNetworkStatus(undefined);
4996
5127
  }
4997
- this.audio = null;
4998
- this.video = null;
5128
+ if (resetMuteStates) {
5129
+ this.audio = null;
5130
+ this.video = null;
5131
+ }
4999
5132
  return _promise.default.resolve();
5000
5133
  }
5001
5134
 
@@ -5067,7 +5200,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
5067
5200
  }, {
5068
5201
  key: "muteAudio",
5069
5202
  value: function muteAudio() {
5070
- var _this26 = this;
5203
+ var _this27 = this;
5071
5204
  if (!_util2.default.isUserInJoinedState(this.locusInfo)) {
5072
5205
  return _promise.default.reject(new _webexErrors.UserNotJoinedError());
5073
5206
  }
@@ -5083,22 +5216,22 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
5083
5216
 
5084
5217
  // First, stop sending the local audio media
5085
5218
  return logRequest(this.audio.handleClientRequest(this, true).then(function () {
5086
- _util2.default.handleAudioLogging(_this26.mediaProperties.audioStream);
5219
+ _util2.default.handleAudioLogging(_this27.mediaProperties.audioStream);
5087
5220
  // @ts-ignore
5088
- _this26.webex.internal.newMetrics.submitClientEvent({
5221
+ _this27.webex.internal.newMetrics.submitClientEvent({
5089
5222
  name: 'client.muted',
5090
5223
  payload: {
5091
5224
  trigger: 'user-interaction',
5092
5225
  mediaType: 'audio'
5093
5226
  },
5094
5227
  options: {
5095
- meetingId: _this26.id
5228
+ meetingId: _this27.id
5096
5229
  }
5097
5230
  });
5098
5231
  }).catch(function (error) {
5099
5232
  _metrics.default.sendBehavioralMetric(_constants2.default.MUTE_AUDIO_FAILURE, {
5100
- correlation_id: _this26.correlationId,
5101
- locus_id: _this26.locusUrl.split('/').pop(),
5233
+ correlation_id: _this27.correlationId,
5234
+ locus_id: _this27.locusUrl.split('/').pop(),
5102
5235
  reason: error.message,
5103
5236
  stack: error.stack
5104
5237
  });
@@ -5117,7 +5250,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
5117
5250
  }, {
5118
5251
  key: "unmuteAudio",
5119
5252
  value: function unmuteAudio() {
5120
- var _this27 = this;
5253
+ var _this28 = this;
5121
5254
  if (!_util2.default.isUserInJoinedState(this.locusInfo)) {
5122
5255
  return _promise.default.reject(new _webexErrors.UserNotJoinedError());
5123
5256
  }
@@ -5133,22 +5266,22 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
5133
5266
 
5134
5267
  // First, send the control to unmute the participant on the server
5135
5268
  return logRequest(this.audio.handleClientRequest(this, false).then(function () {
5136
- _util2.default.handleAudioLogging(_this27.mediaProperties.audioStream);
5269
+ _util2.default.handleAudioLogging(_this28.mediaProperties.audioStream);
5137
5270
  // @ts-ignore
5138
- _this27.webex.internal.newMetrics.submitClientEvent({
5271
+ _this28.webex.internal.newMetrics.submitClientEvent({
5139
5272
  name: 'client.unmuted',
5140
5273
  payload: {
5141
5274
  trigger: 'user-interaction',
5142
5275
  mediaType: 'audio'
5143
5276
  },
5144
5277
  options: {
5145
- meetingId: _this27.id
5278
+ meetingId: _this28.id
5146
5279
  }
5147
5280
  });
5148
5281
  }).catch(function (error) {
5149
5282
  _metrics.default.sendBehavioralMetric(_constants2.default.UNMUTE_AUDIO_FAILURE, {
5150
- correlation_id: _this27.correlationId,
5151
- locus_id: _this27.locusUrl.split('/').pop(),
5283
+ correlation_id: _this28.correlationId,
5284
+ locus_id: _this28.locusUrl.split('/').pop(),
5152
5285
  reason: error.message,
5153
5286
  stack: error.stack
5154
5287
  });
@@ -5167,7 +5300,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
5167
5300
  }, {
5168
5301
  key: "muteVideo",
5169
5302
  value: function muteVideo() {
5170
- var _this28 = this;
5303
+ var _this29 = this;
5171
5304
  if (!_util2.default.isUserInJoinedState(this.locusInfo)) {
5172
5305
  return _promise.default.reject(new _webexErrors.UserNotJoinedError());
5173
5306
  }
@@ -5181,22 +5314,22 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
5181
5314
  return _promise.default.reject(new _parameter.default('no video control associated to the meeting'));
5182
5315
  }
5183
5316
  return logRequest(this.video.handleClientRequest(this, true).then(function () {
5184
- _util2.default.handleVideoLogging(_this28.mediaProperties.videoStream);
5317
+ _util2.default.handleVideoLogging(_this29.mediaProperties.videoStream);
5185
5318
  // @ts-ignore
5186
- _this28.webex.internal.newMetrics.submitClientEvent({
5319
+ _this29.webex.internal.newMetrics.submitClientEvent({
5187
5320
  name: 'client.muted',
5188
5321
  payload: {
5189
5322
  trigger: 'user-interaction',
5190
5323
  mediaType: 'video'
5191
5324
  },
5192
5325
  options: {
5193
- meetingId: _this28.id
5326
+ meetingId: _this29.id
5194
5327
  }
5195
5328
  });
5196
5329
  }).catch(function (error) {
5197
5330
  _metrics.default.sendBehavioralMetric(_constants2.default.MUTE_VIDEO_FAILURE, {
5198
- correlation_id: _this28.correlationId,
5199
- locus_id: _this28.locusUrl.split('/').pop(),
5331
+ correlation_id: _this29.correlationId,
5332
+ locus_id: _this29.locusUrl.split('/').pop(),
5200
5333
  reason: error.message,
5201
5334
  stack: error.stack
5202
5335
  });
@@ -5215,7 +5348,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
5215
5348
  }, {
5216
5349
  key: "unmuteVideo",
5217
5350
  value: function unmuteVideo() {
5218
- var _this29 = this;
5351
+ var _this30 = this;
5219
5352
  if (!_util2.default.isUserInJoinedState(this.locusInfo)) {
5220
5353
  return _promise.default.reject(new _webexErrors.UserNotJoinedError());
5221
5354
  }
@@ -5229,22 +5362,22 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
5229
5362
  return _promise.default.reject(new _parameter.default('no audio control associated to the meeting'));
5230
5363
  }
5231
5364
  return logRequest(this.video.handleClientRequest(this, false).then(function () {
5232
- _util2.default.handleVideoLogging(_this29.mediaProperties.videoStream);
5365
+ _util2.default.handleVideoLogging(_this30.mediaProperties.videoStream);
5233
5366
  // @ts-ignore
5234
- _this29.webex.internal.newMetrics.submitClientEvent({
5367
+ _this30.webex.internal.newMetrics.submitClientEvent({
5235
5368
  name: 'client.unmuted',
5236
5369
  payload: {
5237
5370
  trigger: 'user-interaction',
5238
5371
  mediaType: 'video'
5239
5372
  },
5240
5373
  options: {
5241
- meetingId: _this29.id
5374
+ meetingId: _this30.id
5242
5375
  }
5243
5376
  });
5244
5377
  }).catch(function (error) {
5245
5378
  _metrics.default.sendBehavioralMetric(_constants2.default.UNMUTE_VIDEO_FAILURE, {
5246
- correlation_id: _this29.correlationId,
5247
- locus_id: _this29.locusUrl.split('/').pop(),
5379
+ correlation_id: _this30.correlationId,
5380
+ locus_id: _this30.locusUrl.split('/').pop(),
5248
5381
  reason: error.message,
5249
5382
  stack: error.stack
5250
5383
  });
@@ -5259,7 +5392,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
5259
5392
  * @param {Object} options - options to join with media
5260
5393
  * @param {JoinOptions} [options.joinOptions] - see #join()
5261
5394
  * @param {AddMediaOptions} [options.mediaOptions] - see #addMedia()
5262
- * @returns {Promise} -- {join: see join(), media: see addMedia()}
5395
+ * @returns {Promise} -- {join: see join(), media: see addMedia(), multistreamEnabled: flag to indicate if we managed to join in multistream mode}
5263
5396
  * @public
5264
5397
  * @memberof Meeting
5265
5398
  * @example
@@ -5273,8 +5406,8 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
5273
5406
  }, {
5274
5407
  key: "joinWithMedia",
5275
5408
  value: (function () {
5276
- var _joinWithMedia = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee15() {
5277
- var _this30 = this;
5409
+ var _joinWithMedia = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee16() {
5410
+ var _this31 = this;
5278
5411
  var options,
5279
5412
  mediaOptions,
5280
5413
  _options$joinOptions,
@@ -5294,51 +5427,51 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
5294
5427
  _leaveError,
5295
5428
  leaveError,
5296
5429
  shouldRetry,
5297
- _args15 = arguments;
5298
- return _regenerator.default.wrap(function _callee15$(_context15) {
5299
- while (1) switch (_context15.prev = _context15.next) {
5430
+ _args16 = arguments;
5431
+ return _regenerator.default.wrap(function _callee16$(_context16) {
5432
+ while (1) switch (_context16.prev = _context16.next) {
5300
5433
  case 0:
5301
- options = _args15.length > 0 && _args15[0] !== undefined ? _args15[0] : {};
5434
+ options = _args16.length > 0 && _args16[0] !== undefined ? _args16[0] : {};
5302
5435
  mediaOptions = options.mediaOptions, _options$joinOptions = options.joinOptions, joinOptions = _options$joinOptions === void 0 ? {} : _options$joinOptions;
5303
5436
  _this$joinWithMediaRe = this.joinWithMediaRetryInfo, isRetry = _this$joinWithMediaRe.isRetry, prevJoinResponse = _this$joinWithMediaRe.prevJoinResponse;
5304
5437
  if (mediaOptions !== null && mediaOptions !== void 0 && mediaOptions.allowMediaInLobby) {
5305
- _context15.next = 5;
5438
+ _context16.next = 5;
5306
5439
  break;
5307
5440
  }
5308
- return _context15.abrupt("return", _promise.default.reject(new _parameter.default('joinWithMedia() can only be used with allowMediaInLobby set to true')));
5441
+ return _context16.abrupt("return", _promise.default.reject(new _parameter.default('joinWithMedia() can only be used with allowMediaInLobby set to true')));
5309
5442
  case 5:
5310
5443
  this.allowMediaInLobby = true;
5311
5444
  _loggerProxy.default.logger.info('Meeting:index#joinWithMedia called');
5312
5445
  joined = false;
5313
5446
  joinResponse = prevJoinResponse;
5314
- _context15.prev = 9;
5447
+ _context16.prev = 9;
5315
5448
  forceTurnDiscovery = false;
5316
5449
  if (joinResponse) {
5317
- _context15.next = 33;
5450
+ _context16.next = 33;
5318
5451
  break;
5319
5452
  }
5320
- _context15.next = 14;
5453
+ _context16.next = 14;
5321
5454
  return this.roap.generateTurnDiscoveryRequestMessage(this, true);
5322
5455
  case 14:
5323
- turnDiscoveryRequest = _context15.sent;
5456
+ turnDiscoveryRequest = _context16.sent;
5324
5457
  turnDiscoverySkippedReason = turnDiscoveryRequest.turnDiscoverySkippedReason;
5325
5458
  joinOptions.roapMessage = turnDiscoveryRequest.roapMessage;
5326
5459
  _loggerProxy.default.logger.info('Meeting:index#joinWithMedia ---> calling join with joinOptions, ', joinOptions);
5327
- _context15.next = 20;
5460
+ _context16.next = 20;
5328
5461
  return this.join(joinOptions);
5329
5462
  case 20:
5330
- joinResponse = _context15.sent;
5463
+ joinResponse = _context16.sent;
5331
5464
  joined = true;
5332
5465
 
5333
5466
  // if we sent out TURN discovery Roap message with join, process the TURN discovery response
5334
5467
  if (!joinOptions.roapMessage) {
5335
- _context15.next = 31;
5468
+ _context16.next = 31;
5336
5469
  break;
5337
5470
  }
5338
- _context15.next = 25;
5471
+ _context16.next = 25;
5339
5472
  return this.roap.handleTurnDiscoveryHttpResponse(this, joinResponse);
5340
5473
  case 25:
5341
- _yield$this$roap$hand = _context15.sent;
5474
+ _yield$this$roap$hand = _context16.sent;
5342
5475
  turnServerInfo = _yield$this$roap$hand.turnServerInfo;
5343
5476
  turnDiscoverySkippedReason = _yield$this$roap$hand.turnDiscoverySkippedReason;
5344
5477
  this.turnDiscoverySkippedReason = turnDiscoverySkippedReason;
@@ -5347,7 +5480,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
5347
5480
  this.roap.abortTurnDiscovery();
5348
5481
  }
5349
5482
  case 31:
5350
- _context15.next = 35;
5483
+ _context16.next = 35;
5351
5484
  break;
5352
5485
  case 33:
5353
5486
  // This is a retry, when join succeeded but addMedia failed, so we'll just call addMedia() again,
@@ -5355,82 +5488,85 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
5355
5488
  forceTurnDiscovery = true;
5356
5489
  joined = true;
5357
5490
  case 35:
5358
- _context15.next = 37;
5491
+ _context16.next = 37;
5359
5492
  return this.addMediaInternal(function () {
5360
- return _this30.joinWithMediaRetryInfo.isRetry ? 'JOIN_MEETING_FINAL' : 'JOIN_MEETING_RETRY';
5493
+ return _this31.joinWithMediaRetryInfo.isRetry ? 'JOIN_MEETING_FINAL' : 'JOIN_MEETING_RETRY';
5361
5494
  }, turnServerInfo, forceTurnDiscovery, mediaOptions);
5362
5495
  case 37:
5363
- mediaResponse = _context15.sent;
5496
+ mediaResponse = _context16.sent;
5364
5497
  this.joinWithMediaRetryInfo = {
5365
5498
  isRetry: false,
5366
5499
  prevJoinResponse: undefined
5367
5500
  };
5368
- return _context15.abrupt("return", {
5501
+ return _context16.abrupt("return", {
5369
5502
  join: joinResponse,
5370
- media: mediaResponse
5503
+ media: mediaResponse,
5504
+ multistreamEnabled: this.isMultistream
5371
5505
  });
5372
5506
  case 42:
5373
- _context15.prev = 42;
5374
- _context15.t0 = _context15["catch"](9);
5375
- _loggerProxy.default.logger.error('Meeting:index#joinWithMedia --> ', _context15.t0);
5507
+ _context16.prev = 42;
5508
+ _context16.t0 = _context16["catch"](9);
5509
+ _loggerProxy.default.logger.error('Meeting:index#joinWithMedia --> ', _context16.t0);
5376
5510
  this.roap.abortTurnDiscovery();
5377
- if (!(joined && isRetry)) {
5378
- _context15.next = 56;
5511
+
5512
+ // if this was the first attempt, let's do a retry
5513
+ shouldRetry = !isRetry;
5514
+ if (_internalPluginMetrics.CallDiagnosticUtils.isSdpOfferCreationError(_context16.t0)) {
5515
+ // errors related to offer creation (for example missing H264 codec) will happen again no matter how many times we try,
5516
+ // so there is no point doing a retry
5517
+ shouldRetry = false;
5518
+ }
5519
+
5520
+ // we only want to call leave if join was successful and this was a retry or we won't be doing any more retries
5521
+ if (!(joined && (isRetry || !shouldRetry))) {
5522
+ _context16.next = 58;
5379
5523
  break;
5380
5524
  }
5381
- _context15.prev = 47;
5382
- _context15.next = 50;
5525
+ _context16.prev = 49;
5526
+ _context16.next = 52;
5383
5527
  return this.leave({
5384
5528
  resourceId: joinOptions === null || joinOptions === void 0 ? void 0 : joinOptions.resourceId,
5385
5529
  reason: 'joinWithMedia failure'
5386
5530
  });
5387
- case 50:
5388
- _context15.next = 56;
5389
- break;
5390
5531
  case 52:
5391
- _context15.prev = 52;
5392
- _context15.t1 = _context15["catch"](47);
5393
- _loggerProxy.default.logger.error('Meeting:index#joinWithMedia --> leave error', _context15.t1);
5394
- leaveError = _context15.t1;
5395
- case 56:
5532
+ _context16.next = 58;
5533
+ break;
5534
+ case 54:
5535
+ _context16.prev = 54;
5536
+ _context16.t1 = _context16["catch"](49);
5537
+ _loggerProxy.default.logger.error('Meeting:index#joinWithMedia --> leave error', _context16.t1);
5538
+ leaveError = _context16.t1;
5539
+ case 58:
5396
5540
  _metrics.default.sendBehavioralMetric(_constants2.default.JOIN_WITH_MEDIA_FAILURE, {
5397
5541
  correlation_id: this.correlationId,
5398
5542
  locus_id: (_this$locusUrl = this.locusUrl) === null || _this$locusUrl === void 0 ? void 0 : _this$locusUrl.split('/').pop(),
5399
5543
  // if join fails, we may end up with no locusUrl
5400
- reason: _context15.t0.message,
5401
- stack: _context15.t0.stack,
5544
+ reason: _context16.t0.message,
5545
+ stack: _context16.t0.stack,
5402
5546
  leaveErrorReason: (_leaveError = leaveError) === null || _leaveError === void 0 ? void 0 : _leaveError.message,
5403
5547
  isRetry: isRetry
5404
5548
  }, {
5405
- type: _context15.t0.name
5549
+ type: _context16.t0.name
5406
5550
  });
5407
-
5408
- // if this was the first attempt, let's do a retry
5409
- shouldRetry = !isRetry;
5410
- if (_internalPluginMetrics.CallDiagnosticUtils.isSdpOfferCreationError(_context15.t0)) {
5411
- // errors related to offer creation (for example missing H264 codec) will happen again no matter how many times we try,
5412
- // so there is no point doing a retry
5413
- shouldRetry = false;
5414
- }
5415
5551
  if (!shouldRetry) {
5416
- _context15.next = 64;
5552
+ _context16.next = 64;
5417
5553
  break;
5418
5554
  }
5419
5555
  _loggerProxy.default.logger.warn('Meeting:index#joinWithMedia --> retrying call to joinWithMedia');
5420
5556
  this.joinWithMediaRetryInfo.isRetry = true;
5421
5557
  this.joinWithMediaRetryInfo.prevJoinResponse = joinResponse;
5422
- return _context15.abrupt("return", this.joinWithMedia(options));
5558
+ return _context16.abrupt("return", this.joinWithMedia(options));
5423
5559
  case 64:
5424
5560
  this.joinWithMediaRetryInfo = {
5425
5561
  isRetry: false,
5426
5562
  prevJoinResponse: undefined
5427
5563
  };
5428
- throw _context15.t0;
5564
+ throw _context16.t0;
5429
5565
  case 66:
5430
5566
  case "end":
5431
- return _context15.stop();
5567
+ return _context16.stop();
5432
5568
  }
5433
- }, _callee15, this, [[9, 42], [47, 52]]);
5569
+ }, _callee16, this, [[9, 42], [49, 54]]);
5434
5570
  }));
5435
5571
  function joinWithMedia() {
5436
5572
  return _joinWithMedia.apply(this, arguments);
@@ -5449,7 +5585,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
5449
5585
  }, {
5450
5586
  key: "reconnect",
5451
5587
  value: function reconnect(options) {
5452
- var _this31 = this;
5588
+ var _this32 = this;
5453
5589
  _loggerProxy.default.logger.log("Meeting:index#reconnect --> attempting to reconnect meeting ".concat(this.id));
5454
5590
  if (!this.reconnectionManager || !this.reconnectionManager.reconnect) {
5455
5591
  return _promise.default.reject(new _parameter.default('Cannot reconnect, ReconnectionManager must first be defined.'));
@@ -5460,20 +5596,20 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
5460
5596
  return _promise.default.reject(new _parameter.default('Cannot reconnect, Media has not established to reconnect'));
5461
5597
  }
5462
5598
  this.cleanUpBeforeReconnection();
5463
- return this.reconnectionManager.reconnect(options, /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee16() {
5464
- return _regenerator.default.wrap(function _callee16$(_context16) {
5465
- while (1) switch (_context16.prev = _context16.next) {
5599
+ return this.reconnectionManager.reconnect(options, /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee17() {
5600
+ return _regenerator.default.wrap(function _callee17$(_context17) {
5601
+ while (1) switch (_context17.prev = _context17.next) {
5466
5602
  case 0:
5467
- _context16.next = 2;
5468
- return _this31.waitForRemoteSDPAnswer();
5603
+ _context17.next = 2;
5604
+ return _this32.waitForRemoteSDPAnswer();
5469
5605
  case 2:
5470
- _context16.next = 4;
5471
- return _this31.waitForMediaConnectionConnected();
5606
+ _context17.next = 4;
5607
+ return _this32.waitForMediaConnectionConnected();
5472
5608
  case 4:
5473
5609
  case "end":
5474
- return _context16.stop();
5610
+ return _context17.stop();
5475
5611
  }
5476
- }, _callee16);
5612
+ }, _callee17);
5477
5613
  }))).then(function () {
5478
5614
  _loggerProxy.default.logger.log('Meeting:index#reconnect --> Meeting reconnect success');
5479
5615
  }).catch(function (error) {
@@ -5482,7 +5618,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
5482
5618
  return _promise.default.resolve();
5483
5619
  }
5484
5620
  _loggerProxy.default.logger.error('Meeting:index#reconnect --> Meeting reconnect failed', error);
5485
- _this31.uploadLogs({
5621
+ _this32.uploadLogs({
5486
5622
  file: 'meeting/index',
5487
5623
  function: 'reconnect'
5488
5624
  });
@@ -5529,19 +5665,19 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
5529
5665
  }, {
5530
5666
  key: "setCaptionLanguage",
5531
5667
  value: function setCaptionLanguage(language) {
5532
- var _this32 = this;
5668
+ var _this33 = this;
5533
5669
  return new _promise.default(function (resolve, reject) {
5534
- if (!_this32.isTranscriptionSupported()) {
5670
+ if (!_this33.isTranscriptionSupported()) {
5535
5671
  _loggerProxy.default.logger.error('Meeting:index#setCaptionLanguage --> Webex Assistant is not enabled/supported');
5536
5672
  reject(new Error('Webex Assistant is not enabled/supported'));
5537
5673
  }
5538
5674
  try {
5539
5675
  var voiceaListenerCaptionUpdate = function voiceaListenerCaptionUpdate(payload) {
5540
5676
  // @ts-ignore
5541
- _this32.webex.internal.voicea.off(_internalPluginVoicea.EVENT_TRIGGERS.CAPTION_LANGUAGE_UPDATE, voiceaListenerCaptionUpdate);
5677
+ _this33.webex.internal.voicea.off(_internalPluginVoicea.EVENT_TRIGGERS.CAPTION_LANGUAGE_UPDATE, voiceaListenerCaptionUpdate);
5542
5678
  var statusCode = payload.statusCode;
5543
5679
  if (statusCode === 200) {
5544
- _this32.transcription.languageOptions = _objectSpread(_objectSpread({}, _this32.transcription.languageOptions), {}, {
5680
+ _this33.transcription.languageOptions = _objectSpread(_objectSpread({}, _this33.transcription.languageOptions), {}, {
5545
5681
  currentCaptionLanguage: language
5546
5682
  });
5547
5683
  resolve(language);
@@ -5550,9 +5686,9 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
5550
5686
  }
5551
5687
  };
5552
5688
  // @ts-ignore
5553
- _this32.webex.internal.voicea.on(_internalPluginVoicea.EVENT_TRIGGERS.CAPTION_LANGUAGE_UPDATE, voiceaListenerCaptionUpdate);
5689
+ _this33.webex.internal.voicea.on(_internalPluginVoicea.EVENT_TRIGGERS.CAPTION_LANGUAGE_UPDATE, voiceaListenerCaptionUpdate);
5554
5690
  // @ts-ignore
5555
- _this32.webex.internal.voicea.requestLanguage(language);
5691
+ _this33.webex.internal.voicea.requestLanguage(language);
5556
5692
  } catch (error) {
5557
5693
  _loggerProxy.default.logger.error("Meeting:index#setCaptionLanguage --> ".concat(error));
5558
5694
  reject(error);
@@ -5568,23 +5704,23 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
5568
5704
  }, {
5569
5705
  key: "setSpokenLanguage",
5570
5706
  value: function setSpokenLanguage(language) {
5571
- var _this33 = this;
5707
+ var _this34 = this;
5572
5708
  return new _promise.default(function (resolve, reject) {
5573
- if (!_this33.isTranscriptionSupported()) {
5709
+ if (!_this34.isTranscriptionSupported()) {
5574
5710
  _loggerProxy.default.logger.error('Meeting:index#setCaptionLanguage --> Webex Assistant is not enabled/supported');
5575
5711
  reject(new Error('Webex Assistant is not enabled/supported'));
5576
5712
  }
5577
- if (_this33.getCurUserType() !== 'host') {
5713
+ if (_this34.getCurUserType() !== 'host') {
5578
5714
  _loggerProxy.default.logger.error('Meeting:index#setSpokenLanguage --> Only host can set spoken language');
5579
5715
  reject(new Error('Only host can set spoken language'));
5580
5716
  }
5581
5717
  try {
5582
5718
  var voiceaListenerLanguageUpdate = function voiceaListenerLanguageUpdate(payload) {
5583
5719
  // @ts-ignore
5584
- _this33.webex.internal.voicea.off(_internalPluginVoicea.EVENT_TRIGGERS.SPOKEN_LANGUAGE_UPDATE, voiceaListenerLanguageUpdate);
5720
+ _this34.webex.internal.voicea.off(_internalPluginVoicea.EVENT_TRIGGERS.SPOKEN_LANGUAGE_UPDATE, voiceaListenerLanguageUpdate);
5585
5721
  var languageCode = payload.languageCode;
5586
5722
  if (languageCode) {
5587
- _this33.transcription.languageOptions = _objectSpread(_objectSpread({}, _this33.transcription.languageOptions), {}, {
5723
+ _this34.transcription.languageOptions = _objectSpread(_objectSpread({}, _this34.transcription.languageOptions), {}, {
5588
5724
  currentSpokenLanguage: languageCode
5589
5725
  });
5590
5726
  resolve(languageCode);
@@ -5594,10 +5730,10 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
5594
5730
  };
5595
5731
 
5596
5732
  // @ts-ignore
5597
- _this33.webex.internal.voicea.on(_internalPluginVoicea.EVENT_TRIGGERS.SPOKEN_LANGUAGE_UPDATE, voiceaListenerLanguageUpdate);
5733
+ _this34.webex.internal.voicea.on(_internalPluginVoicea.EVENT_TRIGGERS.SPOKEN_LANGUAGE_UPDATE, voiceaListenerLanguageUpdate);
5598
5734
 
5599
5735
  // @ts-ignore
5600
- _this33.webex.internal.voicea.setSpokenLanguage(language);
5736
+ _this34.webex.internal.voicea.setSpokenLanguage(language);
5601
5737
  } catch (error) {
5602
5738
  _loggerProxy.default.logger.error("Meeting:index#setSpokenLanguage --> ".concat(error));
5603
5739
  reject(error);
@@ -5614,48 +5750,48 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
5614
5750
  }, {
5615
5751
  key: "startTranscription",
5616
5752
  value: (function () {
5617
- var _startTranscription = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee17(options) {
5618
- return _regenerator.default.wrap(function _callee17$(_context17) {
5619
- while (1) switch (_context17.prev = _context17.next) {
5753
+ var _startTranscription = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee18(options) {
5754
+ return _regenerator.default.wrap(function _callee18$(_context18) {
5755
+ while (1) switch (_context18.prev = _context18.next) {
5620
5756
  case 0:
5621
5757
  if (!this.isJoined()) {
5622
- _context17.next = 14;
5758
+ _context18.next = 14;
5623
5759
  break;
5624
5760
  }
5625
5761
  _loggerProxy.default.logger.info('Meeting:index#startTranscription --> Attempting to enable transcription!');
5626
- _context17.prev = 2;
5762
+ _context18.prev = 2;
5627
5763
  if (!this.areVoiceaEventsSetup) {
5628
5764
  this.setUpVoiceaListeners();
5629
5765
  }
5630
5766
 
5631
5767
  // @ts-ignore
5632
- _context17.next = 6;
5768
+ _context18.next = 6;
5633
5769
  return this.webex.internal.voicea.turnOnCaptions(options === null || options === void 0 ? void 0 : options.spokenLanguage);
5634
5770
  case 6:
5635
- _context17.next = 12;
5771
+ _context18.next = 12;
5636
5772
  break;
5637
5773
  case 8:
5638
- _context17.prev = 8;
5639
- _context17.t0 = _context17["catch"](2);
5640
- _loggerProxy.default.logger.error("Meeting:index#startTranscription --> ".concat(_context17.t0));
5774
+ _context18.prev = 8;
5775
+ _context18.t0 = _context18["catch"](2);
5776
+ _loggerProxy.default.logger.error("Meeting:index#startTranscription --> ".concat(_context18.t0));
5641
5777
  _metrics.default.sendBehavioralMetric(_constants2.default.RECEIVE_TRANSCRIPTION_FAILURE, {
5642
5778
  correlation_id: this.correlationId,
5643
- reason: _context17.t0.message,
5644
- stack: _context17.t0.stack
5779
+ reason: _context18.t0.message,
5780
+ stack: _context18.t0.stack
5645
5781
  });
5646
5782
  case 12:
5647
- _context17.next = 16;
5783
+ _context18.next = 16;
5648
5784
  break;
5649
5785
  case 14:
5650
5786
  _loggerProxy.default.logger.error("Meeting:index#startTranscription --> meeting joined : ".concat(this.isJoined()));
5651
5787
  throw new Error('Meeting is not joined');
5652
5788
  case 16:
5653
5789
  case "end":
5654
- return _context17.stop();
5790
+ return _context18.stop();
5655
5791
  }
5656
- }, _callee17, this, [[2, 8]]);
5792
+ }, _callee18, this, [[2, 8]]);
5657
5793
  }));
5658
- function startTranscription(_x15) {
5794
+ function startTranscription(_x16) {
5659
5795
  return _startTranscription.apply(this, arguments);
5660
5796
  }
5661
5797
  return startTranscription;
@@ -5680,6 +5816,9 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
5680
5816
 
5681
5817
  // @ts-ignore
5682
5818
  this.webex.internal.voicea.off(_internalPluginVoicea.EVENT_TRIGGERS.NEW_CAPTION, this.voiceaListenerCallbacks[_internalPluginVoicea.EVENT_TRIGGERS.NEW_CAPTION]);
5819
+
5820
+ // @ts-ignore
5821
+ this.webex.internal.voicea.deregisterEvents();
5683
5822
  this.areVoiceaEventsSetup = false;
5684
5823
  this.triggerStopReceivingTranscriptionEvent();
5685
5824
  }
@@ -5716,36 +5855,36 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
5716
5855
  * Scenario D: Joining any other way (sip, pstn, conversationUrl, link just need to specify resourceId)
5717
5856
  */
5718
5857
  function () {
5719
- var _join = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee18() {
5720
- var _this34 = this;
5858
+ var _join = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee19() {
5859
+ var _this35 = this;
5721
5860
  var options,
5722
5861
  errorMessage,
5723
5862
  error,
5724
5863
  joinFailed,
5725
5864
  joinSuccess,
5726
- _errorMessage,
5727
- _error,
5728
5865
  _errorMessage2,
5729
5866
  _error2,
5730
- _args18 = arguments;
5731
- return _regenerator.default.wrap(function _callee18$(_context18) {
5732
- while (1) switch (_context18.prev = _context18.next) {
5867
+ _errorMessage3,
5868
+ _error3,
5869
+ _args19 = arguments;
5870
+ return _regenerator.default.wrap(function _callee19$(_context19) {
5871
+ while (1) switch (_context19.prev = _context19.next) {
5733
5872
  case 0:
5734
- options = _args18.length > 0 && _args18[0] !== undefined ? _args18[0] : {};
5873
+ options = _args19.length > 0 && _args19[0] !== undefined ? _args19[0] : {};
5735
5874
  if (this.webex.meetings.registered) {
5736
- _context18.next = 6;
5875
+ _context19.next = 6;
5737
5876
  break;
5738
5877
  }
5739
5878
  errorMessage = 'Meeting:index#join --> Device not registered';
5740
5879
  error = new Error(errorMessage);
5741
5880
  _loggerProxy.default.logger.error(errorMessage);
5742
- return _context18.abrupt("return", _promise.default.reject(error));
5881
+ return _context19.abrupt("return", _promise.default.reject(error));
5743
5882
  case 6:
5744
5883
  if (!this.deferJoin) {
5745
- _context18.next = 8;
5884
+ _context19.next = 8;
5746
5885
  break;
5747
5886
  }
5748
- return _context18.abrupt("return", this.deferJoin);
5887
+ return _context19.abrupt("return", this.deferJoin);
5749
5888
  case 8:
5750
5889
  // Create a deferred promise for a consistent resolve value from utils.
5751
5890
  // This also prevents redundant API calls.
@@ -5769,18 +5908,21 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
5769
5908
  this.meetingFiniteStateMachine.reset();
5770
5909
  }
5771
5910
 
5772
- // @ts-ignore
5773
- this.webex.internal.newMetrics.submitClientEvent({
5774
- name: 'client.call.initiated',
5775
- payload: {
5776
- trigger: this.callStateForMetrics.joinTrigger || 'user-interaction',
5777
- isRoapCallEnabled: true,
5778
- pstnAudioType: options === null || options === void 0 ? void 0 : options.pstnAudioType
5779
- },
5780
- options: {
5781
- meetingId: this.id
5782
- }
5783
- });
5911
+ // send client.call.initiated unless told not to
5912
+ if (options.sendCallInitiated !== false) {
5913
+ // @ts-ignore
5914
+ this.webex.internal.newMetrics.submitClientEvent({
5915
+ name: 'client.call.initiated',
5916
+ payload: {
5917
+ trigger: this.callStateForMetrics.joinTrigger || 'user-interaction',
5918
+ isRoapCallEnabled: true,
5919
+ pstnAudioType: options === null || options === void 0 ? void 0 : options.pstnAudioType
5920
+ },
5921
+ options: {
5922
+ meetingId: this.id
5923
+ }
5924
+ });
5925
+ }
5784
5926
  _loggerProxy.default.logger.log('Meeting:index#join --> Joining a meeting');
5785
5927
  if (this.meetingFiniteStateMachine.state === _constants.MEETING_STATE_MACHINE.STATES.ENDED) {
5786
5928
  this.meetingFiniteStateMachine.reset();
@@ -5794,131 +5936,131 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
5794
5936
  this.wirelessShare = true;
5795
5937
  }
5796
5938
  if (!options.meetingQuality) {
5797
- _context18.next = 36;
5939
+ _context19.next = 36;
5798
5940
  break;
5799
5941
  }
5800
5942
  if (!(typeof options.meetingQuality === 'string')) {
5801
- _context18.next = 27;
5943
+ _context19.next = 27;
5802
5944
  break;
5803
5945
  }
5804
5946
  if (_constants.QUALITY_LEVELS[options.meetingQuality]) {
5805
- _context18.next = 26;
5947
+ _context19.next = 26;
5806
5948
  break;
5807
5949
  }
5808
- _errorMessage = "Meeting:index#join --> ".concat(options.meetingQuality, " not defined");
5809
- _error = new Error(_errorMessage);
5810
- _loggerProxy.default.logger.error(_errorMessage);
5811
- joinFailed(_error);
5950
+ _errorMessage2 = "Meeting:index#join --> ".concat(options.meetingQuality, " not defined");
5951
+ _error2 = new Error(_errorMessage2);
5952
+ _loggerProxy.default.logger.error(_errorMessage2);
5953
+ joinFailed(_error2);
5812
5954
  this.deferJoin = undefined;
5813
- return _context18.abrupt("return", _promise.default.reject(_error));
5955
+ return _context19.abrupt("return", _promise.default.reject(_error2));
5814
5956
  case 26:
5815
5957
  this.mediaProperties.setRemoteQualityLevel(options.meetingQuality);
5816
5958
  case 27:
5817
5959
  if (!((0, _typeof2.default)(options.meetingQuality) === 'object')) {
5818
- _context18.next = 36;
5960
+ _context19.next = 36;
5819
5961
  break;
5820
5962
  }
5821
5963
  if (_constants.QUALITY_LEVELS[options.meetingQuality.remote]) {
5822
- _context18.next = 35;
5964
+ _context19.next = 35;
5823
5965
  break;
5824
5966
  }
5825
- _errorMessage2 = "Meeting:index#join --> ".concat(options.meetingQuality.remote, " not defined");
5826
- _loggerProxy.default.logger.error(_errorMessage2);
5827
- _error2 = new Error(_errorMessage2);
5828
- joinFailed(_error2);
5967
+ _errorMessage3 = "Meeting:index#join --> ".concat(options.meetingQuality.remote, " not defined");
5968
+ _loggerProxy.default.logger.error(_errorMessage3);
5969
+ _error3 = new Error(_errorMessage3);
5970
+ joinFailed(_error3);
5829
5971
  this.deferJoin = undefined;
5830
- return _context18.abrupt("return", _promise.default.reject(new Error(_errorMessage2)));
5972
+ return _context19.abrupt("return", _promise.default.reject(new Error(_errorMessage3)));
5831
5973
  case 35:
5832
5974
  if (options.meetingQuality.remote) {
5833
5975
  this.mediaProperties.setRemoteQualityLevel(options.meetingQuality.remote);
5834
5976
  }
5835
5977
  case 36:
5836
5978
  this.isMultistream = !!options.enableMultistream;
5837
- _context18.prev = 37;
5838
- _context18.next = 40;
5979
+ _context19.prev = 37;
5980
+ _context19.next = 40;
5839
5981
  return this.checkAndRefreshPermissionToken(_constants.MEETING_PERMISSION_TOKEN_REFRESH_THRESHOLD_IN_SEC, _constants.MEETING_PERMISSION_TOKEN_REFRESH_REASON);
5840
5982
  case 40:
5841
- _context18.next = 51;
5983
+ _context19.next = 51;
5842
5984
  break;
5843
5985
  case 42:
5844
- _context18.prev = 42;
5845
- _context18.t0 = _context18["catch"](37);
5846
- _loggerProxy.default.logger.error('Meeting:index#join --> Failed to refresh permission token:', _context18.t0);
5847
- if (!(_context18.t0 instanceof _captchaError.default || _context18.t0 instanceof _passwordError.default || _context18.t0 instanceof _permission.default)) {
5848
- _context18.next = 51;
5986
+ _context19.prev = 42;
5987
+ _context19.t0 = _context19["catch"](37);
5988
+ _loggerProxy.default.logger.error('Meeting:index#join --> Failed to refresh permission token:', _context19.t0);
5989
+ if (!(_context19.t0 instanceof _captchaError.default || _context19.t0 instanceof _passwordError.default || _context19.t0 instanceof _permission.default)) {
5990
+ _context19.next = 51;
5849
5991
  break;
5850
5992
  }
5851
- this.meetingFiniteStateMachine.fail(_context18.t0);
5993
+ this.meetingFiniteStateMachine.fail(_context19.t0);
5852
5994
 
5853
5995
  // Upload logs on refreshpermissionToken refresh Failure
5854
5996
  _triggerProxy.default.trigger(this, {
5855
5997
  file: 'meeting/index',
5856
5998
  function: 'join'
5857
5999
  }, _constants.EVENTS.REQUEST_UPLOAD_LOGS, this);
5858
- joinFailed(_context18.t0);
6000
+ joinFailed(_context19.t0);
5859
6001
  this.deferJoin = undefined;
5860
6002
 
5861
6003
  // if refresh permission token requires captcha, password or permission, we are throwing the errors
5862
6004
  // and bubble it up to client
5863
- return _context18.abrupt("return", _promise.default.reject(_context18.t0));
6005
+ return _context19.abrupt("return", _promise.default.reject(_context19.t0));
5864
6006
  case 51:
5865
- return _context18.abrupt("return", _util2.default.joinMeetingOptions(this, options).then(function (join) {
5866
- _this34.meetingFiniteStateMachine.join();
5867
- _this34.setupLocusMediaRequest();
6007
+ return _context19.abrupt("return", _util2.default.joinMeetingOptions(this, options).then(function (join) {
6008
+ _this35.meetingFiniteStateMachine.join();
6009
+ _this35.setupLocusMediaRequest();
5868
6010
 
5869
6011
  // @ts-ignore
5870
- _this34.webex.internal.device.meetingStarted();
5871
- (0, _classPrivateFieldSet2.default)(_this34, _isoLocalClientMeetingJoinTime, new Date().toISOString());
6012
+ _this35.webex.internal.device.meetingStarted();
6013
+ (0, _classPrivateFieldSet2.default)(_this35, _isoLocalClientMeetingJoinTime, new Date().toISOString());
5872
6014
  _loggerProxy.default.logger.log('Meeting:index#join --> Success');
5873
6015
  _metrics.default.sendBehavioralMetric(_constants2.default.JOIN_SUCCESS, {
5874
- correlation_id: _this34.correlationId
6016
+ correlation_id: _this35.correlationId
5875
6017
  });
5876
6018
  joinSuccess(join);
5877
- _this34.deferJoin = undefined;
6019
+ _this35.deferJoin = undefined;
5878
6020
  return join;
5879
6021
  }).catch(function (error) {
5880
- var _this34$meetingInfo, _error$error;
5881
- _this34.meetingFiniteStateMachine.fail(error);
6022
+ var _this35$meetingInfo, _error$error;
6023
+ _this35.meetingFiniteStateMachine.fail(error);
5882
6024
  _loggerProxy.default.logger.error('Meeting:index#join --> Failed', error);
5883
6025
 
5884
6026
  // @ts-ignore
5885
- _this34.webex.internal.newMetrics.submitClientEvent({
6027
+ _this35.webex.internal.newMetrics.submitClientEvent({
5886
6028
  name: 'client.locus.join.response',
5887
6029
  payload: {
5888
6030
  identifiers: {
5889
- meetingLookupUrl: (_this34$meetingInfo = _this34.meetingInfo) === null || _this34$meetingInfo === void 0 ? void 0 : _this34$meetingInfo.meetingLookupUrl
6031
+ meetingLookupUrl: (_this35$meetingInfo = _this35.meetingInfo) === null || _this35$meetingInfo === void 0 ? void 0 : _this35$meetingInfo.meetingLookupUrl
5890
6032
  }
5891
6033
  },
5892
6034
  options: {
5893
- meetingId: _this34.id,
6035
+ meetingId: _this35.id,
5894
6036
  rawError: error
5895
6037
  }
5896
6038
  });
5897
6039
 
5898
6040
  // TODO: change this to error codes and pre defined dictionary
5899
6041
  _metrics.default.sendBehavioralMetric(_constants2.default.JOIN_FAILURE, {
5900
- correlation_id: _this34.correlationId,
6042
+ correlation_id: _this35.correlationId,
5901
6043
  reason: (_error$error = error.error) === null || _error$error === void 0 ? void 0 : _error$error.message,
5902
6044
  stack: error.stack
5903
6045
  });
5904
6046
 
5905
6047
  // Upload logs on join Failure
5906
- _triggerProxy.default.trigger(_this34, {
6048
+ _triggerProxy.default.trigger(_this35, {
5907
6049
  file: 'meeting/index',
5908
6050
  function: 'join'
5909
- }, _constants.EVENTS.REQUEST_UPLOAD_LOGS, _this34);
6051
+ }, _constants.EVENTS.REQUEST_UPLOAD_LOGS, _this35);
5910
6052
  joinFailed(error);
5911
- _this34.deferJoin = undefined;
6053
+ _this35.deferJoin = undefined;
5912
6054
  return _promise.default.reject(error);
5913
6055
  }).then(function (join) {
5914
6056
  // @ts-ignore - config coming from registerPlugin
5915
- if (_this34.config.enableAutomaticLLM) {
6057
+ if (_this35.config.enableAutomaticLLM) {
5916
6058
  // @ts-ignore
5917
- _this34.webex.internal.llm.on('online', _this34.handleLLMOnline);
5918
- _this34.updateLLMConnection().catch(function (error) {
6059
+ _this35.webex.internal.llm.on('online', _this35.handleLLMOnline);
6060
+ _this35.updateLLMConnection().catch(function (error) {
5919
6061
  _loggerProxy.default.logger.error('Meeting:index#join --> Transcription Socket Connection Failed', error);
5920
6062
  _metrics.default.sendBehavioralMetric(_constants2.default.LLM_CONNECTION_AFTER_JOIN_FAILURE, {
5921
- correlation_id: _this34.correlationId,
6063
+ correlation_id: _this35.correlationId,
5922
6064
  reason: error === null || error === void 0 ? void 0 : error.message,
5923
6065
  stack: error.stack
5924
6066
  });
@@ -5930,9 +6072,9 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
5930
6072
  }));
5931
6073
  case 52:
5932
6074
  case "end":
5933
- return _context18.stop();
6075
+ return _context19.stop();
5934
6076
  }
5935
- }, _callee18, this, [[37, 42]]);
6077
+ }, _callee19, this, [[37, 42]]);
5936
6078
  }));
5937
6079
  function join() {
5938
6080
  return _join.apply(this, arguments);
@@ -5949,54 +6091,55 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
5949
6091
  }, {
5950
6092
  key: "updateLLMConnection",
5951
6093
  value: (function () {
5952
- var _updateLLMConnection = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee19() {
5953
- var _this35 = this;
5954
- var _this$locusInfo6, url, _this$locusInfo6$info, _this$locusInfo6$info2, datachannelUrl, isJoined;
5955
- return _regenerator.default.wrap(function _callee19$(_context19) {
5956
- while (1) switch (_context19.prev = _context19.next) {
6094
+ var _updateLLMConnection = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee20() {
6095
+ var _this36 = this;
6096
+ var _this$locusInfo6, url, _this$locusInfo6$info, _this$locusInfo6$info2, datachannelUrl, practiceSessionDatachannelUrl, isJoined, dataChannelUrl;
6097
+ return _regenerator.default.wrap(function _callee20$(_context20) {
6098
+ while (1) switch (_context20.prev = _context20.next) {
5957
6099
  case 0:
5958
6100
  // @ts-ignore - Fix type
5959
- _this$locusInfo6 = this.locusInfo, url = _this$locusInfo6.url, _this$locusInfo6$info = _this$locusInfo6.info, _this$locusInfo6$info2 = _this$locusInfo6$info === void 0 ? {} : _this$locusInfo6$info, datachannelUrl = _this$locusInfo6$info2.datachannelUrl;
5960
- isJoined = this.isJoined(); // @ts-ignore - Fix type
6101
+ _this$locusInfo6 = this.locusInfo, url = _this$locusInfo6.url, _this$locusInfo6$info = _this$locusInfo6.info, _this$locusInfo6$info2 = _this$locusInfo6$info === void 0 ? {} : _this$locusInfo6$info, datachannelUrl = _this$locusInfo6$info2.datachannelUrl, practiceSessionDatachannelUrl = _this$locusInfo6$info2.practiceSessionDatachannelUrl;
6102
+ isJoined = this.isJoined(); // webinar panelist should use new data channel in practice session
6103
+ dataChannelUrl = this.webinar.isJoinPracticeSessionDataChannel() && practiceSessionDatachannelUrl ? practiceSessionDatachannelUrl : datachannelUrl; // @ts-ignore - Fix type
5961
6104
  if (!this.webex.internal.llm.isConnected()) {
5962
- _context19.next = 8;
6105
+ _context20.next = 9;
5963
6106
  break;
5964
6107
  }
5965
6108
  if (!(
5966
6109
  // @ts-ignore - Fix type
5967
6110
  url === this.webex.internal.llm.getLocusUrl() &&
5968
6111
  // @ts-ignore - Fix type
5969
- datachannelUrl === this.webex.internal.llm.getDatachannelUrl() && isJoined)) {
5970
- _context19.next = 5;
6112
+ dataChannelUrl === this.webex.internal.llm.getDatachannelUrl() && isJoined)) {
6113
+ _context20.next = 6;
5971
6114
  break;
5972
6115
  }
5973
- return _context19.abrupt("return", undefined);
5974
- case 5:
5975
- _context19.next = 7;
6116
+ return _context20.abrupt("return", undefined);
6117
+ case 6:
6118
+ _context20.next = 8;
5976
6119
  return this.webex.internal.llm.disconnectLLM();
5977
- case 7:
6120
+ case 8:
5978
6121
  // @ts-ignore - Fix type
5979
6122
  this.webex.internal.llm.off('event:relay.event', this.processRelayEvent);
5980
- case 8:
6123
+ case 9:
5981
6124
  if (isJoined) {
5982
- _context19.next = 10;
6125
+ _context20.next = 11;
5983
6126
  break;
5984
6127
  }
5985
- return _context19.abrupt("return", undefined);
5986
- case 10:
5987
- return _context19.abrupt("return", this.webex.internal.llm.registerAndConnect(url, datachannelUrl).then(function (registerAndConnectResult) {
6128
+ return _context20.abrupt("return", undefined);
6129
+ case 11:
6130
+ return _context20.abrupt("return", this.webex.internal.llm.registerAndConnect(url, dataChannelUrl).then(function (registerAndConnectResult) {
5988
6131
  // @ts-ignore - Fix type
5989
- _this35.webex.internal.llm.off('event:relay.event', _this35.processRelayEvent);
6132
+ _this36.webex.internal.llm.off('event:relay.event', _this36.processRelayEvent);
5990
6133
  // @ts-ignore - Fix type
5991
- _this35.webex.internal.llm.on('event:relay.event', _this35.processRelayEvent);
6134
+ _this36.webex.internal.llm.on('event:relay.event', _this36.processRelayEvent);
5992
6135
  _loggerProxy.default.logger.info('Meeting:index#updateLLMConnection --> enabled to receive relay events!');
5993
6136
  return _promise.default.resolve(registerAndConnectResult);
5994
6137
  }));
5995
- case 11:
6138
+ case 12:
5996
6139
  case "end":
5997
- return _context19.stop();
6140
+ return _context20.stop();
5998
6141
  }
5999
- }, _callee19, this);
6142
+ }, _callee20, this);
6000
6143
  }));
6001
6144
  function updateLLMConnection() {
6002
6145
  return _updateLLMConnection.apply(this, arguments);
@@ -6042,7 +6185,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
6042
6185
  }, {
6043
6186
  key: "dialInPstn",
6044
6187
  value: function dialInPstn() {
6045
- var _this36 = this;
6188
+ var _this37 = this;
6046
6189
  if (this.isPhoneProvisioned(this.dialInDeviceStatus)) return _promise.default.resolve(); // prevent multiple dial in devices from being provisioned
6047
6190
 
6048
6191
  var correlationId = this.correlationId,
@@ -6058,10 +6201,10 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
6058
6201
  }).catch(function (error) {
6059
6202
  var _error$error2;
6060
6203
  _metrics.default.sendBehavioralMetric(_constants2.default.ADD_DIAL_IN_FAILURE, {
6061
- correlation_id: _this36.correlationId,
6062
- dial_in_url: _this36.dialInUrl,
6204
+ correlation_id: _this37.correlationId,
6205
+ dial_in_url: _this37.dialInUrl,
6063
6206
  locus_id: locusUrl.split('/').pop(),
6064
- client_url: _this36.deviceUrl,
6207
+ client_url: _this37.deviceUrl,
6065
6208
  reason: (_error$error2 = error.error) === null || _error$error2 === void 0 ? void 0 : _error$error2.message,
6066
6209
  stack: error.stack
6067
6210
  });
@@ -6079,7 +6222,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
6079
6222
  }, {
6080
6223
  key: "dialOutPstn",
6081
6224
  value: function dialOutPstn(phoneNumber) {
6082
- var _this37 = this;
6225
+ var _this38 = this;
6083
6226
  if (this.isPhoneProvisioned(this.dialOutDeviceStatus)) return _promise.default.resolve(); // prevent multiple dial out devices from being provisioned
6084
6227
 
6085
6228
  var correlationId = this.correlationId,
@@ -6096,10 +6239,10 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
6096
6239
  }).catch(function (error) {
6097
6240
  var _error$error3;
6098
6241
  _metrics.default.sendBehavioralMetric(_constants2.default.ADD_DIAL_OUT_FAILURE, {
6099
- correlation_id: _this37.correlationId,
6100
- dial_out_url: _this37.dialOutUrl,
6242
+ correlation_id: _this38.correlationId,
6243
+ dial_out_url: _this38.dialOutUrl,
6101
6244
  locus_id: locusUrl.split('/').pop(),
6102
- client_url: _this37.deviceUrl,
6245
+ client_url: _this38.deviceUrl,
6103
6246
  reason: (_error$error3 = error.error) === null || _error$error3 === void 0 ? void 0 : _error$error3.message,
6104
6247
  stack: error.stack
6105
6248
  });
@@ -6130,7 +6273,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
6130
6273
  }, {
6131
6274
  key: "moveTo",
6132
6275
  value: function moveTo(resourceId) {
6133
- var _this38 = this;
6276
+ var _this39 = this;
6134
6277
  if (!resourceId) {
6135
6278
  throw new _parameter.default('Cannot move call without a resourceId.');
6136
6279
  }
@@ -6168,18 +6311,18 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
6168
6311
  meetingId: this.id
6169
6312
  }
6170
6313
  });
6171
- this.locusInfo.once(_constants.LOCUSINFO.EVENTS.SELF_OBSERVING, /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee20() {
6314
+ this.locusInfo.once(_constants.LOCUSINFO.EVENTS.SELF_OBSERVING, /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee21() {
6172
6315
  var mediaSettings;
6173
- return _regenerator.default.wrap(function _callee20$(_context20) {
6174
- while (1) switch (_context20.prev = _context20.next) {
6316
+ return _regenerator.default.wrap(function _callee21$(_context21) {
6317
+ while (1) switch (_context21.prev = _context21.next) {
6175
6318
  case 0:
6176
- _context20.prev = 0;
6177
- if (!(_this38.screenShareFloorState === ScreenShareFloorStatus.GRANTED)) {
6178
- _context20.next = 4;
6319
+ _context21.prev = 0;
6320
+ if (!(_this39.screenShareFloorState === ScreenShareFloorStatus.GRANTED)) {
6321
+ _context21.next = 4;
6179
6322
  break;
6180
6323
  }
6181
- _context20.next = 4;
6182
- return _this38.releaseScreenShareFloor();
6324
+ _context21.next = 4;
6325
+ return _this39.releaseScreenShareFloor();
6183
6326
  case 4:
6184
6327
  mediaSettings = {
6185
6328
  mediaDirection: {
@@ -6191,55 +6334,55 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
6191
6334
  receiveShare: true
6192
6335
  }
6193
6336
  };
6194
- _this38.mediaProperties.setMediaDirection(mediaSettings.mediaDirection);
6195
- _this38.mediaProperties.unsetRemoteMedia();
6337
+ _this39.mediaProperties.setMediaDirection(mediaSettings.mediaDirection);
6338
+ _this39.mediaProperties.unsetRemoteMedia();
6196
6339
 
6197
6340
  // 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
6198
6341
  // once the device answers we close the old connection and create new media server connection with only share enabled
6199
- if (!_this38.statsAnalyzer) {
6200
- _context20.next = 10;
6342
+ if (!_this39.statsAnalyzer) {
6343
+ _context21.next = 10;
6201
6344
  break;
6202
6345
  }
6203
- _context20.next = 10;
6204
- return _this38.statsAnalyzer.stopAnalyzer();
6346
+ _context21.next = 10;
6347
+ return _this39.statsAnalyzer.stopAnalyzer();
6205
6348
  case 10:
6206
- _context20.next = 12;
6207
- return _this38.closeRemoteStreams();
6349
+ _context21.next = 12;
6350
+ return _this39.closeRemoteStreams();
6208
6351
  case 12:
6209
- _context20.next = 14;
6210
- return _this38.closePeerConnections();
6352
+ _context21.next = 14;
6353
+ return _this39.closePeerConnections();
6211
6354
  case 14:
6212
- _this38.cleanupLocalStreams();
6213
- _this38.unsetRemoteStreams();
6214
- _this38.unsetPeerConnections();
6215
- _this38.reconnectionManager.cleanUp();
6216
- _context20.next = 20;
6217
- return _this38.addMedia({
6355
+ _this39.cleanupLocalStreams();
6356
+ _this39.unsetRemoteStreams();
6357
+ _this39.unsetPeerConnections();
6358
+ _this39.reconnectionManager.cleanUp();
6359
+ _context21.next = 20;
6360
+ return _this39.addMedia({
6218
6361
  audioEnabled: false,
6219
6362
  videoEnabled: false,
6220
6363
  shareVideoEnabled: true
6221
6364
  });
6222
6365
  case 20:
6223
6366
  _metrics.default.sendBehavioralMetric(_constants2.default.MOVE_TO_SUCCESS);
6224
- _this38.isMoveToInProgress = false;
6225
- _context20.next = 29;
6367
+ _this39.isMoveToInProgress = false;
6368
+ _context21.next = 29;
6226
6369
  break;
6227
6370
  case 24:
6228
- _context20.prev = 24;
6229
- _context20.t0 = _context20["catch"](0);
6230
- _loggerProxy.default.logger.error('Meeting:index#moveTo --> Failed to moveTo resourceId', _context20.t0);
6371
+ _context21.prev = 24;
6372
+ _context21.t0 = _context21["catch"](0);
6373
+ _loggerProxy.default.logger.error('Meeting:index#moveTo --> Failed to moveTo resourceId', _context21.t0);
6231
6374
  _metrics.default.sendBehavioralMetric(_constants2.default.MOVE_TO_FAILURE, {
6232
- correlation_id: _this38.correlationId,
6233
- locus_id: _this38.locusUrl.split('/').pop(),
6234
- reason: _context20.t0.message,
6235
- stack: _context20.t0.stack
6375
+ correlation_id: _this39.correlationId,
6376
+ locus_id: _this39.locusUrl.split('/').pop(),
6377
+ reason: _context21.t0.message,
6378
+ stack: _context21.t0.stack
6236
6379
  });
6237
- _this38.isMoveToInProgress = false;
6380
+ _this39.isMoveToInProgress = false;
6238
6381
  case 29:
6239
6382
  case "end":
6240
- return _context20.stop();
6383
+ return _context21.stop();
6241
6384
  }
6242
- }, _callee20, null, [[0, 24]]);
6385
+ }, _callee21, null, [[0, 24]]);
6243
6386
  })));
6244
6387
  _loggerProxy.default.logger.info('Meeting:index#moveTo --> Initated moved to using resourceId', resourceId);
6245
6388
 
@@ -6250,17 +6393,17 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
6250
6393
  resourceId: resourceId,
6251
6394
  moveToResource: true
6252
6395
  }).then(function () {
6253
- _this38.meetingFiniteStateMachine.join();
6396
+ _this39.meetingFiniteStateMachine.join();
6254
6397
  }).catch(function (error) {
6255
- _this38.meetingFiniteStateMachine.fail(error);
6398
+ _this39.meetingFiniteStateMachine.fail(error);
6256
6399
  _metrics.default.sendBehavioralMetric(_constants2.default.MOVE_TO_FAILURE, {
6257
- correlation_id: _this38.correlationId,
6258
- locus_id: _this38.locusUrl.split('/').pop(),
6400
+ correlation_id: _this39.correlationId,
6401
+ locus_id: _this39.locusUrl.split('/').pop(),
6259
6402
  reason: error.message,
6260
6403
  stack: error.stack
6261
6404
  });
6262
6405
  _loggerProxy.default.logger.error('Meeting:index#moveTo --> Failed to moveTo resourceId', error);
6263
- _this38.isMoveToInProgress = false;
6406
+ _this39.isMoveToInProgress = false;
6264
6407
  return _promise.default.reject(error);
6265
6408
  });
6266
6409
  }
@@ -6275,7 +6418,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
6275
6418
  }, {
6276
6419
  key: "moveFrom",
6277
6420
  value: function moveFrom(resourceId) {
6278
- var _this39 = this;
6421
+ var _this40 = this;
6279
6422
  // On moveFrom ask the developer to re capture it moveFrom then updateMedia
6280
6423
  if (!resourceId) {
6281
6424
  throw new _parameter.default('Cannot move call without a resourceId.');
@@ -6290,19 +6433,19 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
6290
6433
  }
6291
6434
  });
6292
6435
  return _util2.default.joinMeetingOptions(this).then(function () {
6293
- return _util2.default.leaveMeeting(_this39, {
6436
+ return _util2.default.leaveMeeting(_this40, {
6294
6437
  resourceId: resourceId,
6295
6438
  correlationId: oldCorrelationId,
6296
6439
  moveMeeting: true
6297
6440
  }).then(function () {
6298
- _this39.resourceId = '';
6441
+ _this40.resourceId = '';
6299
6442
  _metrics.default.sendBehavioralMetric(_constants2.default.MOVE_FROM_SUCCESS);
6300
6443
  });
6301
6444
  }).catch(function (error) {
6302
- _this39.meetingFiniteStateMachine.fail(error);
6445
+ _this40.meetingFiniteStateMachine.fail(error);
6303
6446
  _metrics.default.sendBehavioralMetric(_constants2.default.MOVE_FROM_FAILURE, {
6304
- correlation_id: _this39.correlationId,
6305
- locus_id: _this39.locusUrl.split('/').pop(),
6447
+ correlation_id: _this40.correlationId,
6448
+ locus_id: _this40.locusUrl.split('/').pop(),
6306
6449
  reason: error.message,
6307
6450
  stack: error.stack
6308
6451
  });
@@ -6327,10 +6470,10 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
6327
6470
  }, {
6328
6471
  key: "createMediaConnection",
6329
6472
  value: (function () {
6330
- var _createMediaConnection = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee21(turnServerInfo, bundlePolicy) {
6473
+ var _createMediaConnection = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee22(turnServerInfo, bundlePolicy) {
6331
6474
  var mc, audioEnabled, videoEnabled, shareEnabled;
6332
- return _regenerator.default.wrap(function _callee21$(_context21) {
6333
- while (1) switch (_context21.prev = _context21.next) {
6475
+ return _regenerator.default.wrap(function _callee22$(_context22) {
6476
+ while (1) switch (_context22.prev = _context22.next) {
6334
6477
  case 0:
6335
6478
  this.rtcMetrics = this.isMultistream ?
6336
6479
  // @ts-ignore
@@ -6362,42 +6505,42 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
6362
6505
 
6363
6506
  // publish the streams
6364
6507
  if (!this.mediaProperties.audioStream) {
6365
- _context21.next = 9;
6508
+ _context22.next = 9;
6366
6509
  break;
6367
6510
  }
6368
6511
  this.setSendNamedMediaGroup(_internalMediaCore.MediaType.AudioMain);
6369
- _context21.next = 9;
6512
+ _context22.next = 9;
6370
6513
  return this.publishStream(_internalMediaCore.MediaType.AudioMain, this.mediaProperties.audioStream);
6371
6514
  case 9:
6372
6515
  if (!this.mediaProperties.videoStream) {
6373
- _context21.next = 12;
6516
+ _context22.next = 12;
6374
6517
  break;
6375
6518
  }
6376
- _context21.next = 12;
6519
+ _context22.next = 12;
6377
6520
  return this.publishStream(_internalMediaCore.MediaType.VideoMain, this.mediaProperties.videoStream);
6378
6521
  case 12:
6379
6522
  if (!this.mediaProperties.shareVideoStream) {
6380
- _context21.next = 15;
6523
+ _context22.next = 15;
6381
6524
  break;
6382
6525
  }
6383
- _context21.next = 15;
6526
+ _context22.next = 15;
6384
6527
  return this.publishStream(_internalMediaCore.MediaType.VideoSlides, this.mediaProperties.shareVideoStream);
6385
6528
  case 15:
6386
6529
  if (!(this.isMultistream && this.mediaProperties.shareAudioStream)) {
6387
- _context21.next = 18;
6530
+ _context22.next = 18;
6388
6531
  break;
6389
6532
  }
6390
- _context21.next = 18;
6533
+ _context22.next = 18;
6391
6534
  return this.publishStream(_internalMediaCore.MediaType.AudioSlides, this.mediaProperties.shareAudioStream);
6392
6535
  case 18:
6393
- return _context21.abrupt("return", mc);
6536
+ return _context22.abrupt("return", mc);
6394
6537
  case 19:
6395
6538
  case "end":
6396
- return _context21.stop();
6539
+ return _context22.stop();
6397
6540
  }
6398
- }, _callee21, this);
6541
+ }, _callee22, this);
6399
6542
  }));
6400
- function createMediaConnection(_x16, _x17) {
6543
+ function createMediaConnection(_x17, _x18) {
6401
6544
  return _createMediaConnection.apply(this, arguments);
6402
6545
  }
6403
6546
  return createMediaConnection;
@@ -6415,9 +6558,9 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
6415
6558
  }, {
6416
6559
  key: "forwardEvent",
6417
6560
  value: function forwardEvent(eventEmitter, eventTypeToForward, meetingEventType) {
6418
- var _this40 = this;
6561
+ var _this41 = this;
6419
6562
  eventEmitter.on(eventTypeToForward, function (data) {
6420
- return _triggerProxy.default.trigger(_this40, {
6563
+ return _triggerProxy.default.trigger(_this41, {
6421
6564
  file: 'meetings',
6422
6565
  function: 'addMedia'
6423
6566
  }, meetingEventType, data);
@@ -6435,11 +6578,11 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
6435
6578
  }, {
6436
6579
  key: "setUpLocalStreamReferences",
6437
6580
  value: (function () {
6438
- var _setUpLocalStreamReferences = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee22(localStreams) {
6581
+ var _setUpLocalStreamReferences = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee23(localStreams) {
6439
6582
  var _localStreams$microph, _localStreams$camera, _localStreams$screenS, _localStreams$screenS2, _localStreams$screenS3, _localStreams$screenS4, _localStreams$screenS5, _localStreams$screenS6;
6440
6583
  var setUpStreamPromises;
6441
- return _regenerator.default.wrap(function _callee22$(_context22) {
6442
- while (1) switch (_context22.prev = _context22.next) {
6584
+ return _regenerator.default.wrap(function _callee23$(_context23) {
6585
+ while (1) switch (_context23.prev = _context23.next) {
6443
6586
  case 0:
6444
6587
  setUpStreamPromises = [];
6445
6588
  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') {
@@ -6454,24 +6597,24 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
6454
6597
  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') {
6455
6598
  setUpStreamPromises.push(this.setLocalShareAudioStream(localStreams.screenShare.audio));
6456
6599
  }
6457
- _context22.prev = 5;
6458
- _context22.next = 8;
6600
+ _context23.prev = 5;
6601
+ _context23.next = 8;
6459
6602
  return _promise.default.all(setUpStreamPromises);
6460
6603
  case 8:
6461
- _context22.next = 14;
6604
+ _context23.next = 14;
6462
6605
  break;
6463
6606
  case 10:
6464
- _context22.prev = 10;
6465
- _context22.t0 = _context22["catch"](5);
6466
- _loggerProxy.default.logger.error("Meeting:index#addMedia():setUpLocalStreamReferences --> Error , ", _context22.t0);
6467
- throw _context22.t0;
6607
+ _context23.prev = 10;
6608
+ _context23.t0 = _context23["catch"](5);
6609
+ _loggerProxy.default.logger.error("Meeting:index#addMedia():setUpLocalStreamReferences --> Error , ", _context23.t0);
6610
+ throw _context23.t0;
6468
6611
  case 14:
6469
6612
  case "end":
6470
- return _context22.stop();
6613
+ return _context23.stop();
6471
6614
  }
6472
- }, _callee22, this, [[5, 10]]);
6615
+ }, _callee23, this, [[5, 10]]);
6473
6616
  }));
6474
- function setUpLocalStreamReferences(_x18) {
6617
+ function setUpLocalStreamReferences(_x19) {
6475
6618
  return _setUpLocalStreamReferences.apply(this, arguments);
6476
6619
  }
6477
6620
  return setUpLocalStreamReferences;
@@ -6486,72 +6629,72 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
6486
6629
  }, {
6487
6630
  key: "waitForMediaConnectionConnected",
6488
6631
  value: (function () {
6489
- var _waitForMediaConnectionConnected = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee23() {
6490
- var iceConnected, _this$mediaProperties6, _this$mediaProperties7, _this$mediaProperties8, _this$mediaProperties9, _this$mediaProperties10, _this$mediaProperties11, _this$mediaProperties12;
6491
- return _regenerator.default.wrap(function _callee23$(_context23) {
6492
- while (1) switch (_context23.prev = _context23.next) {
6632
+ var _waitForMediaConnectionConnected = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee24() {
6633
+ var iceConnected, _this$mediaProperties8, _this$mediaProperties9, _this$mediaProperties10, _this$mediaProperties11, _this$mediaProperties12, _this$mediaProperties13, _this$mediaProperties14;
6634
+ return _regenerator.default.wrap(function _callee24$(_context24) {
6635
+ while (1) switch (_context24.prev = _context24.next) {
6493
6636
  case 0:
6494
- _context23.prev = 0;
6495
- _context23.next = 3;
6637
+ _context24.prev = 0;
6638
+ _context24.next = 3;
6496
6639
  return this.mediaProperties.waitForMediaConnectionConnected();
6497
6640
  case 3:
6498
- _context23.next = 30;
6641
+ _context24.next = 30;
6499
6642
  break;
6500
6643
  case 5:
6501
- _context23.prev = 5;
6502
- _context23.t0 = _context23["catch"](0);
6503
- iceConnected = _context23.t0.iceConnected;
6644
+ _context24.prev = 5;
6645
+ _context24.t0 = _context24["catch"](0);
6646
+ iceConnected = _context24.t0.iceConnected;
6504
6647
  if (this.hasMediaConnectionConnectedAtLeastOnce) {
6505
- _context23.next = 29;
6648
+ _context24.next = 29;
6506
6649
  break;
6507
6650
  }
6508
- _context23.t1 = this.webex.internal.newMetrics;
6509
- _context23.t2 = !this.turnServerUsed;
6510
- _context23.t3 = this.addMediaData.icePhaseCallback();
6511
- _context23.t4 = this.webex.internal.newMetrics.callDiagnosticMetrics;
6512
- _context23.t5 = _internalPluginMetrics.CallDiagnosticUtils;
6513
- _context23.t6 = ((_this$mediaProperties6 = this.mediaProperties.webrtcMediaConnection) === null || _this$mediaProperties6 === void 0 ? void 0 : (_this$mediaProperties7 = _this$mediaProperties6.multistreamConnection) === null || _this$mediaProperties7 === void 0 ? void 0 : (_this$mediaProperties8 = _this$mediaProperties7.pc) === null || _this$mediaProperties8 === void 0 ? void 0 : (_this$mediaProperties9 = _this$mediaProperties8.pc) === null || _this$mediaProperties9 === void 0 ? void 0 : _this$mediaProperties9.signalingState) || ((_this$mediaProperties10 = this.mediaProperties.webrtcMediaConnection) === null || _this$mediaProperties10 === void 0 ? void 0 : (_this$mediaProperties11 = _this$mediaProperties10.mediaConnection) === null || _this$mediaProperties11 === void 0 ? void 0 : (_this$mediaProperties12 = _this$mediaProperties11.pc) === null || _this$mediaProperties12 === void 0 ? void 0 : _this$mediaProperties12.signalingState) || 'unknown';
6514
- _context23.t7 = iceConnected;
6515
- _context23.t8 = this.turnServerUsed;
6516
- _context23.next = 19;
6651
+ _context24.t1 = this.webex.internal.newMetrics;
6652
+ _context24.t2 = !this.turnServerUsed;
6653
+ _context24.t3 = this.addMediaData.icePhaseCallback();
6654
+ _context24.t4 = this.webex.internal.newMetrics.callDiagnosticMetrics;
6655
+ _context24.t5 = _internalPluginMetrics.CallDiagnosticUtils;
6656
+ _context24.t6 = ((_this$mediaProperties8 = this.mediaProperties.webrtcMediaConnection) === null || _this$mediaProperties8 === void 0 ? void 0 : (_this$mediaProperties9 = _this$mediaProperties8.multistreamConnection) === null || _this$mediaProperties9 === void 0 ? void 0 : (_this$mediaProperties10 = _this$mediaProperties9.pc) === null || _this$mediaProperties10 === void 0 ? void 0 : (_this$mediaProperties11 = _this$mediaProperties10.pc) === null || _this$mediaProperties11 === void 0 ? void 0 : _this$mediaProperties11.signalingState) || ((_this$mediaProperties12 = this.mediaProperties.webrtcMediaConnection) === null || _this$mediaProperties12 === void 0 ? void 0 : (_this$mediaProperties13 = _this$mediaProperties12.mediaConnection) === null || _this$mediaProperties13 === void 0 ? void 0 : (_this$mediaProperties14 = _this$mediaProperties13.pc) === null || _this$mediaProperties14 === void 0 ? void 0 : _this$mediaProperties14.signalingState) || 'unknown';
6657
+ _context24.t7 = iceConnected;
6658
+ _context24.t8 = this.turnServerUsed;
6659
+ _context24.next = 19;
6517
6660
  return this.webex.meetings.reachability.isWebexMediaBackendUnreachable().catch(function () {
6518
6661
  return false;
6519
6662
  });
6520
6663
  case 19:
6521
- _context23.t9 = _context23.sent;
6522
- _context23.t10 = {
6523
- signalingState: _context23.t6,
6524
- iceConnected: _context23.t7,
6525
- turnServerUsed: _context23.t8,
6526
- unreachable: _context23.t9
6664
+ _context24.t9 = _context24.sent;
6665
+ _context24.t10 = {
6666
+ signalingState: _context24.t6,
6667
+ iceConnected: _context24.t7,
6668
+ turnServerUsed: _context24.t8,
6669
+ unreachable: _context24.t9
6527
6670
  };
6528
- _context23.t11 = _context23.t5.generateClientErrorCodeForIceFailure.call(_context23.t5, _context23.t10);
6529
- _context23.t12 = {
6530
- clientErrorCode: _context23.t11
6671
+ _context24.t11 = _context24.t5.generateClientErrorCodeForIceFailure.call(_context24.t5, _context24.t10);
6672
+ _context24.t12 = {
6673
+ clientErrorCode: _context24.t11
6531
6674
  };
6532
- _context23.t13 = _context23.t4.getErrorPayloadForClientErrorCode.call(_context23.t4, _context23.t12);
6533
- _context23.t14 = [_context23.t13];
6534
- _context23.t15 = {
6535
- canProceed: _context23.t2,
6536
- icePhase: _context23.t3,
6537
- errors: _context23.t14
6675
+ _context24.t13 = _context24.t4.getErrorPayloadForClientErrorCode.call(_context24.t4, _context24.t12);
6676
+ _context24.t14 = [_context24.t13];
6677
+ _context24.t15 = {
6678
+ canProceed: _context24.t2,
6679
+ icePhase: _context24.t3,
6680
+ errors: _context24.t14
6538
6681
  };
6539
- _context23.t16 = {
6682
+ _context24.t16 = {
6540
6683
  meetingId: this.id
6541
6684
  };
6542
- _context23.t17 = {
6685
+ _context24.t17 = {
6543
6686
  name: 'client.ice.end',
6544
- payload: _context23.t15,
6545
- options: _context23.t16
6687
+ payload: _context24.t15,
6688
+ options: _context24.t16
6546
6689
  };
6547
- _context23.t1.submitClientEvent.call(_context23.t1, _context23.t17);
6690
+ _context24.t1.submitClientEvent.call(_context24.t1, _context24.t17);
6548
6691
  case 29:
6549
6692
  throw new Error("Timed out waiting for media connection to be connected, correlationId=".concat(this.correlationId));
6550
6693
  case 30:
6551
6694
  case "end":
6552
- return _context23.stop();
6695
+ return _context24.stop();
6553
6696
  }
6554
- }, _callee23, this, [[0, 5]]);
6697
+ }, _callee24, this, [[0, 5]]);
6555
6698
  }));
6556
6699
  function waitForMediaConnectionConnected() {
6557
6700
  return _waitForMediaConnectionConnected.apply(this, arguments);
@@ -6583,18 +6726,6 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
6583
6726
  }
6584
6727
  }
6585
6728
 
6586
- /**
6587
- * Handles device logging
6588
- *
6589
- * @private
6590
- * @static
6591
- * @param {boolean} isAudioEnabled
6592
- * @param {boolean} isVideoEnabled
6593
- * @returns {Promise<void>}
6594
- */
6595
- }, {
6596
- key: "waitForRemoteSDPAnswer",
6597
- value: (
6598
6729
  /**
6599
6730
  * Returns a promise. This promise is created once the local sdp offer has been successfully created and is resolved
6600
6731
  * once the remote sdp answer has been received.
@@ -6602,49 +6733,51 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
6602
6733
  * @private
6603
6734
  * @returns {Promise<void>}
6604
6735
  */
6605
- function () {
6606
- var _waitForRemoteSDPAnswer = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee24() {
6607
- var _this41 = this;
6736
+ }, {
6737
+ key: "waitForRemoteSDPAnswer",
6738
+ value: (function () {
6739
+ var _waitForRemoteSDPAnswer = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee25() {
6740
+ var _this42 = this;
6608
6741
  var LOG_HEADER, deferSDPAnswer;
6609
- return _regenerator.default.wrap(function _callee24$(_context24) {
6610
- while (1) switch (_context24.prev = _context24.next) {
6742
+ return _regenerator.default.wrap(function _callee25$(_context25) {
6743
+ while (1) switch (_context25.prev = _context25.next) {
6611
6744
  case 0:
6612
6745
  LOG_HEADER = 'Meeting:index#addMedia():waitForRemoteSDPAnswer -->';
6613
6746
  if (this.deferSDPAnswer) {
6614
- _context24.next = 4;
6747
+ _context25.next = 4;
6615
6748
  break;
6616
6749
  }
6617
6750
  _loggerProxy.default.logger.warn("".concat(LOG_HEADER, " offer not created yet"));
6618
- return _context24.abrupt("return", _promise.default.reject(new Error('waitForRemoteSDPAnswer() called before local sdp offer created')));
6751
+ return _context25.abrupt("return", _promise.default.reject(new Error('waitForRemoteSDPAnswer() called before local sdp offer created')));
6619
6752
  case 4:
6620
6753
  deferSDPAnswer = this.deferSDPAnswer;
6621
6754
  this.sdpResponseTimer = setTimeout(function () {
6622
6755
  _loggerProxy.default.logger.warn("".concat(LOG_HEADER, " timeout! no REMOTE SDP ANSWER received within ").concat(_constants.ROAP_OFFER_ANSWER_EXCHANGE_TIMEOUT / 1000, " seconds"));
6623
6756
  // @ts-ignore
6624
- _this41.webex.internal.newMetrics.submitClientEvent({
6757
+ _this42.webex.internal.newMetrics.submitClientEvent({
6625
6758
  name: 'client.media-engine.remote-sdp-received',
6626
6759
  payload: {
6627
6760
  canProceed: false,
6628
6761
  errors: [
6629
6762
  // @ts-ignore
6630
- _this41.webex.internal.newMetrics.callDiagnosticMetrics.getErrorPayloadForClientErrorCode({
6763
+ _this42.webex.internal.newMetrics.callDiagnosticMetrics.getErrorPayloadForClientErrorCode({
6631
6764
  clientErrorCode: _internalPluginMetrics.CALL_DIAGNOSTIC_CONFIG.MISSING_ROAP_ANSWER_CLIENT_CODE
6632
6765
  })]
6633
6766
  },
6634
6767
  options: {
6635
- meetingId: _this41.id,
6768
+ meetingId: _this42.id,
6636
6769
  rawError: new Error('Timeout waiting for SDP answer')
6637
6770
  }
6638
6771
  });
6639
6772
  deferSDPAnswer.reject(new Error('Timed out waiting for REMOTE SDP ANSWER'));
6640
6773
  }, _constants.ROAP_OFFER_ANSWER_EXCHANGE_TIMEOUT);
6641
6774
  _loggerProxy.default.logger.info("".concat(LOG_HEADER, " waiting for REMOTE SDP ANSWER..."));
6642
- return _context24.abrupt("return", deferSDPAnswer.promise);
6775
+ return _context25.abrupt("return", deferSDPAnswer.promise);
6643
6776
  case 8:
6644
6777
  case "end":
6645
- return _context24.stop();
6778
+ return _context25.stop();
6646
6779
  }
6647
- }, _callee24, this);
6780
+ }, _callee25, this);
6648
6781
  }));
6649
6782
  function waitForRemoteSDPAnswer() {
6650
6783
  return _waitForRemoteSDPAnswer.apply(this, arguments);
@@ -6663,30 +6796,30 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
6663
6796
  }, {
6664
6797
  key: "retryEstablishMediaConnectionWithForcedTurnDiscovery",
6665
6798
  value: (function () {
6666
- var _retryEstablishMediaConnectionWithForcedTurnDiscovery = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee25(remoteMediaManagerConfig, bundlePolicy) {
6799
+ var _retryEstablishMediaConnectionWithForcedTurnDiscovery = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee26(remoteMediaManagerConfig, bundlePolicy) {
6667
6800
  var LOG_HEADER;
6668
- return _regenerator.default.wrap(function _callee25$(_context25) {
6669
- while (1) switch (_context25.prev = _context25.next) {
6801
+ return _regenerator.default.wrap(function _callee26$(_context26) {
6802
+ while (1) switch (_context26.prev = _context26.next) {
6670
6803
  case 0:
6671
6804
  LOG_HEADER = 'Meeting:index#addMedia():retryEstablishMediaConnectionWithForcedTurnDiscovery -->';
6672
- _context25.prev = 1;
6673
- _context25.next = 4;
6805
+ _context26.prev = 1;
6806
+ _context26.next = 4;
6674
6807
  return this.establishMediaConnection(remoteMediaManagerConfig, bundlePolicy, true);
6675
6808
  case 4:
6676
- _context25.next = 10;
6809
+ _context26.next = 10;
6677
6810
  break;
6678
6811
  case 6:
6679
- _context25.prev = 6;
6680
- _context25.t0 = _context25["catch"](1);
6681
- _loggerProxy.default.logger.error("".concat(LOG_HEADER, " retry with TURN-TLS failed, media connection unable to connect, "), _context25.t0);
6682
- throw _context25.t0;
6812
+ _context26.prev = 6;
6813
+ _context26.t0 = _context26["catch"](1);
6814
+ _loggerProxy.default.logger.error("".concat(LOG_HEADER, " retry with TURN-TLS failed, media connection unable to connect, "), _context26.t0);
6815
+ throw _context26.t0;
6683
6816
  case 10:
6684
6817
  case "end":
6685
- return _context25.stop();
6818
+ return _context26.stop();
6686
6819
  }
6687
- }, _callee25, this, [[1, 6]]);
6820
+ }, _callee26, this, [[1, 6]]);
6688
6821
  }));
6689
- function retryEstablishMediaConnectionWithForcedTurnDiscovery(_x19, _x20) {
6822
+ function retryEstablishMediaConnectionWithForcedTurnDiscovery(_x20, _x21) {
6690
6823
  return _retryEstablishMediaConnectionWithForcedTurnDiscovery.apply(this, arguments);
6691
6824
  }
6692
6825
  return retryEstablishMediaConnectionWithForcedTurnDiscovery;
@@ -6704,14 +6837,14 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
6704
6837
  }, {
6705
6838
  key: "retryWithForcedTurnDiscovery",
6706
6839
  value: (function () {
6707
- var _retryWithForcedTurnDiscovery = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee26(remoteMediaManagerConfig, bundlePolicy) {
6840
+ var _retryWithForcedTurnDiscovery = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee27(remoteMediaManagerConfig, bundlePolicy) {
6708
6841
  var LOG_HEADER;
6709
- return _regenerator.default.wrap(function _callee26$(_context26) {
6710
- while (1) switch (_context26.prev = _context26.next) {
6842
+ return _regenerator.default.wrap(function _callee27$(_context27) {
6843
+ while (1) switch (_context27.prev = _context27.next) {
6711
6844
  case 0:
6712
6845
  this.addMediaData.retriedWithTurnServer = true;
6713
6846
  LOG_HEADER = 'Meeting:index#addMedia():retryWithForcedTurnDiscovery -->';
6714
- _context26.next = 4;
6847
+ _context27.next = 4;
6715
6848
  return this.cleanUpBeforeRetryWithTurnServer();
6716
6849
  case 4:
6717
6850
  _metrics.default.sendBehavioralMetric(_constants2.default.ADD_MEDIA_RETRY, {
@@ -6721,24 +6854,24 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
6721
6854
  reason: 'forcingTurnTls'
6722
6855
  });
6723
6856
  if (!(this.state === _constants.MEETING_STATE.STATES.LEFT)) {
6724
- _context26.next = 9;
6857
+ _context27.next = 9;
6725
6858
  break;
6726
6859
  }
6727
6860
  _loggerProxy.default.logger.info("".concat(LOG_HEADER, " meeting state was LEFT after first attempt to establish media connection. Attempting to rejoin. "));
6728
- _context26.next = 9;
6861
+ _context27.next = 9;
6729
6862
  return this.join({
6730
6863
  rejoin: true
6731
6864
  });
6732
6865
  case 9:
6733
- _context26.next = 11;
6866
+ _context27.next = 11;
6734
6867
  return this.retryEstablishMediaConnectionWithForcedTurnDiscovery(remoteMediaManagerConfig, bundlePolicy);
6735
6868
  case 11:
6736
6869
  case "end":
6737
- return _context26.stop();
6870
+ return _context27.stop();
6738
6871
  }
6739
- }, _callee26, this);
6872
+ }, _callee27, this);
6740
6873
  }));
6741
- function retryWithForcedTurnDiscovery(_x21, _x22) {
6874
+ function retryWithForcedTurnDiscovery(_x22, _x23) {
6742
6875
  return _retryWithForcedTurnDiscovery.apply(this, arguments);
6743
6876
  }
6744
6877
  return retryWithForcedTurnDiscovery;
@@ -6758,32 +6891,32 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
6758
6891
  }, {
6759
6892
  key: "handleWaitForMediaConnectionConnectedError",
6760
6893
  value: (function () {
6761
- var _handleWaitForMediaConnectionConnectedError = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee27(error, remoteMediaManagerConfig, bundlePolicy) {
6894
+ var _handleWaitForMediaConnectionConnectedError = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee28(error, remoteMediaManagerConfig, bundlePolicy) {
6762
6895
  var LOG_HEADER;
6763
- return _regenerator.default.wrap(function _callee27$(_context27) {
6764
- while (1) switch (_context27.prev = _context27.next) {
6896
+ return _regenerator.default.wrap(function _callee28$(_context28) {
6897
+ while (1) switch (_context28.prev = _context28.next) {
6765
6898
  case 0:
6766
6899
  LOG_HEADER = 'Meeting:index#addMedia():handleWaitForMediaConnectionConnectedError -->'; // @ts-ignore - config coming from registerPlugin
6767
6900
  if (this.turnServerUsed) {
6768
- _context27.next = 7;
6901
+ _context28.next = 7;
6769
6902
  break;
6770
6903
  }
6771
6904
  _loggerProxy.default.logger.info("".concat(LOG_HEADER, " error waiting for media to connect on UDP, TCP, retrying using TURN-TLS, "), error);
6772
- _context27.next = 5;
6905
+ _context28.next = 5;
6773
6906
  return this.retryWithForcedTurnDiscovery(remoteMediaManagerConfig, bundlePolicy);
6774
6907
  case 5:
6775
- _context27.next = 9;
6908
+ _context28.next = 9;
6776
6909
  break;
6777
6910
  case 7:
6778
6911
  _loggerProxy.default.logger.error("".concat(LOG_HEADER, " error waiting for media to connect using UDP, TCP and TURN-TLS"), error);
6779
6912
  throw new _webexErrors.AddMediaFailed();
6780
6913
  case 9:
6781
6914
  case "end":
6782
- return _context27.stop();
6915
+ return _context28.stop();
6783
6916
  }
6784
- }, _callee27, this);
6917
+ }, _callee28, this);
6785
6918
  }));
6786
- function handleWaitForMediaConnectionConnectedError(_x23, _x24, _x25) {
6919
+ function handleWaitForMediaConnectionConnectedError(_x24, _x25, _x26) {
6787
6920
  return _handleWaitForMediaConnectionConnectedError.apply(this, arguments);
6788
6921
  }
6789
6922
  return handleWaitForMediaConnectionConnectedError;
@@ -6799,20 +6932,20 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
6799
6932
  }, {
6800
6933
  key: "doTurnDiscovery",
6801
6934
  value: (function () {
6802
- var _doTurnDiscovery = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee28(isReconnecting, isForced) {
6935
+ var _doTurnDiscovery = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee29(isReconnecting, isForced) {
6803
6936
  var cdl, turnDiscoveryResult;
6804
- return _regenerator.default.wrap(function _callee28$(_context28) {
6805
- while (1) switch (_context28.prev = _context28.next) {
6937
+ return _regenerator.default.wrap(function _callee29$(_context29) {
6938
+ while (1) switch (_context29.prev = _context29.next) {
6806
6939
  case 0:
6807
6940
  // @ts-ignore
6808
6941
  cdl = this.webex.internal.newMetrics.callDiagnosticLatencies; // @ts-ignore
6809
6942
  this.webex.internal.newMetrics.submitInternalEvent({
6810
6943
  name: 'internal.client.add-media.turn-discovery.start'
6811
6944
  });
6812
- _context28.next = 4;
6945
+ _context29.next = 4;
6813
6946
  return this.roap.doTurnDiscovery(this, isReconnecting, isForced);
6814
6947
  case 4:
6815
- turnDiscoveryResult = _context28.sent;
6948
+ turnDiscoveryResult = _context29.sent;
6816
6949
  this.turnDiscoverySkippedReason = turnDiscoveryResult === null || turnDiscoveryResult === void 0 ? void 0 : turnDiscoveryResult.turnDiscoverySkippedReason;
6817
6950
  this.turnServerUsed = !this.turnDiscoverySkippedReason;
6818
6951
 
@@ -6828,14 +6961,14 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
6828
6961
  retriedWithTurnServer: this.addMediaData.retriedWithTurnServer
6829
6962
  });
6830
6963
  }
6831
- return _context28.abrupt("return", turnDiscoveryResult);
6964
+ return _context29.abrupt("return", turnDiscoveryResult);
6832
6965
  case 10:
6833
6966
  case "end":
6834
- return _context28.stop();
6967
+ return _context29.stop();
6835
6968
  }
6836
- }, _callee28, this);
6969
+ }, _callee29, this);
6837
6970
  }));
6838
- function doTurnDiscovery(_x26, _x27) {
6971
+ function doTurnDiscovery(_x27, _x28) {
6839
6972
  return _doTurnDiscovery.apply(this, arguments);
6840
6973
  }
6841
6974
  return doTurnDiscovery;
@@ -6854,35 +6987,35 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
6854
6987
  }, {
6855
6988
  key: "establishMediaConnection",
6856
6989
  value: (function () {
6857
- var _establishMediaConnection = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee29(remoteMediaManagerConfig, bundlePolicy, isForced, turnServerInfo) {
6990
+ var _establishMediaConnection = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee30(remoteMediaManagerConfig, bundlePolicy, isForced, turnServerInfo) {
6858
6991
  var _this$locusMediaReque;
6859
6992
  var LOG_HEADER, isReconnecting, _yield$this$doTurnDis, mc;
6860
- return _regenerator.default.wrap(function _callee29$(_context29) {
6861
- while (1) switch (_context29.prev = _context29.next) {
6993
+ return _regenerator.default.wrap(function _callee30$(_context30) {
6994
+ while (1) switch (_context30.prev = _context30.next) {
6862
6995
  case 0:
6863
6996
  LOG_HEADER = 'Meeting:index#addMedia():establishMediaConnection -->';
6864
6997
  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
6865
6998
  if (this.isMoveToInProgress && this.turnServerUsed) {
6866
6999
  isForced = true;
6867
7000
  }
6868
- _context29.prev = 3;
7001
+ _context30.prev = 3;
6869
7002
  if (turnServerInfo) {
6870
- _context29.next = 9;
7003
+ _context30.next = 9;
6871
7004
  break;
6872
7005
  }
6873
- _context29.next = 7;
7006
+ _context30.next = 7;
6874
7007
  return this.doTurnDiscovery(isReconnecting, isForced);
6875
7008
  case 7:
6876
- _yield$this$doTurnDis = _context29.sent;
7009
+ _yield$this$doTurnDis = _context30.sent;
6877
7010
  turnServerInfo = _yield$this$doTurnDis.turnServerInfo;
6878
7011
  case 9:
6879
- _context29.next = 11;
7012
+ _context30.next = 11;
6880
7013
  return this.createMediaConnection(turnServerInfo, bundlePolicy);
6881
7014
  case 11:
6882
- mc = _context29.sent;
6883
- _loggerProxy.default.logger.info("".concat(LOG_HEADER, " media connection created"));
7015
+ mc = _context30.sent;
7016
+ _loggerProxy.default.logger.info("".concat(LOG_HEADER, " media connection created this.isMultistream=").concat(this.isMultistream));
6884
7017
  if (!this.isMultistream) {
6885
- _context29.next = 21;
7018
+ _context30.next = 21;
6886
7019
  break;
6887
7020
  }
6888
7021
  this.remoteMediaManager = new _remoteMediaManager.RemoteMediaManager(this.receiveSlotManager, this.mediaRequestManagers, remoteMediaManagerConfig);
@@ -6890,42 +7023,42 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
6890
7023
  this.forwardEvent(this.remoteMediaManager, _remoteMediaManager.Event.InterpretationAudioCreated, _constants.EVENT_TRIGGERS.REMOTE_MEDIA_INTERPRETATION_AUDIO_CREATED);
6891
7024
  this.forwardEvent(this.remoteMediaManager, _remoteMediaManager.Event.ScreenShareAudioCreated, _constants.EVENT_TRIGGERS.REMOTE_MEDIA_SCREEN_SHARE_AUDIO_CREATED);
6892
7025
  this.forwardEvent(this.remoteMediaManager, _remoteMediaManager.Event.VideoLayoutChanged, _constants.EVENT_TRIGGERS.REMOTE_MEDIA_VIDEO_LAYOUT_CHANGED);
6893
- _context29.next = 21;
7026
+ _context30.next = 21;
6894
7027
  return this.remoteMediaManager.start();
6895
7028
  case 21:
6896
- _context29.next = 23;
7029
+ _context30.next = 23;
6897
7030
  return mc.initiateOffer();
6898
7031
  case 23:
6899
- _context29.next = 25;
7032
+ _context30.next = 25;
6900
7033
  return this.waitForRemoteSDPAnswer();
6901
7034
  case 25:
6902
7035
  this.handleMediaLogging(this.mediaProperties);
6903
- _context29.next = 32;
7036
+ _context30.next = 32;
6904
7037
  break;
6905
7038
  case 28:
6906
- _context29.prev = 28;
6907
- _context29.t0 = _context29["catch"](3);
6908
- _loggerProxy.default.logger.error("".concat(LOG_HEADER, " error establishing media connection, "), _context29.t0);
6909
- throw _context29.t0;
7039
+ _context30.prev = 28;
7040
+ _context30.t0 = _context30["catch"](3);
7041
+ _loggerProxy.default.logger.error("".concat(LOG_HEADER, " error establishing media connection, "), _context30.t0);
7042
+ throw _context30.t0;
6910
7043
  case 32:
6911
- _context29.prev = 32;
6912
- _context29.next = 35;
7044
+ _context30.prev = 32;
7045
+ _context30.next = 35;
6913
7046
  return this.waitForMediaConnectionConnected();
6914
7047
  case 35:
6915
- _context29.next = 41;
7048
+ _context30.next = 41;
6916
7049
  break;
6917
7050
  case 37:
6918
- _context29.prev = 37;
6919
- _context29.t1 = _context29["catch"](32);
6920
- _context29.next = 41;
6921
- return this.handleWaitForMediaConnectionConnectedError(_context29.t1, remoteMediaManagerConfig, bundlePolicy);
7051
+ _context30.prev = 37;
7052
+ _context30.t1 = _context30["catch"](32);
7053
+ _context30.next = 41;
7054
+ return this.handleWaitForMediaConnectionConnectedError(_context30.t1, remoteMediaManagerConfig, bundlePolicy);
6922
7055
  case 41:
6923
7056
  case "end":
6924
- return _context29.stop();
7057
+ return _context30.stop();
6925
7058
  }
6926
- }, _callee29, this, [[3, 28], [32, 37]]);
7059
+ }, _callee30, this, [[3, 28], [32, 37]]);
6927
7060
  }));
6928
- function establishMediaConnection(_x28, _x29, _x30, _x31) {
7061
+ function establishMediaConnection(_x29, _x30, _x31, _x32) {
6929
7062
  return _establishMediaConnection.apply(this, arguments);
6930
7063
  }
6931
7064
  return establishMediaConnection;
@@ -6940,22 +7073,22 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
6940
7073
  }, {
6941
7074
  key: "cleanUpOnAddMediaFailure",
6942
7075
  value: (function () {
6943
- var _cleanUpOnAddMediaFailure = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee30() {
6944
- return _regenerator.default.wrap(function _callee30$(_context30) {
6945
- while (1) switch (_context30.prev = _context30.next) {
7076
+ var _cleanUpOnAddMediaFailure = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee31() {
7077
+ return _regenerator.default.wrap(function _callee31$(_context31) {
7078
+ while (1) switch (_context31.prev = _context31.next) {
6946
7079
  case 0:
6947
7080
  if (!this.statsAnalyzer) {
6948
- _context30.next = 3;
7081
+ _context31.next = 3;
6949
7082
  break;
6950
7083
  }
6951
- _context30.next = 3;
7084
+ _context31.next = 3;
6952
7085
  return this.statsAnalyzer.stopAnalyzer();
6953
7086
  case 3:
6954
7087
  this.statsAnalyzer = null;
6955
7088
 
6956
7089
  // when media fails, we want to upload a webrtc dump to see whats going on
6957
7090
  // this function is async, but returns once the stats have been gathered
6958
- _context30.next = 6;
7091
+ _context31.next = 6;
6959
7092
  return this.forceSendStatsReport({
6960
7093
  callFrom: 'addMedia'
6961
7094
  });
@@ -6966,15 +7099,58 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
6966
7099
  }
6967
7100
  case 7:
6968
7101
  case "end":
6969
- return _context30.stop();
7102
+ return _context31.stop();
6970
7103
  }
6971
- }, _callee30, this);
7104
+ }, _callee31, this);
6972
7105
  }));
6973
7106
  function cleanUpOnAddMediaFailure() {
6974
7107
  return _cleanUpOnAddMediaFailure.apply(this, arguments);
6975
7108
  }
6976
7109
  return cleanUpOnAddMediaFailure;
6977
7110
  }()
7111
+ /**
7112
+ * Cleans up stats analyzer, peer connection and other things before
7113
+ * we can create a new transcoded media connection
7114
+ *
7115
+ * @private
7116
+ * @returns {Promise<void>}
7117
+ */
7118
+ )
7119
+ }, {
7120
+ key: "downgradeFromMultistreamToTranscoded",
7121
+ value: (function () {
7122
+ var _downgradeFromMultistreamToTranscoded = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee32() {
7123
+ var _this$locusMediaReque2;
7124
+ return _regenerator.default.wrap(function _callee32$(_context32) {
7125
+ while (1) switch (_context32.prev = _context32.next) {
7126
+ case 0:
7127
+ if (!this.statsAnalyzer) {
7128
+ _context32.next = 3;
7129
+ break;
7130
+ }
7131
+ _context32.next = 3;
7132
+ return this.statsAnalyzer.stopAnalyzer();
7133
+ case 3:
7134
+ this.statsAnalyzer = null;
7135
+ this.isMultistream = false;
7136
+ if (this.mediaProperties.webrtcMediaConnection) {
7137
+ // close peer connection, but don't reset mute state information, because we will want to use it on the retry
7138
+ this.closePeerConnections(false);
7139
+ this.mediaProperties.unsetPeerConnection();
7140
+ }
7141
+ (_this$locusMediaReque2 = this.locusMediaRequest) === null || _this$locusMediaReque2 === void 0 ? void 0 : _this$locusMediaReque2.downgradeFromMultistreamToTranscoded();
7142
+ this.createStatsAnalyzer();
7143
+ case 8:
7144
+ case "end":
7145
+ return _context32.stop();
7146
+ }
7147
+ }, _callee32, this);
7148
+ }));
7149
+ function downgradeFromMultistreamToTranscoded() {
7150
+ return _downgradeFromMultistreamToTranscoded.apply(this, arguments);
7151
+ }
7152
+ return downgradeFromMultistreamToTranscoded;
7153
+ }()
6978
7154
  /**
6979
7155
  * Sends stats report, closes peer connection and cleans up any media connection
6980
7156
  * related things before trying to establish media connection again with turn server
@@ -6986,11 +7162,11 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
6986
7162
  }, {
6987
7163
  key: "cleanUpBeforeRetryWithTurnServer",
6988
7164
  value: (function () {
6989
- var _cleanUpBeforeRetryWithTurnServer = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee31() {
6990
- return _regenerator.default.wrap(function _callee31$(_context31) {
6991
- while (1) switch (_context31.prev = _context31.next) {
7165
+ var _cleanUpBeforeRetryWithTurnServer = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee33() {
7166
+ return _regenerator.default.wrap(function _callee33$(_context33) {
7167
+ while (1) switch (_context33.prev = _context33.next) {
6992
7168
  case 0:
6993
- _context31.next = 2;
7169
+ _context33.next = 2;
6994
7170
  return this.forceSendStatsReport({
6995
7171
  callFrom: 'cleanUpBeforeRetryWithTurnServer'
6996
7172
  });
@@ -7010,9 +7186,9 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7010
7186
  }
7011
7187
  case 3:
7012
7188
  case "end":
7013
- return _context31.stop();
7189
+ return _context33.stop();
7014
7190
  }
7015
- }, _callee31, this);
7191
+ }, _callee33, this);
7016
7192
  }));
7017
7193
  function cleanUpBeforeRetryWithTurnServer() {
7018
7194
  return _cleanUpBeforeRetryWithTurnServer.apply(this, arguments);
@@ -7022,34 +7198,34 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7022
7198
  }, {
7023
7199
  key: "cleanUpBeforeReconnection",
7024
7200
  value: function () {
7025
- var _cleanUpBeforeReconnection = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee32() {
7026
- return _regenerator.default.wrap(function _callee32$(_context32) {
7027
- while (1) switch (_context32.prev = _context32.next) {
7201
+ var _cleanUpBeforeReconnection = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee34() {
7202
+ return _regenerator.default.wrap(function _callee34$(_context34) {
7203
+ while (1) switch (_context34.prev = _context34.next) {
7028
7204
  case 0:
7029
- _context32.prev = 0;
7030
- _context32.next = 3;
7205
+ _context34.prev = 0;
7206
+ _context34.next = 3;
7031
7207
  return this.forceSendStatsReport({
7032
7208
  callFrom: 'cleanUpBeforeReconnection'
7033
7209
  });
7034
7210
  case 3:
7035
7211
  if (!this.statsAnalyzer) {
7036
- _context32.next = 6;
7212
+ _context34.next = 6;
7037
7213
  break;
7038
7214
  }
7039
- _context32.next = 6;
7215
+ _context34.next = 6;
7040
7216
  return this.statsAnalyzer.stopAnalyzer();
7041
7217
  case 6:
7042
- _context32.next = 11;
7218
+ _context34.next = 11;
7043
7219
  break;
7044
7220
  case 8:
7045
- _context32.prev = 8;
7046
- _context32.t0 = _context32["catch"](0);
7047
- _loggerProxy.default.logger.error('Meeting:index#cleanUpBeforeReconnection --> Error during cleanup: ', _context32.t0);
7221
+ _context34.prev = 8;
7222
+ _context34.t0 = _context34["catch"](0);
7223
+ _loggerProxy.default.logger.error('Meeting:index#cleanUpBeforeReconnection --> Error during cleanup: ', _context34.t0);
7048
7224
  case 11:
7049
7225
  case "end":
7050
- return _context32.stop();
7226
+ return _context34.stop();
7051
7227
  }
7052
- }, _callee32, this, [[0, 8]]);
7228
+ }, _callee34, this, [[0, 8]]);
7053
7229
  }));
7054
7230
  function cleanUpBeforeReconnection() {
7055
7231
  return _cleanUpBeforeReconnection.apply(this, arguments);
@@ -7096,10 +7272,10 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7096
7272
  }, {
7097
7273
  key: "addMedia",
7098
7274
  value: function addMedia() {
7099
- var _this42 = this;
7275
+ var _this43 = this;
7100
7276
  var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
7101
7277
  return this.addMediaInternal(function () {
7102
- return _this42.turnServerUsed ? 'JOIN_MEETING_FINAL' : 'JOIN_MEETING_RETRY';
7278
+ return _this43.turnServerUsed ? 'JOIN_MEETING_FINAL' : 'JOIN_MEETING_RETRY';
7103
7279
  }, undefined, false, options);
7104
7280
  }
7105
7281
 
@@ -7117,7 +7293,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7117
7293
  }, {
7118
7294
  key: "addMediaInternal",
7119
7295
  value: (function () {
7120
- var _addMediaInternal = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee33(icePhaseCallback, turnServerInfo, forceTurnDiscovery) {
7296
+ var _addMediaInternal = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee35(icePhaseCallback, turnServerInfo, forceTurnDiscovery) {
7121
7297
  var options,
7122
7298
  LOG_HEADER,
7123
7299
  localStreams,
@@ -7139,8 +7315,6 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7139
7315
  numTransports,
7140
7316
  reachabilityStats,
7141
7317
  iceCandidateErrors,
7142
- _this$mediaProperties13,
7143
- _this$mediaProperties14,
7144
7318
  _this$mediaProperties15,
7145
7319
  _this$mediaProperties16,
7146
7320
  _this$mediaProperties17,
@@ -7160,29 +7334,31 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7160
7334
  _this$mediaProperties31,
7161
7335
  _this$mediaProperties32,
7162
7336
  _this$mediaProperties33,
7337
+ _this$mediaProperties34,
7338
+ _this$mediaProperties35,
7163
7339
  reachabilityMetrics,
7164
7340
  _yield$this$mediaProp2,
7165
7341
  _selectedCandidatePairChanges,
7166
7342
  _numTransports,
7167
7343
  _iceCandidateErrors,
7168
- _args33 = arguments;
7169
- return _regenerator.default.wrap(function _callee33$(_context33) {
7170
- while (1) switch (_context33.prev = _context33.next) {
7344
+ _args35 = arguments;
7345
+ return _regenerator.default.wrap(function _callee35$(_context35) {
7346
+ while (1) switch (_context35.prev = _context35.next) {
7171
7347
  case 0:
7172
- options = _args33.length > 3 && _args33[3] !== undefined ? _args33[3] : {};
7348
+ options = _args35.length > 3 && _args35[3] !== undefined ? _args35[3] : {};
7173
7349
  this.addMediaData.retriedWithTurnServer = false;
7174
7350
  this.addMediaData.icePhaseCallback = icePhaseCallback;
7175
7351
  this.hasMediaConnectionConnectedAtLeastOnce = false;
7176
7352
  LOG_HEADER = 'Meeting:index#addMedia -->';
7177
7353
  _loggerProxy.default.logger.info("".concat(LOG_HEADER, " called with: options=").concat((0, _stringify.default)(options), ", turnServerInfo=").concat((0, _stringify.default)(turnServerInfo), ", forceTurnDiscovery=").concat(forceTurnDiscovery));
7178
7354
  if (!(options.allowMediaInLobby !== true && this.meetingState !== _constants.FULL_STATE.ACTIVE)) {
7179
- _context33.next = 8;
7355
+ _context35.next = 8;
7180
7356
  break;
7181
7357
  }
7182
7358
  throw new _webexErrors.MeetingNotActiveError();
7183
7359
  case 8:
7184
7360
  if (!_util2.default.isUserInLeftState(this.locusInfo)) {
7185
- _context33.next = 10;
7361
+ _context35.next = 10;
7186
7362
  break;
7187
7363
  }
7188
7364
  throw new _webexErrors.UserNotJoinedError();
@@ -7193,7 +7369,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7193
7369
  // If the user is unjoined or guest waiting in lobby dont allow the user to addMedia
7194
7370
  // @ts-ignore - isUserUnadmitted coming from SelfUtil
7195
7371
  if (!(this.isUserUnadmitted && !this.wirelessShare && !this.allowMediaInLobby)) {
7196
- _context33.next = 14;
7372
+ _context35.next = 14;
7197
7373
  break;
7198
7374
  }
7199
7375
  throw new _webexErrors.UserInLobbyError();
@@ -7236,45 +7412,55 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7236
7412
  });
7237
7413
  this.audio = (0, _muteState.createMuteState)(_constants.AUDIO, this, audioEnabled);
7238
7414
  this.video = (0, _muteState.createMuteState)(_constants.VIDEO, this, videoEnabled);
7239
- _context33.prev = 18;
7240
- _context33.next = 21;
7415
+ _context35.prev = 18;
7416
+ _context35.next = 21;
7241
7417
  return this.setUpLocalStreamReferences(localStreams);
7242
7418
  case 21:
7243
7419
  this.setMercuryListener();
7244
7420
  this.createStatsAnalyzer();
7245
- _context33.next = 25;
7421
+ _context35.prev = 23;
7422
+ _context35.next = 26;
7246
7423
  return this.establishMediaConnection(remoteMediaManagerConfig, bundlePolicy, forceTurnDiscovery, turnServerInfo);
7247
- case 25:
7248
- if (!(audioEnabled || videoEnabled)) {
7249
- _context33.next = 30;
7424
+ case 26:
7425
+ _context35.next = 39;
7426
+ break;
7427
+ case 28:
7428
+ _context35.prev = 28;
7429
+ _context35.t0 = _context35["catch"](23);
7430
+ if (!(_context35.t0 instanceof _multistreamNotSupportedError.default)) {
7431
+ _context35.next = 38;
7250
7432
  break;
7251
7433
  }
7252
- _context33.next = 28;
7253
- return Meeting.handleDeviceLogging(audioEnabled, videoEnabled);
7254
- case 28:
7255
- _context33.next = 31;
7434
+ _loggerProxy.default.logger.warn("".concat(LOG_HEADER, " we asked for multistream backend (Homer), but got transcoded backend, recreating media connection..."));
7435
+ _context35.next = 34;
7436
+ return this.downgradeFromMultistreamToTranscoded();
7437
+ case 34:
7438
+ _context35.next = 36;
7439
+ return this.establishMediaConnection(remoteMediaManagerConfig, bundlePolicy, true, undefined);
7440
+ case 36:
7441
+ _context35.next = 39;
7256
7442
  break;
7257
- case 30:
7258
- _loggerProxy.default.logger.info("".concat(LOG_HEADER, " device logging not required"));
7259
- case 31:
7443
+ case 38:
7444
+ throw _context35.t0;
7445
+ case 39:
7260
7446
  if (!this.mediaProperties.hasLocalShareStream()) {
7261
- _context33.next = 34;
7447
+ _context35.next = 42;
7262
7448
  break;
7263
7449
  }
7264
- _context33.next = 34;
7450
+ _context35.next = 42;
7265
7451
  return this.enqueueScreenShareFloorRequest();
7266
- case 34:
7267
- _context33.next = 36;
7452
+ case 42:
7453
+ _context35.next = 44;
7268
7454
  return this.mediaProperties.getCurrentConnectionInfo();
7269
- case 36:
7270
- _yield$this$mediaProp = _context33.sent;
7455
+ case 44:
7456
+ _yield$this$mediaProp = _context35.sent;
7271
7457
  connectionType = _yield$this$mediaProp.connectionType;
7272
7458
  selectedCandidatePairChanges = _yield$this$mediaProp.selectedCandidatePairChanges;
7273
7459
  numTransports = _yield$this$mediaProp.numTransports;
7274
- _context33.next = 42;
7460
+ _context35.next = 50;
7275
7461
  return this.webex.meetings.reachability.getReachabilityMetrics();
7276
- case 42:
7277
- reachabilityStats = _context33.sent;
7462
+ case 50:
7463
+ reachabilityStats = _context35.sent;
7278
7464
  iceCandidateErrors = Object.fromEntries(this.iceCandidateErrors);
7279
7465
  _metrics.default.sendBehavioralMetric(_constants2.default.ADD_MEDIA_SUCCESS, _objectSpread(_objectSpread(_objectSpread({
7280
7466
  correlation_id: this.correlationId,
@@ -7300,31 +7486,31 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7300
7486
  // We can log ReceiveSlot SSRCs only after the SDP exchange, so doing it here:
7301
7487
  (_this$remoteMediaMana = this.remoteMediaManager) === null || _this$remoteMediaMana === void 0 ? void 0 : _this$remoteMediaMana.logAllReceiveSlots();
7302
7488
  this.startPeriodicLogUpload();
7303
- _context33.next = 69;
7489
+ _context35.next = 77;
7304
7490
  break;
7305
- case 51:
7306
- _context33.prev = 51;
7307
- _context33.t0 = _context33["catch"](18);
7308
- _loggerProxy.default.logger.error("".concat(LOG_HEADER, " failed to establish media connection: "), _context33.t0);
7491
+ case 59:
7492
+ _context35.prev = 59;
7493
+ _context35.t1 = _context35["catch"](18);
7494
+ _loggerProxy.default.logger.error("".concat(LOG_HEADER, " failed to establish media connection: "), _context35.t1);
7309
7495
 
7310
7496
  // @ts-ignore
7311
- _context33.next = 56;
7497
+ _context35.next = 64;
7312
7498
  return this.webex.meetings.reachability.getReachabilityMetrics();
7313
- case 56:
7314
- reachabilityMetrics = _context33.sent;
7315
- _context33.next = 59;
7499
+ case 64:
7500
+ reachabilityMetrics = _context35.sent;
7501
+ _context35.next = 67;
7316
7502
  return this.mediaProperties.getCurrentConnectionInfo();
7317
- case 59:
7318
- _yield$this$mediaProp2 = _context33.sent;
7503
+ case 67:
7504
+ _yield$this$mediaProp2 = _context35.sent;
7319
7505
  _selectedCandidatePairChanges = _yield$this$mediaProp2.selectedCandidatePairChanges;
7320
7506
  _numTransports = _yield$this$mediaProp2.numTransports;
7321
7507
  _iceCandidateErrors = Object.fromEntries(this.iceCandidateErrors);
7322
7508
  _metrics.default.sendBehavioralMetric(_constants2.default.ADD_MEDIA_FAILURE, _objectSpread(_objectSpread(_objectSpread({
7323
7509
  correlation_id: this.correlationId,
7324
7510
  locus_id: this.locusUrl.split('/').pop(),
7325
- reason: _context33.t0.message,
7326
- stack: _context33.t0.stack,
7327
- code: _context33.t0.code,
7511
+ reason: _context35.t1.message,
7512
+ stack: _context35.t1.stack,
7513
+ code: _context35.t1.code,
7328
7514
  selectedCandidatePairChanges: _selectedCandidatePairChanges,
7329
7515
  numTransports: _numTransports,
7330
7516
  turnDiscoverySkippedReason: this.turnDiscoverySkippedReason,
@@ -7332,37 +7518,37 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7332
7518
  retriedWithTurnServer: this.addMediaData.retriedWithTurnServer,
7333
7519
  isMultistream: this.isMultistream,
7334
7520
  isJoinWithMediaRetry: this.joinWithMediaRetryInfo.isRetry,
7335
- signalingState: ((_this$mediaProperties13 = this.mediaProperties.webrtcMediaConnection) === null || _this$mediaProperties13 === void 0 ? void 0 : (_this$mediaProperties14 = _this$mediaProperties13.multistreamConnection) === null || _this$mediaProperties14 === void 0 ? void 0 : (_this$mediaProperties15 = _this$mediaProperties14.pc) === null || _this$mediaProperties15 === void 0 ? void 0 : (_this$mediaProperties16 = _this$mediaProperties15.pc) === null || _this$mediaProperties16 === void 0 ? void 0 : _this$mediaProperties16.signalingState) || ((_this$mediaProperties17 = this.mediaProperties.webrtcMediaConnection) === null || _this$mediaProperties17 === void 0 ? void 0 : (_this$mediaProperties18 = _this$mediaProperties17.mediaConnection) === null || _this$mediaProperties18 === void 0 ? void 0 : (_this$mediaProperties19 = _this$mediaProperties18.pc) === null || _this$mediaProperties19 === void 0 ? void 0 : _this$mediaProperties19.signalingState) || 'unknown',
7336
- connectionState: ((_this$mediaProperties20 = this.mediaProperties.webrtcMediaConnection) === null || _this$mediaProperties20 === void 0 ? void 0 : (_this$mediaProperties21 = _this$mediaProperties20.multistreamConnection) === null || _this$mediaProperties21 === void 0 ? void 0 : (_this$mediaProperties22 = _this$mediaProperties21.pc) === null || _this$mediaProperties22 === void 0 ? void 0 : (_this$mediaProperties23 = _this$mediaProperties22.pc) === null || _this$mediaProperties23 === void 0 ? void 0 : _this$mediaProperties23.connectionState) || ((_this$mediaProperties24 = this.mediaProperties.webrtcMediaConnection) === null || _this$mediaProperties24 === void 0 ? void 0 : (_this$mediaProperties25 = _this$mediaProperties24.mediaConnection) === null || _this$mediaProperties25 === void 0 ? void 0 : (_this$mediaProperties26 = _this$mediaProperties25.pc) === null || _this$mediaProperties26 === void 0 ? void 0 : _this$mediaProperties26.connectionState) || 'unknown',
7337
- iceConnectionState: ((_this$mediaProperties27 = this.mediaProperties.webrtcMediaConnection) === null || _this$mediaProperties27 === void 0 ? void 0 : (_this$mediaProperties28 = _this$mediaProperties27.multistreamConnection) === null || _this$mediaProperties28 === void 0 ? void 0 : (_this$mediaProperties29 = _this$mediaProperties28.pc) === null || _this$mediaProperties29 === void 0 ? void 0 : (_this$mediaProperties30 = _this$mediaProperties29.pc) === null || _this$mediaProperties30 === void 0 ? void 0 : _this$mediaProperties30.iceConnectionState) || ((_this$mediaProperties31 = this.mediaProperties.webrtcMediaConnection) === null || _this$mediaProperties31 === void 0 ? void 0 : (_this$mediaProperties32 = _this$mediaProperties31.mediaConnection) === null || _this$mediaProperties32 === void 0 ? void 0 : (_this$mediaProperties33 = _this$mediaProperties32.pc) === null || _this$mediaProperties33 === void 0 ? void 0 : _this$mediaProperties33.iceConnectionState) || 'unknown'
7521
+ signalingState: ((_this$mediaProperties15 = this.mediaProperties.webrtcMediaConnection) === null || _this$mediaProperties15 === void 0 ? void 0 : (_this$mediaProperties16 = _this$mediaProperties15.multistreamConnection) === null || _this$mediaProperties16 === void 0 ? void 0 : (_this$mediaProperties17 = _this$mediaProperties16.pc) === null || _this$mediaProperties17 === void 0 ? void 0 : (_this$mediaProperties18 = _this$mediaProperties17.pc) === null || _this$mediaProperties18 === void 0 ? void 0 : _this$mediaProperties18.signalingState) || ((_this$mediaProperties19 = this.mediaProperties.webrtcMediaConnection) === null || _this$mediaProperties19 === void 0 ? void 0 : (_this$mediaProperties20 = _this$mediaProperties19.mediaConnection) === null || _this$mediaProperties20 === void 0 ? void 0 : (_this$mediaProperties21 = _this$mediaProperties20.pc) === null || _this$mediaProperties21 === void 0 ? void 0 : _this$mediaProperties21.signalingState) || 'unknown',
7522
+ connectionState: ((_this$mediaProperties22 = this.mediaProperties.webrtcMediaConnection) === null || _this$mediaProperties22 === void 0 ? void 0 : (_this$mediaProperties23 = _this$mediaProperties22.multistreamConnection) === null || _this$mediaProperties23 === void 0 ? void 0 : (_this$mediaProperties24 = _this$mediaProperties23.pc) === null || _this$mediaProperties24 === void 0 ? void 0 : (_this$mediaProperties25 = _this$mediaProperties24.pc) === null || _this$mediaProperties25 === void 0 ? void 0 : _this$mediaProperties25.connectionState) || ((_this$mediaProperties26 = this.mediaProperties.webrtcMediaConnection) === null || _this$mediaProperties26 === void 0 ? void 0 : (_this$mediaProperties27 = _this$mediaProperties26.mediaConnection) === null || _this$mediaProperties27 === void 0 ? void 0 : (_this$mediaProperties28 = _this$mediaProperties27.pc) === null || _this$mediaProperties28 === void 0 ? void 0 : _this$mediaProperties28.connectionState) || 'unknown',
7523
+ iceConnectionState: ((_this$mediaProperties29 = this.mediaProperties.webrtcMediaConnection) === null || _this$mediaProperties29 === void 0 ? void 0 : (_this$mediaProperties30 = _this$mediaProperties29.multistreamConnection) === null || _this$mediaProperties30 === void 0 ? void 0 : (_this$mediaProperties31 = _this$mediaProperties30.pc) === null || _this$mediaProperties31 === void 0 ? void 0 : (_this$mediaProperties32 = _this$mediaProperties31.pc) === null || _this$mediaProperties32 === void 0 ? void 0 : _this$mediaProperties32.iceConnectionState) || ((_this$mediaProperties33 = this.mediaProperties.webrtcMediaConnection) === null || _this$mediaProperties33 === void 0 ? void 0 : (_this$mediaProperties34 = _this$mediaProperties33.mediaConnection) === null || _this$mediaProperties34 === void 0 ? void 0 : (_this$mediaProperties35 = _this$mediaProperties34.pc) === null || _this$mediaProperties35 === void 0 ? void 0 : _this$mediaProperties35.iceConnectionState) || 'unknown'
7338
7524
  }, reachabilityMetrics), _iceCandidateErrors), {}, {
7339
7525
  iceCandidatesCount: this.iceCandidatesCount
7340
7526
  }));
7341
- _context33.next = 66;
7527
+ _context35.next = 74;
7342
7528
  return this.cleanUpOnAddMediaFailure();
7343
- case 66:
7529
+ case 74:
7344
7530
  // Upload logs on error while adding media
7345
7531
  _triggerProxy.default.trigger(this, {
7346
7532
  file: 'meeting/index',
7347
7533
  function: 'addMedia'
7348
7534
  }, _constants.EVENTS.REQUEST_UPLOAD_LOGS, this);
7349
- if (_context33.t0 instanceof _internalMediaCore.Errors.SdpError) {
7535
+ if (_context35.t1 instanceof _internalMediaCore.Errors.SdpError) {
7350
7536
  this.leave({
7351
7537
  reason: _constants.MEETING_REMOVED_REASON.MEETING_CONNECTION_FAILED
7352
7538
  });
7353
7539
  }
7354
- throw _context33.t0;
7355
- case 69:
7356
- _context33.prev = 69;
7540
+ throw _context35.t1;
7541
+ case 77:
7542
+ _context35.prev = 77;
7357
7543
  this.addMediaData.icePhaseCallback = DEFAULT_ICE_PHASE_CALLBACK;
7358
- return _context33.finish(69);
7359
- case 72:
7544
+ return _context35.finish(77);
7545
+ case 80:
7360
7546
  case "end":
7361
- return _context33.stop();
7547
+ return _context35.stop();
7362
7548
  }
7363
- }, _callee33, this, [[18, 51, 69, 72]]);
7549
+ }, _callee35, this, [[18, 59, 77, 80], [23, 28]]);
7364
7550
  }));
7365
- function addMediaInternal(_x32, _x33, _x34) {
7551
+ function addMediaInternal(_x33, _x34, _x35) {
7366
7552
  return _addMediaInternal.apply(this, arguments);
7367
7553
  }
7368
7554
  return addMediaInternal;
@@ -7392,7 +7578,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7392
7578
  * @memberof Meeting
7393
7579
  */
7394
7580
  function enqueueMediaUpdate(mediaUpdateType) {
7395
- var _this43 = this;
7581
+ var _this44 = this;
7396
7582
  var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
7397
7583
  var canUpdateMediaNow = this.canUpdateMedia();
7398
7584
  return new _promise.default(function (resolve, reject) {
@@ -7403,9 +7589,9 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7403
7589
  options: options
7404
7590
  };
7405
7591
  _loggerProxy.default.logger.log("Meeting:index#enqueueMediaUpdate --> enqueuing media update type=".concat(mediaUpdateType));
7406
- _this43.queuedMediaUpdates.push(queueItem);
7592
+ _this44.queuedMediaUpdates.push(queueItem);
7407
7593
  if (canUpdateMediaNow) {
7408
- _this43.processNextQueuedMediaUpdate();
7594
+ _this44.processNextQueuedMediaUpdate();
7409
7595
  }
7410
7596
  });
7411
7597
  }
@@ -7428,35 +7614,35 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7428
7614
  * @memberof Meeting
7429
7615
  */
7430
7616
  function () {
7431
- var _updateMedia = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee34(options) {
7617
+ var _updateMedia = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee36(options) {
7432
7618
  var audioEnabled, videoEnabled, shareAudioEnabled, shareVideoEnabled, _this$audio3, _this$video3;
7433
- return _regenerator.default.wrap(function _callee34$(_context34) {
7434
- while (1) switch (_context34.prev = _context34.next) {
7619
+ return _regenerator.default.wrap(function _callee36$(_context36) {
7620
+ while (1) switch (_context36.prev = _context36.next) {
7435
7621
  case 0:
7436
7622
  this.checkMediaConnection();
7437
7623
  audioEnabled = options.audioEnabled, videoEnabled = options.videoEnabled, shareAudioEnabled = options.shareAudioEnabled, shareVideoEnabled = options.shareVideoEnabled;
7438
7624
  _loggerProxy.default.logger.log("Meeting:index#updateMedia --> called with options=".concat((0, _stringify.default)(options)));
7439
7625
  if (this.canUpdateMedia()) {
7440
- _context34.next = 5;
7626
+ _context36.next = 5;
7441
7627
  break;
7442
7628
  }
7443
- return _context34.abrupt("return", this.enqueueMediaUpdate(MEDIA_UPDATE_TYPE.UPDATE_MEDIA, options));
7629
+ return _context36.abrupt("return", this.enqueueMediaUpdate(MEDIA_UPDATE_TYPE.UPDATE_MEDIA, options));
7444
7630
  case 5:
7445
7631
  if (!this.isMultistream) {
7446
- _context34.next = 10;
7632
+ _context36.next = 10;
7447
7633
  break;
7448
7634
  }
7449
7635
  if (!(shareAudioEnabled !== undefined || shareVideoEnabled !== undefined)) {
7450
- _context34.next = 8;
7636
+ _context36.next = 8;
7451
7637
  break;
7452
7638
  }
7453
7639
  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');
7454
7640
  case 8:
7455
- _context34.next = 12;
7641
+ _context36.next = 12;
7456
7642
  break;
7457
7643
  case 10:
7458
7644
  if (!(shareAudioEnabled !== undefined)) {
7459
- _context34.next = 12;
7645
+ _context36.next = 12;
7460
7646
  break;
7461
7647
  }
7462
7648
  throw new Error('toggling shareAudioEnabled in a transcoded meeting is not supported as of now');
@@ -7481,20 +7667,20 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7481
7667
  this.mediaProperties.mediaDirection.receiveShare = !!(shareAudioEnabled || shareVideoEnabled);
7482
7668
  }
7483
7669
  if (this.isMultistream) {
7484
- _context34.next = 18;
7670
+ _context36.next = 18;
7485
7671
  break;
7486
7672
  }
7487
- _context34.next = 18;
7673
+ _context36.next = 18;
7488
7674
  return this.updateTranscodedMediaConnection();
7489
7675
  case 18:
7490
- return _context34.abrupt("return", undefined);
7676
+ return _context36.abrupt("return", undefined);
7491
7677
  case 19:
7492
7678
  case "end":
7493
- return _context34.stop();
7679
+ return _context36.stop();
7494
7680
  }
7495
- }, _callee34, this);
7681
+ }, _callee36, this);
7496
7682
  }));
7497
- function updateMedia(_x35) {
7683
+ function updateMedia(_x36) {
7498
7684
  return _updateMedia.apply(this, arguments);
7499
7685
  }
7500
7686
  return updateMedia;
@@ -7510,7 +7696,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7510
7696
  }, {
7511
7697
  key: "acknowledge",
7512
7698
  value: function acknowledge(type) {
7513
- var _this44 = this;
7699
+ var _this45 = this;
7514
7700
  if (!type) {
7515
7701
  return _promise.default.reject(new _parameter.default('Type must be set to acknowledge the meeting.'));
7516
7702
  }
@@ -7522,12 +7708,12 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7522
7708
  }).then(function (response) {
7523
7709
  return _promise.default.resolve(response);
7524
7710
  }).then(function (response) {
7525
- _this44.meetingFiniteStateMachine.ring(type);
7711
+ _this45.meetingFiniteStateMachine.ring(type);
7526
7712
  // @ts-ignore
7527
- _this44.webex.internal.newMetrics.submitClientEvent({
7713
+ _this45.webex.internal.newMetrics.submitClientEvent({
7528
7714
  name: 'client.alert.displayed',
7529
7715
  options: {
7530
- meetingId: _this44.id
7716
+ meetingId: _this45.id
7531
7717
  }
7532
7718
  });
7533
7719
  return _promise.default.resolve({
@@ -7552,12 +7738,12 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7552
7738
  }, {
7553
7739
  key: "decline",
7554
7740
  value: function decline(reason) {
7555
- var _this45 = this;
7741
+ var _this46 = this;
7556
7742
  return _util2.default.declineMeeting(this, reason).then(function (decline) {
7557
- _this45.meetingFiniteStateMachine.decline();
7743
+ _this46.meetingFiniteStateMachine.decline();
7558
7744
  return _promise.default.resolve(decline);
7559
7745
  }).catch(function (error) {
7560
- _this45.meetingFiniteStateMachine.fail(error);
7746
+ _this46.meetingFiniteStateMachine.fail(error);
7561
7747
  return _promise.default.reject(error);
7562
7748
  });
7563
7749
  }
@@ -7608,7 +7794,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7608
7794
  }, {
7609
7795
  key: "leave",
7610
7796
  value: function leave() {
7611
- var _this46 = this;
7797
+ var _this47 = this;
7612
7798
  var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
7613
7799
  var leaveReason = options.reason || _constants.MEETING_REMOVED_REASON.CLIENT_LEAVE_REQUEST;
7614
7800
 
@@ -7620,7 +7806,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7620
7806
  var payload = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
7621
7807
  return (
7622
7808
  // @ts-ignore
7623
- _this46.webex.internal.newMetrics.submitClientEvent({
7809
+ _this47.webex.internal.newMetrics.submitClientEvent({
7624
7810
  name: 'client.call.leave',
7625
7811
  payload: _objectSpread({
7626
7812
  trigger: 'user-interaction',
@@ -7628,7 +7814,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7628
7814
  leaveReason: options.clientEventLeaveReason
7629
7815
  }, payload),
7630
7816
  options: {
7631
- meetingId: _this46.id
7817
+ meetingId: _this47.id
7632
7818
  }
7633
7819
  })
7634
7820
  );
@@ -7637,24 +7823,24 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7637
7823
  return _util2.default.leaveMeeting(this, options).then(function (leave) {
7638
7824
  // CA team recommends submitting this *after* locus /leave
7639
7825
  submitLeaveMetric();
7640
- _this46.meetingFiniteStateMachine.leave();
7641
- _this46.clearMeetingData();
7826
+ _this47.meetingFiniteStateMachine.leave();
7827
+ _this47.clearMeetingData();
7642
7828
 
7643
7829
  // upload logs on leave irrespective of meeting delete
7644
- _triggerProxy.default.trigger(_this46, {
7830
+ _triggerProxy.default.trigger(_this47, {
7645
7831
  file: 'meeting/index',
7646
7832
  function: 'leave'
7647
- }, _constants.EVENTS.REQUEST_UPLOAD_LOGS, _this46);
7833
+ }, _constants.EVENTS.REQUEST_UPLOAD_LOGS, _this47);
7648
7834
 
7649
7835
  // TODO: more testing before we remove this code, we are not sure the scenarios for destroy here
7650
- if (_this46.wirelessShare || _this46.guest) {
7836
+ if (_this47.wirelessShare || _this47.guest) {
7651
7837
  // If screen sharing clean the meeting object
7652
- _triggerProxy.default.trigger(_this46, {
7838
+ _triggerProxy.default.trigger(_this47, {
7653
7839
  file: 'meeting/index',
7654
7840
  function: 'leave'
7655
7841
  }, _constants.EVENTS.DESTROY_MEETING, {
7656
7842
  reason: options.reason,
7657
- meetingId: _this46.id
7843
+ meetingId: _this47.id
7658
7844
  });
7659
7845
  }
7660
7846
  _loggerProxy.default.logger.log('Meeting:index#leave --> LEAVE REASON ', leaveReason);
@@ -7671,16 +7857,16 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7671
7857
  shownToUser: false
7672
7858
  }]
7673
7859
  });
7674
- _this46.meetingFiniteStateMachine.fail(error);
7860
+ _this47.meetingFiniteStateMachine.fail(error);
7675
7861
  _loggerProxy.default.logger.error('Meeting:index#leave --> Failed to leave ', error);
7676
7862
  // upload logs on leave irrespective of meeting delete
7677
- _triggerProxy.default.trigger(_this46, {
7863
+ _triggerProxy.default.trigger(_this47, {
7678
7864
  file: 'meeting/index',
7679
7865
  function: 'leave'
7680
- }, _constants.EVENTS.REQUEST_UPLOAD_LOGS, _this46);
7866
+ }, _constants.EVENTS.REQUEST_UPLOAD_LOGS, _this47);
7681
7867
  _metrics.default.sendBehavioralMetric(_constants2.default.MEETING_LEAVE_FAILURE, {
7682
- correlation_id: _this46.correlationId,
7683
- locus_id: _this46.locusUrl.split('/').pop(),
7868
+ correlation_id: _this47.correlationId,
7869
+ locus_id: _this47.locusUrl.split('/').pop(),
7684
7870
  reason: error.message,
7685
7871
  stack: error.stack,
7686
7872
  code: error.code
@@ -7700,7 +7886,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7700
7886
  }, {
7701
7887
  key: "startWhiteboardShare",
7702
7888
  value: function startWhiteboardShare(channelUrl, resourceToken) {
7703
- var _this47 = this;
7889
+ var _this48 = this;
7704
7890
  var whiteboard = this.locusInfo.mediaShares.find(function (element) {
7705
7891
  return element.name === 'whiteboard';
7706
7892
  });
@@ -7729,13 +7915,13 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7729
7915
  body.resourceToken = resourceToken;
7730
7916
  }
7731
7917
  return this.meetingRequest.changeMeetingFloor(body).then(function () {
7732
- _this47.screenShareFloorState = ScreenShareFloorStatus.RELEASED;
7918
+ _this48.screenShareFloorState = ScreenShareFloorStatus.RELEASED;
7733
7919
  return _promise.default.resolve();
7734
7920
  }).catch(function (error) {
7735
7921
  _loggerProxy.default.logger.error('Meeting:index#startWhiteboardShare --> Error ', error);
7736
7922
  _metrics.default.sendBehavioralMetric(_constants2.default.MEETING_START_WHITEBOARD_SHARE_FAILURE, {
7737
- correlation_id: _this47.correlationId,
7738
- locus_id: _this47.locusUrl.split('/').pop(),
7923
+ correlation_id: _this48.correlationId,
7924
+ locus_id: _this48.locusUrl.split('/').pop(),
7739
7925
  reason: error.message,
7740
7926
  stack: error.stack,
7741
7927
  board: {
@@ -7758,7 +7944,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7758
7944
  }, {
7759
7945
  key: "stopWhiteboardShare",
7760
7946
  value: function stopWhiteboardShare(channelUrl) {
7761
- var _this48 = this;
7947
+ var _this49 = this;
7762
7948
  var whiteboard = this.locusInfo.mediaShares.find(function (element) {
7763
7949
  return element.name === 'whiteboard';
7764
7950
  });
@@ -7781,8 +7967,8 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7781
7967
  }).catch(function (error) {
7782
7968
  _loggerProxy.default.logger.error('Meeting:index#stopWhiteboardShare --> Error ', error);
7783
7969
  _metrics.default.sendBehavioralMetric(_constants2.default.MEETING_STOP_WHITEBOARD_SHARE_FAILURE, {
7784
- correlation_id: _this48.correlationId,
7785
- locus_id: _this48.locusUrl.split('/').pop(),
7970
+ correlation_id: _this49.correlationId,
7971
+ locus_id: _this49.locusUrl.split('/').pop(),
7786
7972
  reason: error.message,
7787
7973
  stack: error.stack,
7788
7974
  board: {
@@ -7804,7 +7990,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7804
7990
  }, {
7805
7991
  key: "requestScreenShareFloor",
7806
7992
  value: function requestScreenShareFloor() {
7807
- var _this49 = this;
7993
+ var _this50 = this;
7808
7994
  if (!this.mediaProperties.hasLocalShareStream() || !this.mediaProperties.mediaDirection.sendShare) {
7809
7995
  _loggerProxy.default.logger.log("Meeting:index#requestScreenShareFloor --> NOT requesting floor, because we don't have the share stream anymore (shareStream=".concat(this.mediaProperties.shareVideoStream ? 'yes' : 'no', ", sendShare=").concat(this.mediaProperties.mediaDirection.sendShare, ")"));
7810
7996
  this.screenShareFloorState = ScreenShareFloorStatus.RELEASED;
@@ -7835,34 +8021,34 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7835
8021
  resourceUrl: this.resourceUrl,
7836
8022
  shareInstanceId: this.localShareInstanceId
7837
8023
  }).then(function () {
7838
- _this49.screenShareFloorState = ScreenShareFloorStatus.GRANTED;
8024
+ _this50.screenShareFloorState = ScreenShareFloorStatus.GRANTED;
7839
8025
  _metrics.default.sendBehavioralMetric(_constants2.default.MEETING_SHARE_SUCCESS, {
7840
- correlation_id: _this49.correlationId,
7841
- locus_id: _this49.locusUrl.split('/').pop()
8026
+ correlation_id: _this50.correlationId,
8027
+ locus_id: _this50.locusUrl.split('/').pop()
7842
8028
  });
7843
8029
  return _promise.default.resolve();
7844
8030
  }).catch(function (error) {
7845
8031
  _loggerProxy.default.logger.error('Meeting:index#share --> Error ', error);
7846
8032
  _metrics.default.sendBehavioralMetric(_constants2.default.MEETING_SHARE_FAILURE, {
7847
- correlation_id: _this49.correlationId,
7848
- locus_id: _this49.locusUrl.split('/').pop(),
8033
+ correlation_id: _this50.correlationId,
8034
+ locus_id: _this50.locusUrl.split('/').pop(),
7849
8035
  reason: error.message,
7850
8036
  stack: error.stack
7851
8037
  });
7852
8038
 
7853
8039
  // @ts-ignore
7854
- _this49.webex.internal.newMetrics.submitClientEvent({
8040
+ _this50.webex.internal.newMetrics.submitClientEvent({
7855
8041
  name: 'client.share.floor-granted.local',
7856
8042
  payload: {
7857
8043
  mediaType: 'share',
7858
8044
  errors: _util2.default.getChangeMeetingFloorErrorPayload(error.message),
7859
- shareInstanceId: _this49.localShareInstanceId
8045
+ shareInstanceId: _this50.localShareInstanceId
7860
8046
  },
7861
8047
  options: {
7862
- meetingId: _this49.id
8048
+ meetingId: _this50.id
7863
8049
  }
7864
8050
  });
7865
- _this49.screenShareFloorState = ScreenShareFloorStatus.RELEASED;
8051
+ _this50.screenShareFloorState = ScreenShareFloorStatus.RELEASED;
7866
8052
  return _promise.default.reject(error);
7867
8053
  });
7868
8054
  }
@@ -7885,10 +8071,10 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7885
8071
  }, {
7886
8072
  key: "requestScreenShareFloorIfPending",
7887
8073
  value: function requestScreenShareFloorIfPending() {
7888
- var _this50 = this;
8074
+ var _this51 = this;
7889
8075
  if (this.floorGrantPending && this.state === _constants.MEETING_STATE.STATES.JOINED) {
7890
8076
  this.requestScreenShareFloor().then(function () {
7891
- _this50.floorGrantPending = false;
8077
+ _this51.floorGrantPending = false;
7892
8078
  });
7893
8079
  }
7894
8080
  }
@@ -7902,7 +8088,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7902
8088
  }, {
7903
8089
  key: "releaseScreenShareFloor",
7904
8090
  value: function releaseScreenShareFloor() {
7905
- var _this51 = this;
8091
+ var _this52 = this;
7906
8092
  var content = this.locusInfo.mediaShares.find(function (element) {
7907
8093
  return element.name === _constants.CONTENT;
7908
8094
  });
@@ -7937,8 +8123,8 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7937
8123
  }).catch(function (error) {
7938
8124
  _loggerProxy.default.logger.error('Meeting:index#releaseScreenShareFloor --> Error ', error);
7939
8125
  _metrics.default.sendBehavioralMetric(_constants2.default.STOP_FLOOR_REQUEST_FAILURE, {
7940
- correlation_id: _this51.correlationId,
7941
- locus_id: _this51.locusUrl.split('/').pop(),
8126
+ correlation_id: _this52.correlationId,
8127
+ locus_id: _this52.locusUrl.split('/').pop(),
7942
8128
  reason: error.message,
7943
8129
  stack: error.stack
7944
8130
  });
@@ -8118,14 +8304,14 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
8118
8304
  }, {
8119
8305
  key: "changeVideoLayout",
8120
8306
  value: function changeVideoLayout(layoutType) {
8121
- var _this52 = this;
8307
+ var _this53 = this;
8122
8308
  var renderInfo = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
8123
8309
  var main = renderInfo.main,
8124
8310
  content = renderInfo.content;
8125
- var _this$mediaProperties34 = this.mediaProperties,
8126
- mediaDirection = _this$mediaProperties34.mediaDirection,
8127
- remoteShareStream = _this$mediaProperties34.remoteShareStream,
8128
- remoteVideoStream = _this$mediaProperties34.remoteVideoStream;
8311
+ var _this$mediaProperties36 = this.mediaProperties,
8312
+ mediaDirection = _this$mediaProperties36.mediaDirection,
8313
+ remoteShareStream = _this$mediaProperties36.remoteShareStream,
8314
+ remoteVideoStream = _this$mediaProperties36.remoteVideoStream;
8129
8315
  var layoutInfo = (0, _lodash.cloneDeep)(this.lastVideoLayoutInfo);
8130
8316
 
8131
8317
  // TODO: We need a real time value for Audio, Video and Share send indicator
@@ -8134,7 +8320,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
8134
8320
  }
8135
8321
  if (layoutType) {
8136
8322
  if (!_constants.LAYOUT_TYPES.includes(layoutType)) {
8137
- return this.rejectWithErrorLog('Meeting:index#changeVideoLayout --> cannot change video layout, invalid layoutType received.');
8323
+ return this.rejectWithErrorLog("Meeting:index#changeVideoLayout --> cannot change video layout, invalid layoutType \"".concat(layoutType, "\" received."));
8138
8324
  }
8139
8325
  layoutInfo.layoutType = layoutType;
8140
8326
  }
@@ -8172,7 +8358,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
8172
8358
  }
8173
8359
  this.lastVideoLayoutInfo = (0, _lodash.cloneDeep)(layoutInfo);
8174
8360
  this.locusInfo.once(_constants.LOCUSINFO.EVENTS.CONTROLS_MEETING_LAYOUT_UPDATED, function (envelope) {
8175
- _triggerProxy.default.trigger(_this52, {
8361
+ _triggerProxy.default.trigger(_this53, {
8176
8362
  file: 'meeting/index',
8177
8363
  function: 'changeVideoLayout'
8178
8364
  }, _constants.EVENT_TRIGGERS.MEETING_CONTROLS_LAYOUT_UPDATE, {
@@ -8288,7 +8474,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
8288
8474
  }, {
8289
8475
  key: "endMeetingForAll",
8290
8476
  value: function endMeetingForAll() {
8291
- var _this53 = this;
8477
+ var _this54 = this;
8292
8478
  // @ts-ignore
8293
8479
  this.webex.internal.newMetrics.submitClientEvent({
8294
8480
  name: 'client.call.leave',
@@ -8306,25 +8492,25 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
8306
8492
  locus_id: this.locusId
8307
8493
  });
8308
8494
  return _util2.default.endMeetingForAll(this).then(function (end) {
8309
- _this53.meetingFiniteStateMachine.end();
8310
- _this53.clearMeetingData();
8495
+ _this54.meetingFiniteStateMachine.end();
8496
+ _this54.clearMeetingData();
8311
8497
  // upload logs on leave irrespective of meeting delete
8312
- _triggerProxy.default.trigger(_this53, {
8498
+ _triggerProxy.default.trigger(_this54, {
8313
8499
  file: 'meeting/index',
8314
8500
  function: 'endMeetingForAll'
8315
- }, _constants.EVENTS.REQUEST_UPLOAD_LOGS, _this53);
8501
+ }, _constants.EVENTS.REQUEST_UPLOAD_LOGS, _this54);
8316
8502
  return end;
8317
8503
  }).catch(function (error) {
8318
- _this53.meetingFiniteStateMachine.fail(error);
8504
+ _this54.meetingFiniteStateMachine.fail(error);
8319
8505
  _loggerProxy.default.logger.error('Meeting:index#endMeetingForAll --> Failed to end meeting ', error);
8320
8506
  // upload logs on leave irrespective of meeting delete
8321
- _triggerProxy.default.trigger(_this53, {
8507
+ _triggerProxy.default.trigger(_this54, {
8322
8508
  file: 'meeting/index',
8323
8509
  function: 'endMeetingForAll'
8324
- }, _constants.EVENTS.REQUEST_UPLOAD_LOGS, _this53);
8510
+ }, _constants.EVENTS.REQUEST_UPLOAD_LOGS, _this54);
8325
8511
  _metrics.default.sendBehavioralMetric(_constants2.default.MEETING_END_ALL_FAILURE, {
8326
- correlation_id: _this53.correlationId,
8327
- locus_id: _this53.locusUrl.split('/').pop(),
8512
+ correlation_id: _this54.correlationId,
8513
+ locus_id: _this54.locusUrl.split('/').pop(),
8328
8514
  reason: error.message,
8329
8515
  stack: error.stack,
8330
8516
  code: error.code
@@ -8397,8 +8583,8 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
8397
8583
  }, {
8398
8584
  key: "checkMediaConnection",
8399
8585
  value: function checkMediaConnection() {
8400
- var _this$mediaProperties35;
8401
- if ((_this$mediaProperties35 = this.mediaProperties) !== null && _this$mediaProperties35 !== void 0 && _this$mediaProperties35.webrtcMediaConnection) {
8586
+ var _this$mediaProperties37;
8587
+ if ((_this$mediaProperties37 = this.mediaProperties) !== null && _this$mediaProperties37 !== void 0 && _this$mediaProperties37.webrtcMediaConnection) {
8402
8588
  return;
8403
8589
  }
8404
8590
  throw new _webexErrors.NoMediaEstablishedYetError();
@@ -8413,39 +8599,39 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
8413
8599
  }, {
8414
8600
  key: "enableMusicMode",
8415
8601
  value: (function () {
8416
- var _enableMusicMode = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee35(shouldEnableMusicMode) {
8417
- return _regenerator.default.wrap(function _callee35$(_context35) {
8418
- while (1) switch (_context35.prev = _context35.next) {
8602
+ var _enableMusicMode = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee37(shouldEnableMusicMode) {
8603
+ return _regenerator.default.wrap(function _callee37$(_context37) {
8604
+ while (1) switch (_context37.prev = _context37.next) {
8419
8605
  case 0:
8420
8606
  this.checkMediaConnection();
8421
8607
  if (this.isMultistream) {
8422
- _context35.next = 3;
8608
+ _context37.next = 3;
8423
8609
  break;
8424
8610
  }
8425
8611
  throw new Error('enableMusicMode() only supported with multistream');
8426
8612
  case 3:
8427
8613
  if (!shouldEnableMusicMode) {
8428
- _context35.next = 8;
8614
+ _context37.next = 8;
8429
8615
  break;
8430
8616
  }
8431
- _context35.next = 6;
8617
+ _context37.next = 6;
8432
8618
  return this.sendSlotManager.setCodecParameters(_internalMediaCore.MediaType.AudioMain, {
8433
8619
  maxaveragebitrate: '64000',
8434
8620
  maxplaybackrate: '48000'
8435
8621
  });
8436
8622
  case 6:
8437
- _context35.next = 10;
8623
+ _context37.next = 10;
8438
8624
  break;
8439
8625
  case 8:
8440
- _context35.next = 10;
8626
+ _context37.next = 10;
8441
8627
  return this.sendSlotManager.deleteCodecParameters(_internalMediaCore.MediaType.AudioMain, ['maxaveragebitrate', 'maxplaybackrate']);
8442
8628
  case 10:
8443
8629
  case "end":
8444
- return _context35.stop();
8630
+ return _context37.stop();
8445
8631
  }
8446
- }, _callee35, this);
8632
+ }, _callee37, this);
8447
8633
  }));
8448
- function enableMusicMode(_x36) {
8634
+ function enableMusicMode(_x37) {
8449
8635
  return _enableMusicMode.apply(this, arguments);
8450
8636
  }
8451
8637
  return enableMusicMode;
@@ -8458,15 +8644,15 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
8458
8644
  }, {
8459
8645
  key: "updateTranscodedMediaConnection",
8460
8646
  value: function updateTranscodedMediaConnection() {
8461
- var _this$mediaProperties36,
8462
- _this$mediaProperties37,
8463
- _this$mediaProperties38,
8647
+ var _this$mediaProperties38,
8464
8648
  _this$mediaProperties39,
8465
8649
  _this$mediaProperties40,
8466
8650
  _this$mediaProperties41,
8467
8651
  _this$mediaProperties42,
8468
8652
  _this$mediaProperties43,
8469
- _this54 = this;
8653
+ _this$mediaProperties44,
8654
+ _this$mediaProperties45,
8655
+ _this55 = this;
8470
8656
  var LOG_HEADER = 'Meeting:index#updateTranscodedMediaConnection -->';
8471
8657
  _loggerProxy.default.logger.info("".concat(LOG_HEADER, " starting"));
8472
8658
  if (!this.canUpdateMedia()) {
@@ -8475,10 +8661,10 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
8475
8661
  return this.mediaProperties.webrtcMediaConnection.update({
8476
8662
  // TODO: RoapMediaConnection is not ready to use stream classes yet, so we pass the raw MediaStreamTrack for now
8477
8663
  localTracks: {
8478
- audio: ((_this$mediaProperties36 = this.mediaProperties.audioStream) === null || _this$mediaProperties36 === void 0 ? void 0 : (_this$mediaProperties37 = _this$mediaProperties36.outputStream) === null || _this$mediaProperties37 === void 0 ? void 0 : _this$mediaProperties37.getTracks()[0]) || null,
8479
- video: ((_this$mediaProperties38 = this.mediaProperties.videoStream) === null || _this$mediaProperties38 === void 0 ? void 0 : (_this$mediaProperties39 = _this$mediaProperties38.outputStream) === null || _this$mediaProperties39 === void 0 ? void 0 : _this$mediaProperties39.getTracks()[0]) || null,
8480
- screenShareVideo: ((_this$mediaProperties40 = this.mediaProperties.shareVideoStream) === null || _this$mediaProperties40 === void 0 ? void 0 : (_this$mediaProperties41 = _this$mediaProperties40.outputStream) === null || _this$mediaProperties41 === void 0 ? void 0 : _this$mediaProperties41.getTracks()[0]) || null,
8481
- screenShareAudio: ((_this$mediaProperties42 = this.mediaProperties.shareAudioStream) === null || _this$mediaProperties42 === void 0 ? void 0 : (_this$mediaProperties43 = _this$mediaProperties42.outputStream) === null || _this$mediaProperties43 === void 0 ? void 0 : _this$mediaProperties43.getTracks()[0]) || null
8664
+ audio: ((_this$mediaProperties38 = this.mediaProperties.audioStream) === null || _this$mediaProperties38 === void 0 ? void 0 : (_this$mediaProperties39 = _this$mediaProperties38.outputStream) === null || _this$mediaProperties39 === void 0 ? void 0 : _this$mediaProperties39.getTracks()[0]) || null,
8665
+ video: ((_this$mediaProperties40 = this.mediaProperties.videoStream) === null || _this$mediaProperties40 === void 0 ? void 0 : (_this$mediaProperties41 = _this$mediaProperties40.outputStream) === null || _this$mediaProperties41 === void 0 ? void 0 : _this$mediaProperties41.getTracks()[0]) || null,
8666
+ screenShareVideo: ((_this$mediaProperties42 = this.mediaProperties.shareVideoStream) === null || _this$mediaProperties42 === void 0 ? void 0 : (_this$mediaProperties43 = _this$mediaProperties42.outputStream) === null || _this$mediaProperties43 === void 0 ? void 0 : _this$mediaProperties43.getTracks()[0]) || null,
8667
+ screenShareAudio: ((_this$mediaProperties44 = this.mediaProperties.shareAudioStream) === null || _this$mediaProperties44 === void 0 ? void 0 : (_this$mediaProperties45 = _this$mediaProperties44.outputStream) === null || _this$mediaProperties45 === void 0 ? void 0 : _this$mediaProperties45.getTracks()[0]) || null
8482
8668
  },
8483
8669
  direction: {
8484
8670
  audio: _media.default.getDirection(true, this.mediaProperties.mediaDirection.receiveAudio, this.mediaProperties.mediaDirection.sendAudio),
@@ -8491,8 +8677,8 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
8491
8677
  }).catch(function (error) {
8492
8678
  _loggerProxy.default.logger.error("".concat(LOG_HEADER, " Error: "), error);
8493
8679
  _metrics.default.sendBehavioralMetric(_constants2.default.UPDATE_MEDIA_FAILURE, {
8494
- correlation_id: _this54.correlationId,
8495
- locus_id: _this54.locusUrl.split('/').pop(),
8680
+ correlation_id: _this55.correlationId,
8681
+ locus_id: _this55.locusUrl.split('/').pop(),
8496
8682
  reason: error.message,
8497
8683
  stack: error.stack
8498
8684
  });
@@ -8536,25 +8722,25 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
8536
8722
  }, {
8537
8723
  key: "publishStream",
8538
8724
  value: (function () {
8539
- var _publishStream = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee36(mediaType, stream) {
8540
- return _regenerator.default.wrap(function _callee36$(_context36) {
8541
- while (1) switch (_context36.prev = _context36.next) {
8725
+ var _publishStream = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee38(mediaType, stream) {
8726
+ return _regenerator.default.wrap(function _callee38$(_context38) {
8727
+ while (1) switch (_context38.prev = _context38.next) {
8542
8728
  case 0:
8543
8729
  if (stream) {
8544
- _context36.next = 2;
8730
+ _context38.next = 2;
8545
8731
  break;
8546
8732
  }
8547
- return _context36.abrupt("return");
8733
+ return _context38.abrupt("return");
8548
8734
  case 2:
8549
8735
  if (!this.mediaProperties.webrtcMediaConnection) {
8550
- _context36.next = 7;
8736
+ _context38.next = 7;
8551
8737
  break;
8552
8738
  }
8553
8739
  if (!(this.isMultistream && this.mediaProperties.webrtcMediaConnection)) {
8554
- _context36.next = 6;
8740
+ _context38.next = 6;
8555
8741
  break;
8556
8742
  }
8557
- _context36.next = 6;
8743
+ _context38.next = 6;
8558
8744
  return this.sendSlotManager.publishStream(mediaType, stream);
8559
8745
  case 6:
8560
8746
  this.emitPublishStateChangeEvent({
@@ -8565,11 +8751,11 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
8565
8751
  });
8566
8752
  case 7:
8567
8753
  case "end":
8568
- return _context36.stop();
8754
+ return _context38.stop();
8569
8755
  }
8570
- }, _callee36, this);
8756
+ }, _callee38, this);
8571
8757
  }));
8572
- function publishStream(_x37, _x38) {
8758
+ function publishStream(_x38, _x39) {
8573
8759
  return _publishStream.apply(this, arguments);
8574
8760
  }
8575
8761
  return publishStream;
@@ -8585,21 +8771,21 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
8585
8771
  }, {
8586
8772
  key: "unpublishStream",
8587
8773
  value: (function () {
8588
- var _unpublishStream = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee37(mediaType, stream) {
8589
- return _regenerator.default.wrap(function _callee37$(_context37) {
8590
- while (1) switch (_context37.prev = _context37.next) {
8774
+ var _unpublishStream = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee39(mediaType, stream) {
8775
+ return _regenerator.default.wrap(function _callee39$(_context39) {
8776
+ while (1) switch (_context39.prev = _context39.next) {
8591
8777
  case 0:
8592
8778
  if (stream) {
8593
- _context37.next = 2;
8779
+ _context39.next = 2;
8594
8780
  break;
8595
8781
  }
8596
- return _context37.abrupt("return");
8782
+ return _context39.abrupt("return");
8597
8783
  case 2:
8598
8784
  if (!(this.isMultistream && this.mediaProperties.webrtcMediaConnection)) {
8599
- _context37.next = 5;
8785
+ _context39.next = 5;
8600
8786
  break;
8601
8787
  }
8602
- _context37.next = 5;
8788
+ _context39.next = 5;
8603
8789
  return this.sendSlotManager.unpublishStream(mediaType);
8604
8790
  case 5:
8605
8791
  this.emitPublishStateChangeEvent({
@@ -8610,11 +8796,11 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
8610
8796
  });
8611
8797
  case 6:
8612
8798
  case "end":
8613
- return _context37.stop();
8799
+ return _context39.stop();
8614
8800
  }
8615
- }, _callee37, this);
8801
+ }, _callee39, this);
8616
8802
  }));
8617
- function unpublishStream(_x39, _x40) {
8803
+ function unpublishStream(_x40, _x41) {
8618
8804
  return _unpublishStream.apply(this, arguments);
8619
8805
  }
8620
8806
  return unpublishStream;
@@ -8629,19 +8815,19 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
8629
8815
  }, {
8630
8816
  key: "publishStreams",
8631
8817
  value: (function () {
8632
- var _publishStreams = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee38(streams) {
8818
+ var _publishStreams = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee40(streams) {
8633
8819
  var _streams$screenShare, _streams$screenShare2, _streams$screenShare3, _streams$screenShare4, _streams$screenShare5, _streams$screenShare6;
8634
8820
  var streamChecks, _i, _streamChecks, _streamChecks$_i, stream, name, floorRequestNeeded, _streams$screenShare7;
8635
- return _regenerator.default.wrap(function _callee38$(_context38) {
8636
- while (1) switch (_context38.prev = _context38.next) {
8821
+ return _regenerator.default.wrap(function _callee40$(_context40) {
8822
+ while (1) switch (_context40.prev = _context40.next) {
8637
8823
  case 0:
8638
8824
  _loggerProxy.default.logger.info("Meeting:index#publishStreams --> called with: ".concat((0, _stringify.default)(streams)));
8639
8825
  this.checkMediaConnection();
8640
8826
  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))) {
8641
- _context38.next = 4;
8827
+ _context40.next = 4;
8642
8828
  break;
8643
8829
  }
8644
- return _context38.abrupt("return");
8830
+ return _context40.abrupt("return");
8645
8831
  case 4:
8646
8832
  streamChecks = [{
8647
8833
  stream: streams === null || streams === void 0 ? void 0 : streams.microphone,
@@ -8659,62 +8845,62 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
8659
8845
  _i = 0, _streamChecks = streamChecks;
8660
8846
  case 6:
8661
8847
  if (!(_i < _streamChecks.length)) {
8662
- _context38.next = 13;
8848
+ _context40.next = 13;
8663
8849
  break;
8664
8850
  }
8665
8851
  _streamChecks$_i = _streamChecks[_i], stream = _streamChecks$_i.stream, name = _streamChecks$_i.name;
8666
8852
  if (!((stream === null || stream === void 0 ? void 0 : stream.readyState) === 'ended')) {
8667
- _context38.next = 10;
8853
+ _context40.next = 10;
8668
8854
  break;
8669
8855
  }
8670
8856
  throw new Error("Attempted to publish ".concat(name, " stream with ended readyState, correlationId=").concat(this.correlationId));
8671
8857
  case 10:
8672
8858
  _i++;
8673
- _context38.next = 6;
8859
+ _context40.next = 6;
8674
8860
  break;
8675
8861
  case 13:
8676
8862
  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
8677
8863
  if (!(this.isMultistream && (_streams$screenShare5 = streams.screenShare) !== null && _streams$screenShare5 !== void 0 && _streams$screenShare5.audio)) {
8678
- _context38.next = 18;
8864
+ _context40.next = 18;
8679
8865
  break;
8680
8866
  }
8681
- _context38.next = 17;
8867
+ _context40.next = 17;
8682
8868
  return this.setLocalShareAudioStream(streams.screenShare.audio);
8683
8869
  case 17:
8684
8870
  floorRequestNeeded = this.screenShareFloorState === ScreenShareFloorStatus.RELEASED;
8685
8871
  case 18:
8686
8872
  if (!((_streams$screenShare6 = streams.screenShare) !== null && _streams$screenShare6 !== void 0 && _streams$screenShare6.video)) {
8687
- _context38.next = 22;
8873
+ _context40.next = 22;
8688
8874
  break;
8689
8875
  }
8690
- _context38.next = 21;
8876
+ _context40.next = 21;
8691
8877
  return this.setLocalShareVideoStream((_streams$screenShare7 = streams.screenShare) === null || _streams$screenShare7 === void 0 ? void 0 : _streams$screenShare7.video);
8692
8878
  case 21:
8693
8879
  floorRequestNeeded = this.screenShareFloorState === ScreenShareFloorStatus.RELEASED;
8694
8880
  case 22:
8695
8881
  if (!streams.microphone) {
8696
- _context38.next = 25;
8882
+ _context40.next = 25;
8697
8883
  break;
8698
8884
  }
8699
- _context38.next = 25;
8885
+ _context40.next = 25;
8700
8886
  return this.setLocalAudioStream(streams.microphone);
8701
8887
  case 25:
8702
8888
  if (!streams.camera) {
8703
- _context38.next = 28;
8889
+ _context40.next = 28;
8704
8890
  break;
8705
8891
  }
8706
- _context38.next = 28;
8892
+ _context40.next = 28;
8707
8893
  return this.setLocalVideoStream(streams.camera);
8708
8894
  case 28:
8709
8895
  if (this.isMultistream) {
8710
- _context38.next = 31;
8896
+ _context40.next = 31;
8711
8897
  break;
8712
8898
  }
8713
- _context38.next = 31;
8899
+ _context40.next = 31;
8714
8900
  return this.updateTranscodedMediaConnection();
8715
8901
  case 31:
8716
8902
  if (!floorRequestNeeded) {
8717
- _context38.next = 37;
8903
+ _context40.next = 37;
8718
8904
  break;
8719
8905
  }
8720
8906
  this.localShareInstanceId = _uuid.default.v4();
@@ -8738,15 +8924,15 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
8738
8924
  // we're sending the http request to Locus to request the screen share floor
8739
8925
  // only after the SDP update, because that's how it's always been done for transcoded meetings
8740
8926
  // and also if sharing from the start, we need confluence to have been created
8741
- _context38.next = 37;
8927
+ _context40.next = 37;
8742
8928
  return this.enqueueScreenShareFloorRequest();
8743
8929
  case 37:
8744
8930
  case "end":
8745
- return _context38.stop();
8931
+ return _context40.stop();
8746
8932
  }
8747
- }, _callee38, this);
8933
+ }, _callee40, this);
8748
8934
  }));
8749
- function publishStreams(_x41) {
8935
+ function publishStreams(_x42) {
8750
8936
  return _publishStreams.apply(this, arguments);
8751
8937
  }
8752
8938
  return publishStreams;
@@ -8761,10 +8947,10 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
8761
8947
  }, {
8762
8948
  key: "unpublishStreams",
8763
8949
  value: (function () {
8764
- var _unpublishStreams = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee39(streams) {
8950
+ var _unpublishStreams = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee41(streams) {
8765
8951
  var promises, _iterator, _step, stream;
8766
- return _regenerator.default.wrap(function _callee39$(_context39) {
8767
- while (1) switch (_context39.prev = _context39.next) {
8952
+ return _regenerator.default.wrap(function _callee41$(_context41) {
8953
+ while (1) switch (_context41.prev = _context41.next) {
8768
8954
  case 0:
8769
8955
  _loggerProxy.default.logger.info("Meeting:index#unpublishStreams --> called with: ".concat((0, _stringify.default)(streams)));
8770
8956
  this.checkMediaConnection();
@@ -8796,7 +8982,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
8796
8982
  if (!this.isMultistream) {
8797
8983
  promises.push(this.updateTranscodedMediaConnection());
8798
8984
  }
8799
- _context39.next = 8;
8985
+ _context41.next = 8;
8800
8986
  return _promise.default.all(promises);
8801
8987
  case 8:
8802
8988
  // we're allowing for the SDK to support just audio share as well
@@ -8817,11 +9003,11 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
8817
9003
  }
8818
9004
  case 9:
8819
9005
  case "end":
8820
- return _context39.stop();
9006
+ return _context41.stop();
8821
9007
  }
8822
- }, _callee39, this);
9008
+ }, _callee41, this);
8823
9009
  }));
8824
- function unpublishStreams(_x42) {
9010
+ function unpublishStreams(_x43) {
8825
9011
  return _unpublishStreams.apply(this, arguments);
8826
9012
  }
8827
9013
  return unpublishStreams;
@@ -8878,64 +9064,6 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
8878
9064
  }
8879
9065
  return _promise.default.resolve();
8880
9066
  }
8881
- }], [{
8882
- key: "handleDeviceLogging",
8883
- value: (function () {
8884
- var _handleDeviceLogging = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee40(isAudioEnabled, isVideoEnabled) {
8885
- var devices;
8886
- return _regenerator.default.wrap(function _callee40$(_context40) {
8887
- while (1) switch (_context40.prev = _context40.next) {
8888
- case 0:
8889
- _context40.prev = 0;
8890
- devices = [];
8891
- if (!(isVideoEnabled && isAudioEnabled)) {
8892
- _context40.next = 8;
8893
- break;
8894
- }
8895
- _context40.next = 5;
8896
- return (0, _mediaHelpers.getDevices)();
8897
- case 5:
8898
- devices = _context40.sent;
8899
- _context40.next = 18;
8900
- break;
8901
- case 8:
8902
- if (!isVideoEnabled) {
8903
- _context40.next = 14;
8904
- break;
8905
- }
8906
- _context40.next = 11;
8907
- return (0, _mediaHelpers.getDevices)(_media.default.DeviceKind.VIDEO_INPUT);
8908
- case 11:
8909
- devices = _context40.sent;
8910
- _context40.next = 18;
8911
- break;
8912
- case 14:
8913
- if (!isAudioEnabled) {
8914
- _context40.next = 18;
8915
- break;
8916
- }
8917
- _context40.next = 17;
8918
- return (0, _mediaHelpers.getDevices)(_media.default.DeviceKind.AUDIO_INPUT);
8919
- case 17:
8920
- devices = _context40.sent;
8921
- case 18:
8922
- _util2.default.handleDeviceLogging(devices);
8923
- _context40.next = 23;
8924
- break;
8925
- case 21:
8926
- _context40.prev = 21;
8927
- _context40.t0 = _context40["catch"](0);
8928
- case 23:
8929
- case "end":
8930
- return _context40.stop();
8931
- }
8932
- }, _callee40, null, [[0, 21]]);
8933
- }));
8934
- function handleDeviceLogging(_x43, _x44) {
8935
- return _handleDeviceLogging.apply(this, arguments);
8936
- }
8937
- return handleDeviceLogging;
8938
- }())
8939
9067
  }]);
8940
9068
  return Meeting;
8941
9069
  }(_webexCore.StatelessWebexPlugin);