@webex/plugin-meetings 3.7.0-next.5 → 3.7.0-next.51

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