@webex/plugin-meetings 3.0.0-beta.394 → 3.0.0-beta.396

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.
@@ -2949,7 +2949,7 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
2949
2949
  previousContentShare = (_payload$previous = payload.previous) === null || _payload$previous === void 0 ? void 0 : _payload$previous.content;
2950
2950
  previousWhiteboardShare = (_payload$previous2 = payload.previous) === null || _payload$previous2 === void 0 ? void 0 : _payload$previous2.whiteboard;
2951
2951
  _this14.triggerAnnotationInfoEvent(contentShare, previousContentShare);
2952
- 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))) {
2952
+ 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))) {
2953
2953
  _context8.next = 6;
2954
2954
  break;
2955
2955
  }
@@ -4744,36 +4744,123 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
4744
4744
  */
4745
4745
  }, {
4746
4746
  key: "joinWithMedia",
4747
- value: function joinWithMedia() {
4748
- var _this28 = this;
4749
- var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
4750
- var mediaOptions = options.mediaOptions,
4751
- joinOptions = options.joinOptions;
4752
- if (!(mediaOptions !== null && mediaOptions !== void 0 && mediaOptions.allowMediaInLobby)) {
4753
- return _promise.default.reject(new _parameter.default('joinWithMedia() can only be used with allowMediaInLobby set to true'));
4747
+ value: function () {
4748
+ var _joinWithMedia = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee15() {
4749
+ var options,
4750
+ mediaOptions,
4751
+ _options$joinOptions,
4752
+ joinOptions,
4753
+ joined,
4754
+ turnServerInfo,
4755
+ turnDiscoverySkippedReason,
4756
+ turnDiscoveryRequest,
4757
+ joinResponse,
4758
+ _yield$this$roap$hand,
4759
+ mediaResponse,
4760
+ _this$locusUrl,
4761
+ _leaveError,
4762
+ leaveError,
4763
+ _args15 = arguments;
4764
+ return _regenerator.default.wrap(function _callee15$(_context15) {
4765
+ while (1) switch (_context15.prev = _context15.next) {
4766
+ case 0:
4767
+ options = _args15.length > 0 && _args15[0] !== undefined ? _args15[0] : {};
4768
+ mediaOptions = options.mediaOptions, _options$joinOptions = options.joinOptions, joinOptions = _options$joinOptions === void 0 ? {} : _options$joinOptions;
4769
+ if (mediaOptions !== null && mediaOptions !== void 0 && mediaOptions.allowMediaInLobby) {
4770
+ _context15.next = 4;
4771
+ break;
4772
+ }
4773
+ return _context15.abrupt("return", _promise.default.reject(new _parameter.default('joinWithMedia() can only be used with allowMediaInLobby set to true')));
4774
+ case 4:
4775
+ this.allowMediaInLobby = true;
4776
+ _loggerProxy.default.logger.info('Meeting:index#joinWithMedia called');
4777
+ joined = false;
4778
+ _context15.prev = 7;
4779
+ _context15.next = 10;
4780
+ return this.webex.meetings.reachability.getReachabilityResults();
4781
+ case 10:
4782
+ joinOptions.reachability = _context15.sent;
4783
+ _context15.next = 13;
4784
+ return this.roap.generateTurnDiscoveryRequestMessage(this, true);
4785
+ case 13:
4786
+ turnDiscoveryRequest = _context15.sent;
4787
+ turnDiscoverySkippedReason = turnDiscoveryRequest.turnDiscoverySkippedReason;
4788
+ joinOptions.roapMessage = turnDiscoveryRequest.roapMessage;
4789
+ _context15.next = 18;
4790
+ return this.join(joinOptions);
4791
+ case 18:
4792
+ joinResponse = _context15.sent;
4793
+ joined = true;
4794
+ if (!joinOptions.roapMessage) {
4795
+ _context15.next = 29;
4796
+ break;
4797
+ }
4798
+ _context15.next = 23;
4799
+ return this.roap.handleTurnDiscoveryHttpResponse(this, joinResponse);
4800
+ case 23:
4801
+ _yield$this$roap$hand = _context15.sent;
4802
+ turnServerInfo = _yield$this$roap$hand.turnServerInfo;
4803
+ turnDiscoverySkippedReason = _yield$this$roap$hand.turnDiscoverySkippedReason;
4804
+ this.turnDiscoverySkippedReason = turnDiscoverySkippedReason;
4805
+ this.turnServerUsed = !!turnServerInfo;
4806
+ if (turnServerInfo === undefined) {
4807
+ this.roap.abortTurnDiscovery();
4808
+ }
4809
+ case 29:
4810
+ _context15.next = 31;
4811
+ return this.addMedia(mediaOptions, turnServerInfo);
4812
+ case 31:
4813
+ mediaResponse = _context15.sent;
4814
+ return _context15.abrupt("return", {
4815
+ join: joinResponse,
4816
+ media: mediaResponse
4817
+ });
4818
+ case 35:
4819
+ _context15.prev = 35;
4820
+ _context15.t0 = _context15["catch"](7);
4821
+ _loggerProxy.default.logger.error('Meeting:index#joinWithMedia --> ', _context15.t0);
4822
+ this.roap.abortTurnDiscovery();
4823
+ if (!joined) {
4824
+ _context15.next = 49;
4825
+ break;
4826
+ }
4827
+ _context15.prev = 40;
4828
+ _context15.next = 43;
4829
+ return this.leave({
4830
+ resourceId: joinOptions === null || joinOptions === void 0 ? void 0 : joinOptions.resourceId,
4831
+ reason: 'joinWithMedia failure'
4832
+ });
4833
+ case 43:
4834
+ _context15.next = 49;
4835
+ break;
4836
+ case 45:
4837
+ _context15.prev = 45;
4838
+ _context15.t1 = _context15["catch"](40);
4839
+ _loggerProxy.default.logger.error('Meeting:index#joinWithMedia --> leave error', _context15.t1);
4840
+ leaveError = _context15.t1;
4841
+ case 49:
4842
+ _metrics.default.sendBehavioralMetric(_constants2.default.JOIN_WITH_MEDIA_FAILURE, {
4843
+ correlation_id: this.correlationId,
4844
+ locus_id: (_this$locusUrl = this.locusUrl) === null || _this$locusUrl === void 0 ? void 0 : _this$locusUrl.split('/').pop(),
4845
+ // if join fails, we may end up with no locusUrl
4846
+ reason: _context15.t0.message,
4847
+ stack: _context15.t0.stack,
4848
+ leaveErrorReason: (_leaveError = leaveError) === null || _leaveError === void 0 ? void 0 : _leaveError.message
4849
+ }, {
4850
+ type: _context15.t0.name
4851
+ });
4852
+ throw _context15.t0;
4853
+ case 51:
4854
+ case "end":
4855
+ return _context15.stop();
4856
+ }
4857
+ }, _callee15, this, [[7, 35], [40, 45]]);
4858
+ }));
4859
+ function joinWithMedia() {
4860
+ return _joinWithMedia.apply(this, arguments);
4754
4861
  }
4755
- _loggerProxy.default.logger.info('Meeting:index#joinWithMedia called');
4756
- return this.join(joinOptions).then(function (joinResponse) {
4757
- return _this28.addMedia(mediaOptions).then(function (mediaResponse) {
4758
- return {
4759
- join: joinResponse,
4760
- media: mediaResponse
4761
- };
4762
- });
4763
- }).catch(function (error) {
4764
- _loggerProxy.default.logger.error('Meeting:index#joinWithMedia --> ', error);
4765
- _metrics.default.sendBehavioralMetric(_constants2.default.JOIN_WITH_MEDIA_FAILURE, {
4766
- correlation_id: _this28.correlationId,
4767
- locus_id: _this28.locusUrl.split('/').pop(),
4768
- reason: error.message,
4769
- stack: error.stack
4770
- }, {
4771
- type: error.name
4772
- });
4773
- return _promise.default.reject(error);
4774
- });
4775
- }
4776
-
4862
+ return joinWithMedia;
4863
+ }()
4777
4864
  /**
4778
4865
  * Initiates the reconnection of the media in the meeting
4779
4866
  *
@@ -4785,7 +4872,7 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
4785
4872
  }, {
4786
4873
  key: "reconnect",
4787
4874
  value: function reconnect(options) {
4788
- var _this29 = this;
4875
+ var _this28 = this;
4789
4876
  _loggerProxy.default.logger.log("Meeting:index#reconnect --> attempting to reconnect meeting ".concat(this.id));
4790
4877
  if (!this.reconnectionManager || !this.reconnectionManager.reconnect) {
4791
4878
  return _promise.default.reject(new _parameter.default('Cannot reconnect, ReconnectionManager must first be defined.'));
@@ -4813,29 +4900,29 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
4813
4900
  function: 'reconnect'
4814
4901
  }, _constants.EVENT_TRIGGERS.MEETING_RECONNECTION_STARTING);
4815
4902
  return this.reconnectionManager.reconnect(options).then(function () {
4816
- return _this29.waitForRemoteSDPAnswer();
4903
+ return _this28.waitForRemoteSDPAnswer();
4817
4904
  }).then(function () {
4818
- return _this29.waitForMediaConnectionConnected();
4905
+ return _this28.waitForMediaConnectionConnected();
4819
4906
  }).then(function () {
4820
- _triggerProxy.default.trigger(_this29, {
4907
+ _triggerProxy.default.trigger(_this28, {
4821
4908
  file: 'meeting/index',
4822
4909
  function: 'reconnect'
4823
4910
  }, _constants.EVENT_TRIGGERS.MEETING_RECONNECTION_SUCCESS);
4824
4911
  _loggerProxy.default.logger.log('Meeting:index#reconnect --> Meeting reconnect success');
4825
4912
 
4826
4913
  // @ts-ignore
4827
- _this29.webex.internal.newMetrics.submitClientEvent({
4914
+ _this28.webex.internal.newMetrics.submitClientEvent({
4828
4915
  name: 'client.media.recovered',
4829
4916
  payload: {
4830
4917
  recoveredBy: 'new'
4831
4918
  },
4832
4919
  options: {
4833
- meetingId: _this29.id
4920
+ meetingId: _this28.id
4834
4921
  }
4835
4922
  });
4836
- _this29.reconnectionManager.setStatus(_constants.RECONNECTION.STATE.COMPLETE);
4923
+ _this28.reconnectionManager.setStatus(_constants.RECONNECTION.STATE.COMPLETE);
4837
4924
  }).catch(function (error) {
4838
- _triggerProxy.default.trigger(_this29, {
4925
+ _triggerProxy.default.trigger(_this28, {
4839
4926
  file: 'meeting/index',
4840
4927
  function: 'reconnect'
4841
4928
  }, _constants.EVENT_TRIGGERS.MEETING_RECONNECTION_FAILURE, {
@@ -4843,18 +4930,18 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
4843
4930
  });
4844
4931
  _loggerProxy.default.logger.error('Meeting:index#reconnect --> Meeting reconnect failed', error);
4845
4932
  _metrics.default.sendBehavioralMetric(_constants2.default.MEETING_RECONNECT_FAILURE, {
4846
- correlation_id: _this29.correlationId,
4847
- locus_id: _this29.locusUrl.split('/').pop(),
4933
+ correlation_id: _this28.correlationId,
4934
+ locus_id: _this28.locusUrl.split('/').pop(),
4848
4935
  reason: error.message,
4849
4936
  stack: error.stack
4850
4937
  });
4851
- _this29.uploadLogs({
4938
+ _this28.uploadLogs({
4852
4939
  file: 'meeting/index',
4853
4940
  function: 'reconnect'
4854
4941
  });
4855
4942
  return _promise.default.reject(new _reconnection.default('Reconnection failure event', error));
4856
4943
  }).finally(function () {
4857
- _this29.reconnectionManager.reset();
4944
+ _this28.reconnectionManager.reset();
4858
4945
  });
4859
4946
  }
4860
4947
 
@@ -4897,19 +4984,19 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
4897
4984
  }, {
4898
4985
  key: "setCaptionLanguage",
4899
4986
  value: function setCaptionLanguage(language) {
4900
- var _this30 = this;
4987
+ var _this29 = this;
4901
4988
  return new _promise.default(function (resolve, reject) {
4902
- if (!_this30.isTranscriptionSupported()) {
4989
+ if (!_this29.isTranscriptionSupported()) {
4903
4990
  _loggerProxy.default.logger.error('Meeting:index#setCaptionLanguage --> Webex Assistant is not enabled/supported');
4904
4991
  reject(new Error('Webex Assistant is not enabled/supported'));
4905
4992
  }
4906
4993
  try {
4907
4994
  var voiceaListenerCaptionUpdate = function voiceaListenerCaptionUpdate(payload) {
4908
4995
  // @ts-ignore
4909
- _this30.webex.internal.voicea.off(_internalPluginVoicea.EVENT_TRIGGERS.CAPTION_LANGUAGE_UPDATE, voiceaListenerCaptionUpdate);
4996
+ _this29.webex.internal.voicea.off(_internalPluginVoicea.EVENT_TRIGGERS.CAPTION_LANGUAGE_UPDATE, voiceaListenerCaptionUpdate);
4910
4997
  var statusCode = payload.statusCode;
4911
4998
  if (statusCode === 200) {
4912
- _this30.transcription.languageOptions = _objectSpread(_objectSpread({}, _this30.transcription.languageOptions), {}, {
4999
+ _this29.transcription.languageOptions = _objectSpread(_objectSpread({}, _this29.transcription.languageOptions), {}, {
4913
5000
  currentCaptionLanguage: language
4914
5001
  });
4915
5002
  resolve(language);
@@ -4918,9 +5005,9 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
4918
5005
  }
4919
5006
  };
4920
5007
  // @ts-ignore
4921
- _this30.webex.internal.voicea.on(_internalPluginVoicea.EVENT_TRIGGERS.CAPTION_LANGUAGE_UPDATE, voiceaListenerCaptionUpdate);
5008
+ _this29.webex.internal.voicea.on(_internalPluginVoicea.EVENT_TRIGGERS.CAPTION_LANGUAGE_UPDATE, voiceaListenerCaptionUpdate);
4922
5009
  // @ts-ignore
4923
- _this30.webex.internal.voicea.requestLanguage(language);
5010
+ _this29.webex.internal.voicea.requestLanguage(language);
4924
5011
  } catch (error) {
4925
5012
  _loggerProxy.default.logger.error("Meeting:index#setCaptionLanguage --> ".concat(error));
4926
5013
  reject(error);
@@ -4936,19 +5023,19 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
4936
5023
  }, {
4937
5024
  key: "setSpokenLanguage",
4938
5025
  value: function setSpokenLanguage(language) {
4939
- var _this31 = this;
5026
+ var _this30 = this;
4940
5027
  return new _promise.default(function (resolve, reject) {
4941
- if (!_this31.isTranscriptionSupported()) {
5028
+ if (!_this30.isTranscriptionSupported()) {
4942
5029
  _loggerProxy.default.logger.error('Meeting:index#setCaptionLanguage --> Webex Assistant is not enabled/supported');
4943
5030
  reject(new Error('Webex Assistant is not enabled/supported'));
4944
5031
  }
4945
5032
  try {
4946
5033
  var voiceaListenerLanguageUpdate = function voiceaListenerLanguageUpdate(payload) {
4947
5034
  // @ts-ignore
4948
- _this31.webex.internal.voicea.off(_internalPluginVoicea.EVENT_TRIGGERS.SPOKEN_LANGUAGE_UPDATE, voiceaListenerLanguageUpdate);
5035
+ _this30.webex.internal.voicea.off(_internalPluginVoicea.EVENT_TRIGGERS.SPOKEN_LANGUAGE_UPDATE, voiceaListenerLanguageUpdate);
4949
5036
  var languageCode = payload.languageCode;
4950
5037
  if (languageCode) {
4951
- _this31.transcription.languageOptions = _objectSpread(_objectSpread({}, _this31.transcription.languageOptions), {}, {
5038
+ _this30.transcription.languageOptions = _objectSpread(_objectSpread({}, _this30.transcription.languageOptions), {}, {
4952
5039
  currentSpokenLanguage: languageCode
4953
5040
  });
4954
5041
  resolve(languageCode);
@@ -4958,10 +5045,10 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
4958
5045
  };
4959
5046
 
4960
5047
  // @ts-ignore
4961
- _this31.webex.internal.voicea.on(_internalPluginVoicea.EVENT_TRIGGERS.SPOKEN_LANGUAGE_UPDATE, voiceaListenerLanguageUpdate);
5048
+ _this30.webex.internal.voicea.on(_internalPluginVoicea.EVENT_TRIGGERS.SPOKEN_LANGUAGE_UPDATE, voiceaListenerLanguageUpdate);
4962
5049
 
4963
5050
  // @ts-ignore
4964
- _this31.webex.internal.voicea.setSpokenLanguage(language);
5051
+ _this30.webex.internal.voicea.setSpokenLanguage(language);
4965
5052
  } catch (error) {
4966
5053
  _loggerProxy.default.logger.error("Meeting:index#setSpokenLanguage --> ".concat(error));
4967
5054
  reject(error);
@@ -4978,48 +5065,48 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
4978
5065
  }, {
4979
5066
  key: "startTranscription",
4980
5067
  value: function () {
4981
- var _startTranscription = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee15(options) {
4982
- return _regenerator.default.wrap(function _callee15$(_context15) {
4983
- while (1) switch (_context15.prev = _context15.next) {
5068
+ var _startTranscription = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee16(options) {
5069
+ return _regenerator.default.wrap(function _callee16$(_context16) {
5070
+ while (1) switch (_context16.prev = _context16.next) {
4984
5071
  case 0:
4985
5072
  if (!this.isJoined()) {
4986
- _context15.next = 15;
5073
+ _context16.next = 15;
4987
5074
  break;
4988
5075
  }
4989
5076
  _loggerProxy.default.logger.info('Meeting:index#startTranscription --> Attempting to enable transcription!');
4990
- _context15.prev = 2;
5077
+ _context16.prev = 2;
4991
5078
  if (!this.areVoiceaEventsSetup) {
4992
5079
  this.setUpVoiceaListeners();
4993
5080
  }
4994
5081
  if (!(this.getCurUserType() === 'host')) {
4995
- _context15.next = 7;
5082
+ _context16.next = 7;
4996
5083
  break;
4997
5084
  }
4998
- _context15.next = 7;
5085
+ _context16.next = 7;
4999
5086
  return this.webex.internal.voicea.toggleTranscribing(true, options === null || options === void 0 ? void 0 : options.spokenLanguage);
5000
5087
  case 7:
5001
- _context15.next = 13;
5088
+ _context16.next = 13;
5002
5089
  break;
5003
5090
  case 9:
5004
- _context15.prev = 9;
5005
- _context15.t0 = _context15["catch"](2);
5006
- _loggerProxy.default.logger.error("Meeting:index#startTranscription --> ".concat(_context15.t0));
5091
+ _context16.prev = 9;
5092
+ _context16.t0 = _context16["catch"](2);
5093
+ _loggerProxy.default.logger.error("Meeting:index#startTranscription --> ".concat(_context16.t0));
5007
5094
  _metrics.default.sendBehavioralMetric(_constants2.default.RECEIVE_TRANSCRIPTION_FAILURE, {
5008
5095
  correlation_id: this.correlationId,
5009
- reason: _context15.t0.message,
5010
- stack: _context15.t0.stack
5096
+ reason: _context16.t0.message,
5097
+ stack: _context16.t0.stack
5011
5098
  });
5012
5099
  case 13:
5013
- _context15.next = 17;
5100
+ _context16.next = 17;
5014
5101
  break;
5015
5102
  case 15:
5016
5103
  _loggerProxy.default.logger.error("Meeting:index#startTranscription --> meeting joined : ".concat(this.isJoined()));
5017
5104
  throw new Error('Meeting is not joined');
5018
5105
  case 17:
5019
5106
  case "end":
5020
- return _context15.stop();
5107
+ return _context16.stop();
5021
5108
  }
5022
- }, _callee15, this, [[2, 9]]);
5109
+ }, _callee16, this, [[2, 9]]);
5023
5110
  }));
5024
5111
  function startTranscription(_x15) {
5025
5112
  return _startTranscription.apply(this, arguments);
@@ -5088,8 +5175,8 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
5088
5175
  }, {
5089
5176
  key: "join",
5090
5177
  value: function () {
5091
- var _join = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee16() {
5092
- var _this32 = this;
5178
+ var _join = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee17() {
5179
+ var _this31 = this;
5093
5180
  var options,
5094
5181
  errorMessage,
5095
5182
  error,
@@ -5099,25 +5186,25 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
5099
5186
  _error,
5100
5187
  _errorMessage2,
5101
5188
  _error2,
5102
- _args16 = arguments;
5103
- return _regenerator.default.wrap(function _callee16$(_context16) {
5104
- while (1) switch (_context16.prev = _context16.next) {
5189
+ _args17 = arguments;
5190
+ return _regenerator.default.wrap(function _callee17$(_context17) {
5191
+ while (1) switch (_context17.prev = _context17.next) {
5105
5192
  case 0:
5106
- options = _args16.length > 0 && _args16[0] !== undefined ? _args16[0] : {};
5193
+ options = _args17.length > 0 && _args17[0] !== undefined ? _args17[0] : {};
5107
5194
  if (this.webex.meetings.registered) {
5108
- _context16.next = 6;
5195
+ _context17.next = 6;
5109
5196
  break;
5110
5197
  }
5111
5198
  errorMessage = 'Meeting:index#join --> Device not registered';
5112
5199
  error = new Error(errorMessage);
5113
5200
  _loggerProxy.default.logger.error(errorMessage);
5114
- return _context16.abrupt("return", _promise.default.reject(error));
5201
+ return _context17.abrupt("return", _promise.default.reject(error));
5115
5202
  case 6:
5116
5203
  if (!this.deferJoin) {
5117
- _context16.next = 8;
5204
+ _context17.next = 8;
5118
5205
  break;
5119
5206
  }
5120
- return _context16.abrupt("return", this.deferJoin);
5207
+ return _context17.abrupt("return", this.deferJoin);
5121
5208
  case 8:
5122
5209
  // Create a deferred promise for a consistent resolve value from utils.
5123
5210
  // This also prevents redundant API calls.
@@ -5166,15 +5253,15 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
5166
5253
  this.wirelessShare = true;
5167
5254
  }
5168
5255
  if (!options.meetingQuality) {
5169
- _context16.next = 36;
5256
+ _context17.next = 36;
5170
5257
  break;
5171
5258
  }
5172
5259
  if (!(typeof options.meetingQuality === 'string')) {
5173
- _context16.next = 27;
5260
+ _context17.next = 27;
5174
5261
  break;
5175
5262
  }
5176
5263
  if (_constants.QUALITY_LEVELS[options.meetingQuality]) {
5177
- _context16.next = 26;
5264
+ _context17.next = 26;
5178
5265
  break;
5179
5266
  }
5180
5267
  _errorMessage = "Meeting:index#join --> ".concat(options.meetingQuality, " not defined");
@@ -5182,16 +5269,16 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
5182
5269
  _loggerProxy.default.logger.error(_errorMessage);
5183
5270
  joinFailed(_error);
5184
5271
  this.deferJoin = undefined;
5185
- return _context16.abrupt("return", _promise.default.reject(_error));
5272
+ return _context17.abrupt("return", _promise.default.reject(_error));
5186
5273
  case 26:
5187
5274
  this.mediaProperties.setRemoteQualityLevel(options.meetingQuality);
5188
5275
  case 27:
5189
5276
  if (!((0, _typeof2.default)(options.meetingQuality) === 'object')) {
5190
- _context16.next = 36;
5277
+ _context17.next = 36;
5191
5278
  break;
5192
5279
  }
5193
5280
  if (_constants.QUALITY_LEVELS[options.meetingQuality.remote]) {
5194
- _context16.next = 35;
5281
+ _context17.next = 35;
5195
5282
  break;
5196
5283
  }
5197
5284
  _errorMessage2 = "Meeting:index#join --> ".concat(options.meetingQuality.remote, " not defined");
@@ -5199,97 +5286,97 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
5199
5286
  _error2 = new Error(_errorMessage2);
5200
5287
  joinFailed(_error2);
5201
5288
  this.deferJoin = undefined;
5202
- return _context16.abrupt("return", _promise.default.reject(new Error(_errorMessage2)));
5289
+ return _context17.abrupt("return", _promise.default.reject(new Error(_errorMessage2)));
5203
5290
  case 35:
5204
5291
  if (options.meetingQuality.remote) {
5205
5292
  this.mediaProperties.setRemoteQualityLevel(options.meetingQuality.remote);
5206
5293
  }
5207
5294
  case 36:
5208
5295
  this.isMultistream = !!options.enableMultistream;
5209
- _context16.prev = 37;
5210
- _context16.next = 40;
5296
+ _context17.prev = 37;
5297
+ _context17.next = 40;
5211
5298
  return this.checkAndRefreshPermissionToken(_constants.MEETING_PERMISSION_TOKEN_REFRESH_THRESHOLD_IN_SEC, _constants.MEETING_PERMISSION_TOKEN_REFRESH_REASON);
5212
5299
  case 40:
5213
- _context16.next = 51;
5300
+ _context17.next = 51;
5214
5301
  break;
5215
5302
  case 42:
5216
- _context16.prev = 42;
5217
- _context16.t0 = _context16["catch"](37);
5218
- _loggerProxy.default.logger.error('Meeting:index#join --> Failed to refresh permission token:', _context16.t0);
5219
- if (!(_context16.t0 instanceof _captchaError.default || _context16.t0 instanceof _passwordError.default || _context16.t0 instanceof _permission.default)) {
5220
- _context16.next = 51;
5303
+ _context17.prev = 42;
5304
+ _context17.t0 = _context17["catch"](37);
5305
+ _loggerProxy.default.logger.error('Meeting:index#join --> Failed to refresh permission token:', _context17.t0);
5306
+ if (!(_context17.t0 instanceof _captchaError.default || _context17.t0 instanceof _passwordError.default || _context17.t0 instanceof _permission.default)) {
5307
+ _context17.next = 51;
5221
5308
  break;
5222
5309
  }
5223
- this.meetingFiniteStateMachine.fail(_context16.t0);
5310
+ this.meetingFiniteStateMachine.fail(_context17.t0);
5224
5311
 
5225
5312
  // Upload logs on refreshpermissionToken refresh Failure
5226
5313
  _triggerProxy.default.trigger(this, {
5227
5314
  file: 'meeting/index',
5228
5315
  function: 'join'
5229
5316
  }, _constants.EVENTS.REQUEST_UPLOAD_LOGS, this);
5230
- joinFailed(_context16.t0);
5317
+ joinFailed(_context17.t0);
5231
5318
  this.deferJoin = undefined;
5232
5319
 
5233
5320
  // if refresh permission token requires captcha, password or permission, we are throwing the errors
5234
5321
  // and bubble it up to client
5235
- return _context16.abrupt("return", _promise.default.reject(_context16.t0));
5322
+ return _context17.abrupt("return", _promise.default.reject(_context17.t0));
5236
5323
  case 51:
5237
- return _context16.abrupt("return", _util.default.joinMeetingOptions(this, options).then(function (join) {
5238
- _this32.meetingFiniteStateMachine.join();
5324
+ return _context17.abrupt("return", _util.default.joinMeetingOptions(this, options).then(function (join) {
5325
+ _this31.meetingFiniteStateMachine.join();
5239
5326
  _loggerProxy.default.logger.log('Meeting:index#join --> Success');
5240
5327
  _metrics.default.sendBehavioralMetric(_constants2.default.JOIN_SUCCESS, {
5241
- correlation_id: _this32.correlationId
5328
+ correlation_id: _this31.correlationId
5242
5329
  });
5243
5330
  joinSuccess(join);
5244
- _this32.deferJoin = undefined;
5331
+ _this31.deferJoin = undefined;
5245
5332
  return join;
5246
5333
  }).catch(function (error) {
5247
- var _this32$meetingInfo, _error$error;
5248
- _this32.meetingFiniteStateMachine.fail(error);
5334
+ var _this31$meetingInfo, _error$error;
5335
+ _this31.meetingFiniteStateMachine.fail(error);
5249
5336
  _loggerProxy.default.logger.error('Meeting:index#join --> Failed', error);
5250
5337
 
5251
5338
  // @ts-ignore
5252
- _this32.webex.internal.newMetrics.submitClientEvent({
5339
+ _this31.webex.internal.newMetrics.submitClientEvent({
5253
5340
  name: 'client.locus.join.response',
5254
5341
  payload: {
5255
5342
  identifiers: {
5256
- meetingLookupUrl: (_this32$meetingInfo = _this32.meetingInfo) === null || _this32$meetingInfo === void 0 ? void 0 : _this32$meetingInfo.meetingLookupUrl
5343
+ meetingLookupUrl: (_this31$meetingInfo = _this31.meetingInfo) === null || _this31$meetingInfo === void 0 ? void 0 : _this31$meetingInfo.meetingLookupUrl
5257
5344
  }
5258
5345
  },
5259
5346
  options: {
5260
- meetingId: _this32.id,
5347
+ meetingId: _this31.id,
5261
5348
  rawError: error
5262
5349
  }
5263
5350
  });
5264
5351
 
5265
5352
  // TODO: change this to error codes and pre defined dictionary
5266
5353
  _metrics.default.sendBehavioralMetric(_constants2.default.JOIN_FAILURE, {
5267
- correlation_id: _this32.correlationId,
5354
+ correlation_id: _this31.correlationId,
5268
5355
  reason: (_error$error = error.error) === null || _error$error === void 0 ? void 0 : _error$error.message,
5269
5356
  stack: error.stack
5270
5357
  });
5271
5358
 
5272
5359
  // Upload logs on join Failure
5273
- _triggerProxy.default.trigger(_this32, {
5360
+ _triggerProxy.default.trigger(_this31, {
5274
5361
  file: 'meeting/index',
5275
5362
  function: 'join'
5276
- }, _constants.EVENTS.REQUEST_UPLOAD_LOGS, _this32);
5363
+ }, _constants.EVENTS.REQUEST_UPLOAD_LOGS, _this31);
5277
5364
  joinFailed(error);
5278
- _this32.deferJoin = undefined;
5365
+ _this31.deferJoin = undefined;
5279
5366
  return _promise.default.reject(error);
5280
5367
  }).then(function (join) {
5281
5368
  // @ts-ignore - config coming from registerPlugin
5282
- if (_this32.config.enableAutomaticLLM) {
5283
- _this32.updateLLMConnection().catch(function (error) {
5369
+ if (_this31.config.enableAutomaticLLM) {
5370
+ _this31.updateLLMConnection().catch(function (error) {
5284
5371
  _loggerProxy.default.logger.error('Meeting:index#join --> Transcription Socket Connection Failed', error);
5285
5372
  _metrics.default.sendBehavioralMetric(_constants2.default.LLM_CONNECTION_AFTER_JOIN_FAILURE, {
5286
- correlation_id: _this32.correlationId,
5373
+ correlation_id: _this31.correlationId,
5287
5374
  reason: error === null || error === void 0 ? void 0 : error.message,
5288
5375
  stack: error.stack
5289
5376
  });
5290
5377
  }).then(function () {
5291
5378
  _loggerProxy.default.logger.info('Meeting:index#join --> Transcription Socket Connection Success');
5292
- _triggerProxy.default.trigger(_this32, {
5379
+ _triggerProxy.default.trigger(_this31, {
5293
5380
  file: 'meeting/index',
5294
5381
  function: 'join'
5295
5382
  }, _constants.EVENT_TRIGGERS.MEETING_TRANSCRIPTION_CONNECTED, undefined);
@@ -5299,9 +5386,9 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
5299
5386
  }));
5300
5387
  case 52:
5301
5388
  case "end":
5302
- return _context16.stop();
5389
+ return _context17.stop();
5303
5390
  }
5304
- }, _callee16, this, [[37, 42]]);
5391
+ }, _callee17, this, [[37, 42]]);
5305
5392
  }));
5306
5393
  function join() {
5307
5394
  return _join.apply(this, arguments);
@@ -5317,50 +5404,50 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
5317
5404
  }, {
5318
5405
  key: "updateLLMConnection",
5319
5406
  value: function () {
5320
- var _updateLLMConnection = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee17() {
5321
- var _this33 = this;
5407
+ var _updateLLMConnection = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee18() {
5408
+ var _this32 = this;
5322
5409
  var _this$locusInfo6, url, _this$locusInfo6$info, _this$locusInfo6$info2, datachannelUrl, isJoined;
5323
- return _regenerator.default.wrap(function _callee17$(_context17) {
5324
- while (1) switch (_context17.prev = _context17.next) {
5410
+ return _regenerator.default.wrap(function _callee18$(_context18) {
5411
+ while (1) switch (_context18.prev = _context18.next) {
5325
5412
  case 0:
5326
5413
  // @ts-ignore - Fix type
5327
5414
  _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;
5328
5415
  isJoined = this.isJoined(); // @ts-ignore - Fix type
5329
5416
  if (!this.webex.internal.llm.isConnected()) {
5330
- _context17.next = 8;
5417
+ _context18.next = 8;
5331
5418
  break;
5332
5419
  }
5333
5420
  if (!(url === this.webex.internal.llm.getLocusUrl() && isJoined)) {
5334
- _context17.next = 5;
5421
+ _context18.next = 5;
5335
5422
  break;
5336
5423
  }
5337
- return _context17.abrupt("return", undefined);
5424
+ return _context18.abrupt("return", undefined);
5338
5425
  case 5:
5339
- _context17.next = 7;
5426
+ _context18.next = 7;
5340
5427
  return this.webex.internal.llm.disconnectLLM();
5341
5428
  case 7:
5342
5429
  // @ts-ignore - Fix type
5343
5430
  this.webex.internal.llm.off('event:relay.event', this.processRelayEvent);
5344
5431
  case 8:
5345
5432
  if (isJoined) {
5346
- _context17.next = 10;
5433
+ _context18.next = 10;
5347
5434
  break;
5348
5435
  }
5349
- return _context17.abrupt("return", undefined);
5436
+ return _context18.abrupt("return", undefined);
5350
5437
  case 10:
5351
- return _context17.abrupt("return", this.webex.internal.llm.registerAndConnect(url, datachannelUrl).then(function (registerAndConnectResult) {
5438
+ return _context18.abrupt("return", this.webex.internal.llm.registerAndConnect(url, datachannelUrl).then(function (registerAndConnectResult) {
5352
5439
  // @ts-ignore - Fix type
5353
- _this33.webex.internal.llm.off('event:relay.event', _this33.processRelayEvent);
5440
+ _this32.webex.internal.llm.off('event:relay.event', _this32.processRelayEvent);
5354
5441
  // @ts-ignore - Fix type
5355
- _this33.webex.internal.llm.on('event:relay.event', _this33.processRelayEvent);
5442
+ _this32.webex.internal.llm.on('event:relay.event', _this32.processRelayEvent);
5356
5443
  _loggerProxy.default.logger.info('Meeting:index#updateLLMConnection --> enabled to receive relay events!');
5357
5444
  return _promise.default.resolve(registerAndConnectResult);
5358
5445
  }));
5359
5446
  case 11:
5360
5447
  case "end":
5361
- return _context17.stop();
5448
+ return _context18.stop();
5362
5449
  }
5363
- }, _callee17, this);
5450
+ }, _callee18, this);
5364
5451
  }));
5365
5452
  function updateLLMConnection() {
5366
5453
  return _updateLLMConnection.apply(this, arguments);
@@ -5405,7 +5492,7 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
5405
5492
  }, {
5406
5493
  key: "dialInPstn",
5407
5494
  value: function dialInPstn() {
5408
- var _this34 = this;
5495
+ var _this33 = this;
5409
5496
  if (this.isPhoneProvisioned(this.dialInDeviceStatus)) return _promise.default.resolve(); // prevent multiple dial in devices from being provisioned
5410
5497
 
5411
5498
  var correlationId = this.correlationId,
@@ -5421,10 +5508,10 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
5421
5508
  }).catch(function (error) {
5422
5509
  var _error$error2;
5423
5510
  _metrics.default.sendBehavioralMetric(_constants2.default.ADD_DIAL_IN_FAILURE, {
5424
- correlation_id: _this34.correlationId,
5425
- dial_in_url: _this34.dialInUrl,
5511
+ correlation_id: _this33.correlationId,
5512
+ dial_in_url: _this33.dialInUrl,
5426
5513
  locus_id: locusUrl.split('/').pop(),
5427
- client_url: _this34.deviceUrl,
5514
+ client_url: _this33.deviceUrl,
5428
5515
  reason: (_error$error2 = error.error) === null || _error$error2 === void 0 ? void 0 : _error$error2.message,
5429
5516
  stack: error.stack
5430
5517
  });
@@ -5442,7 +5529,7 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
5442
5529
  }, {
5443
5530
  key: "dialOutPstn",
5444
5531
  value: function dialOutPstn(phoneNumber) {
5445
- var _this35 = this;
5532
+ var _this34 = this;
5446
5533
  if (this.isPhoneProvisioned(this.dialOutDeviceStatus)) return _promise.default.resolve(); // prevent multiple dial out devices from being provisioned
5447
5534
 
5448
5535
  var correlationId = this.correlationId,
@@ -5459,10 +5546,10 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
5459
5546
  }).catch(function (error) {
5460
5547
  var _error$error3;
5461
5548
  _metrics.default.sendBehavioralMetric(_constants2.default.ADD_DIAL_OUT_FAILURE, {
5462
- correlation_id: _this35.correlationId,
5463
- dial_out_url: _this35.dialOutUrl,
5549
+ correlation_id: _this34.correlationId,
5550
+ dial_out_url: _this34.dialOutUrl,
5464
5551
  locus_id: locusUrl.split('/').pop(),
5465
- client_url: _this35.deviceUrl,
5552
+ client_url: _this34.deviceUrl,
5466
5553
  reason: (_error$error3 = error.error) === null || _error$error3 === void 0 ? void 0 : _error$error3.message,
5467
5554
  stack: error.stack
5468
5555
  });
@@ -5493,7 +5580,7 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
5493
5580
  }, {
5494
5581
  key: "moveTo",
5495
5582
  value: function moveTo(resourceId) {
5496
- var _this36 = this;
5583
+ var _this35 = this;
5497
5584
  if (!resourceId) {
5498
5585
  throw new _parameter.default('Cannot move call without a resourceId.');
5499
5586
  }
@@ -5531,18 +5618,18 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
5531
5618
  meetingId: this.id
5532
5619
  }
5533
5620
  });
5534
- this.locusInfo.once(_constants.LOCUSINFO.EVENTS.SELF_OBSERVING, /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee18() {
5621
+ this.locusInfo.once(_constants.LOCUSINFO.EVENTS.SELF_OBSERVING, /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee19() {
5535
5622
  var mediaSettings;
5536
- return _regenerator.default.wrap(function _callee18$(_context18) {
5537
- while (1) switch (_context18.prev = _context18.next) {
5623
+ return _regenerator.default.wrap(function _callee19$(_context19) {
5624
+ while (1) switch (_context19.prev = _context19.next) {
5538
5625
  case 0:
5539
- _context18.prev = 0;
5540
- if (!(_this36.screenShareFloorState === ScreenShareFloorStatus.GRANTED)) {
5541
- _context18.next = 4;
5626
+ _context19.prev = 0;
5627
+ if (!(_this35.screenShareFloorState === ScreenShareFloorStatus.GRANTED)) {
5628
+ _context19.next = 4;
5542
5629
  break;
5543
5630
  }
5544
- _context18.next = 4;
5545
- return _this36.releaseScreenShareFloor();
5631
+ _context19.next = 4;
5632
+ return _this35.releaseScreenShareFloor();
5546
5633
  case 4:
5547
5634
  mediaSettings = {
5548
5635
  mediaDirection: {
@@ -5554,47 +5641,47 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
5554
5641
  receiveShare: true
5555
5642
  }
5556
5643
  };
5557
- _this36.cleanupLocalStreams();
5558
- _this36.mediaProperties.setMediaDirection(mediaSettings.mediaDirection);
5559
- _this36.mediaProperties.unsetRemoteMedia();
5644
+ _this35.cleanupLocalStreams();
5645
+ _this35.mediaProperties.setMediaDirection(mediaSettings.mediaDirection);
5646
+ _this35.mediaProperties.unsetRemoteMedia();
5560
5647
 
5561
5648
  // when a move to is intiated by the client , Locus delets the existing media node from the server as soon the DX answers the meeting
5562
5649
  // once the DX answers we establish connection back the media server with only receiveShare enabled
5563
5650
  // @ts-ignore - reconnectMedia does not accept any argument
5564
- _context18.next = 10;
5565
- return _this36.reconnectionManager.reconnectMedia(mediaSettings).then(function () {
5651
+ _context19.next = 10;
5652
+ return _this35.reconnectionManager.reconnectMedia(mediaSettings).then(function () {
5566
5653
  _metrics.default.sendBehavioralMetric(_constants2.default.MOVE_TO_SUCCESS);
5567
5654
  });
5568
5655
  case 10:
5569
- _context18.next = 16;
5656
+ _context19.next = 16;
5570
5657
  break;
5571
5658
  case 12:
5572
- _context18.prev = 12;
5573
- _context18.t0 = _context18["catch"](0);
5574
- _loggerProxy.default.logger.error('Meeting:index#moveTo --> Failed to moveTo resourceId', _context18.t0);
5659
+ _context19.prev = 12;
5660
+ _context19.t0 = _context19["catch"](0);
5661
+ _loggerProxy.default.logger.error('Meeting:index#moveTo --> Failed to moveTo resourceId', _context19.t0);
5575
5662
  _metrics.default.sendBehavioralMetric(_constants2.default.MOVE_TO_FAILURE, {
5576
- correlation_id: _this36.correlationId,
5577
- locus_id: _this36.locusUrl.split('/').pop(),
5578
- reason: _context18.t0.message,
5579
- stack: _context18.t0.stack
5663
+ correlation_id: _this35.correlationId,
5664
+ locus_id: _this35.locusUrl.split('/').pop(),
5665
+ reason: _context19.t0.message,
5666
+ stack: _context19.t0.stack
5580
5667
  });
5581
5668
  case 16:
5582
5669
  case "end":
5583
- return _context18.stop();
5670
+ return _context19.stop();
5584
5671
  }
5585
- }, _callee18, null, [[0, 12]]);
5672
+ }, _callee19, null, [[0, 12]]);
5586
5673
  })));
5587
5674
  _loggerProxy.default.logger.info('Meeting:index#moveTo --> Initated moved to using resourceId', resourceId);
5588
5675
  return _util.default.joinMeetingOptions(this, {
5589
5676
  resourceId: resourceId,
5590
5677
  moveToResource: true
5591
5678
  }).then(function () {
5592
- _this36.meetingFiniteStateMachine.join();
5679
+ _this35.meetingFiniteStateMachine.join();
5593
5680
  }).catch(function (error) {
5594
- _this36.meetingFiniteStateMachine.fail(error);
5681
+ _this35.meetingFiniteStateMachine.fail(error);
5595
5682
  _metrics.default.sendBehavioralMetric(_constants2.default.MOVE_TO_FAILURE, {
5596
- correlation_id: _this36.correlationId,
5597
- locus_id: _this36.locusUrl.split('/').pop(),
5683
+ correlation_id: _this35.correlationId,
5684
+ locus_id: _this35.locusUrl.split('/').pop(),
5598
5685
  reason: error.message,
5599
5686
  stack: error.stack
5600
5687
  });
@@ -5613,7 +5700,7 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
5613
5700
  }, {
5614
5701
  key: "moveFrom",
5615
5702
  value: function moveFrom(resourceId) {
5616
- var _this37 = this;
5703
+ var _this36 = this;
5617
5704
  // On moveFrom ask the developer to re capture it moveFrom then updateMedia
5618
5705
  if (!resourceId) {
5619
5706
  throw new _parameter.default('Cannot move call without a resourceId.');
@@ -5628,19 +5715,19 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
5628
5715
  }
5629
5716
  });
5630
5717
  return _util.default.joinMeetingOptions(this).then(function () {
5631
- return _util.default.leaveMeeting(_this37, {
5718
+ return _util.default.leaveMeeting(_this36, {
5632
5719
  resourceId: resourceId,
5633
5720
  correlationId: oldCorrelationId,
5634
5721
  moveMeeting: true
5635
5722
  }).then(function () {
5636
- _this37.resourceId = '';
5723
+ _this36.resourceId = '';
5637
5724
  _metrics.default.sendBehavioralMetric(_constants2.default.MOVE_FROM_SUCCESS);
5638
5725
  });
5639
5726
  }).catch(function (error) {
5640
- _this37.meetingFiniteStateMachine.fail(error);
5727
+ _this36.meetingFiniteStateMachine.fail(error);
5641
5728
  _metrics.default.sendBehavioralMetric(_constants2.default.MOVE_FROM_FAILURE, {
5642
- correlation_id: _this37.correlationId,
5643
- locus_id: _this37.locusUrl.split('/').pop(),
5729
+ correlation_id: _this36.correlationId,
5730
+ locus_id: _this36.locusUrl.split('/').pop(),
5644
5731
  reason: error.message,
5645
5732
  stack: error.stack
5646
5733
  });
@@ -5672,10 +5759,10 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
5672
5759
  }, {
5673
5760
  key: "createMediaConnection",
5674
5761
  value: function () {
5675
- var _createMediaConnection = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee19(turnServerInfo, bundlePolicy) {
5762
+ var _createMediaConnection = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee20(turnServerInfo, bundlePolicy) {
5676
5763
  var mc, audioEnabled, videoEnabled, shareEnabled;
5677
- return _regenerator.default.wrap(function _callee19$(_context19) {
5678
- while (1) switch (_context19.prev = _context19.next) {
5764
+ return _regenerator.default.wrap(function _callee20$(_context20) {
5765
+ while (1) switch (_context20.prev = _context20.next) {
5679
5766
  case 0:
5680
5767
  mc = _media.default.createMediaConnection(this.isMultistream, this.getMediaConnectionDebugId(),
5681
5768
  // @ts-ignore
@@ -5701,40 +5788,40 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
5701
5788
 
5702
5789
  // publish the streams
5703
5790
  if (!this.mediaProperties.audioStream) {
5704
- _context19.next = 8;
5791
+ _context20.next = 8;
5705
5792
  break;
5706
5793
  }
5707
5794
  this.setSendNamedMediaGroup(_internalMediaCore.MediaType.AudioMain);
5708
- _context19.next = 8;
5795
+ _context20.next = 8;
5709
5796
  return this.publishStream(_internalMediaCore.MediaType.AudioMain, this.mediaProperties.audioStream);
5710
5797
  case 8:
5711
5798
  if (!this.mediaProperties.videoStream) {
5712
- _context19.next = 11;
5799
+ _context20.next = 11;
5713
5800
  break;
5714
5801
  }
5715
- _context19.next = 11;
5802
+ _context20.next = 11;
5716
5803
  return this.publishStream(_internalMediaCore.MediaType.VideoMain, this.mediaProperties.videoStream);
5717
5804
  case 11:
5718
5805
  if (!this.mediaProperties.shareVideoStream) {
5719
- _context19.next = 14;
5806
+ _context20.next = 14;
5720
5807
  break;
5721
5808
  }
5722
- _context19.next = 14;
5809
+ _context20.next = 14;
5723
5810
  return this.publishStream(_internalMediaCore.MediaType.VideoSlides, this.mediaProperties.shareVideoStream);
5724
5811
  case 14:
5725
5812
  if (!(this.isMultistream && this.mediaProperties.shareAudioStream)) {
5726
- _context19.next = 17;
5813
+ _context20.next = 17;
5727
5814
  break;
5728
5815
  }
5729
- _context19.next = 17;
5816
+ _context20.next = 17;
5730
5817
  return this.publishStream(_internalMediaCore.MediaType.AudioSlides, this.mediaProperties.shareAudioStream);
5731
5818
  case 17:
5732
- return _context19.abrupt("return", mc);
5819
+ return _context20.abrupt("return", mc);
5733
5820
  case 18:
5734
5821
  case "end":
5735
- return _context19.stop();
5822
+ return _context20.stop();
5736
5823
  }
5737
- }, _callee19, this);
5824
+ }, _callee20, this);
5738
5825
  }));
5739
5826
  function createMediaConnection(_x16, _x17) {
5740
5827
  return _createMediaConnection.apply(this, arguments);
@@ -5753,9 +5840,9 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
5753
5840
  }, {
5754
5841
  key: "forwardEvent",
5755
5842
  value: function forwardEvent(eventEmitter, eventTypeToForward, meetingEventType) {
5756
- var _this38 = this;
5843
+ var _this37 = this;
5757
5844
  eventEmitter.on(eventTypeToForward, function (data) {
5758
- return _triggerProxy.default.trigger(_this38, {
5845
+ return _triggerProxy.default.trigger(_this37, {
5759
5846
  file: 'meetings',
5760
5847
  function: 'addMedia'
5761
5848
  }, meetingEventType, data);
@@ -5773,11 +5860,11 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
5773
5860
  }, {
5774
5861
  key: "setUpLocalStreamReferences",
5775
5862
  value: function () {
5776
- var _setUpLocalStreamReferences = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee20(localStreams) {
5863
+ var _setUpLocalStreamReferences = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee21(localStreams) {
5777
5864
  var _localStreams$screenS, _localStreams$screenS2;
5778
5865
  var setUpStreamPromises;
5779
- return _regenerator.default.wrap(function _callee20$(_context20) {
5780
- while (1) switch (_context20.prev = _context20.next) {
5866
+ return _regenerator.default.wrap(function _callee21$(_context21) {
5867
+ while (1) switch (_context21.prev = _context21.next) {
5781
5868
  case 0:
5782
5869
  setUpStreamPromises = [];
5783
5870
  if (localStreams !== null && localStreams !== void 0 && localStreams.microphone) {
@@ -5792,22 +5879,22 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
5792
5879
  if (localStreams !== null && localStreams !== void 0 && (_localStreams$screenS2 = localStreams.screenShare) !== null && _localStreams$screenS2 !== void 0 && _localStreams$screenS2.audio) {
5793
5880
  setUpStreamPromises.push(this.setLocalShareAudioStream(localStreams.screenShare.audio));
5794
5881
  }
5795
- _context20.prev = 5;
5796
- _context20.next = 8;
5882
+ _context21.prev = 5;
5883
+ _context21.next = 8;
5797
5884
  return _promise.default.all(setUpStreamPromises);
5798
5885
  case 8:
5799
- _context20.next = 14;
5886
+ _context21.next = 14;
5800
5887
  break;
5801
5888
  case 10:
5802
- _context20.prev = 10;
5803
- _context20.t0 = _context20["catch"](5);
5804
- _loggerProxy.default.logger.error("Meeting:index#addMedia():setUpLocalStreamReferences --> Error , ", _context20.t0);
5805
- throw _context20.t0;
5889
+ _context21.prev = 10;
5890
+ _context21.t0 = _context21["catch"](5);
5891
+ _loggerProxy.default.logger.error("Meeting:index#addMedia():setUpLocalStreamReferences --> Error , ", _context21.t0);
5892
+ throw _context21.t0;
5806
5893
  case 14:
5807
5894
  case "end":
5808
- return _context20.stop();
5895
+ return _context21.stop();
5809
5896
  }
5810
- }, _callee20, this, [[5, 10]]);
5897
+ }, _callee21, this, [[5, 10]]);
5811
5898
  }));
5812
5899
  function setUpLocalStreamReferences(_x18) {
5813
5900
  return _setUpLocalStreamReferences.apply(this, arguments);
@@ -5823,20 +5910,20 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
5823
5910
  }, {
5824
5911
  key: "waitForMediaConnectionConnected",
5825
5912
  value: function () {
5826
- var _waitForMediaConnectionConnected = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee21() {
5913
+ var _waitForMediaConnectionConnected = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee22() {
5827
5914
  var _this$mediaProperties6, _this$mediaProperties7, _this$mediaProperties8, _this$mediaProperties9, _this$mediaProperties10, _this$mediaProperties11, _this$mediaProperties12, _this$mediaProperties13, _this$mediaProperties14, _this$mediaProperties15, _this$mediaProperties16, _this$mediaProperties17, _this$mediaProperties18, _this$mediaProperties19;
5828
- return _regenerator.default.wrap(function _callee21$(_context21) {
5829
- while (1) switch (_context21.prev = _context21.next) {
5915
+ return _regenerator.default.wrap(function _callee22$(_context22) {
5916
+ while (1) switch (_context22.prev = _context22.next) {
5830
5917
  case 0:
5831
- _context21.prev = 0;
5832
- _context21.next = 3;
5918
+ _context22.prev = 0;
5919
+ _context22.next = 3;
5833
5920
  return this.mediaProperties.waitForMediaConnectionConnected();
5834
5921
  case 3:
5835
- _context21.next = 9;
5922
+ _context22.next = 9;
5836
5923
  break;
5837
5924
  case 5:
5838
- _context21.prev = 5;
5839
- _context21.t0 = _context21["catch"](0);
5925
+ _context22.prev = 5;
5926
+ _context22.t0 = _context22["catch"](0);
5840
5927
  if (!this.hasMediaConnectionConnectedAtLeastOnce) {
5841
5928
  // Only send CA event for join flow if we haven't successfully connected media yet
5842
5929
  // @ts-ignore
@@ -5864,9 +5951,9 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
5864
5951
  throw new Error("Timed out waiting for media connection to be connected, correlationId=".concat(this.correlationId));
5865
5952
  case 9:
5866
5953
  case "end":
5867
- return _context21.stop();
5954
+ return _context22.stop();
5868
5955
  }
5869
- }, _callee21, this, [[0, 5]]);
5956
+ }, _callee22, this, [[0, 5]]);
5870
5957
  }));
5871
5958
  function waitForMediaConnectionConnected() {
5872
5959
  return _waitForMediaConnectionConnected.apply(this, arguments);
@@ -5882,7 +5969,7 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
5882
5969
  }, {
5883
5970
  key: "createStatsAnalyzer",
5884
5971
  value: function createStatsAnalyzer() {
5885
- var _this39 = this;
5972
+ var _this38 = this;
5886
5973
  // @ts-ignore - config coming from registerPlugin
5887
5974
  if (this.config.stats.enableStatsAnalyzer) {
5888
5975
  // @ts-ignore - config coming from registerPlugin
@@ -5890,7 +5977,7 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
5890
5977
  this.statsAnalyzer = new _statsAnalyzer.StatsAnalyzer(
5891
5978
  // @ts-ignore - config coming from registerPlugin
5892
5979
  this.config.stats, function (ssrc) {
5893
- return _this39.receiveSlotManager.findReceiveSlotBySsrc(ssrc);
5980
+ return _this38.receiveSlotManager.findReceiveSlotBySsrc(ssrc);
5894
5981
  }, this.networkQualityMonitor);
5895
5982
  this.setupStatsAnalyzerEventHandlers();
5896
5983
  this.networkQualityMonitor.on(_constants.EVENT_TRIGGERS.NETWORK_QUALITY, this.sendNetworkQualityEvent.bind(this));
@@ -5915,18 +6002,18 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
5915
6002
  * @returns {Promise<void>}
5916
6003
  */
5917
6004
  function () {
5918
- var _waitForRemoteSDPAnswer = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee22() {
6005
+ var _waitForRemoteSDPAnswer = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee23() {
5919
6006
  var LOG_HEADER, deferSDPAnswer;
5920
- return _regenerator.default.wrap(function _callee22$(_context22) {
5921
- while (1) switch (_context22.prev = _context22.next) {
6007
+ return _regenerator.default.wrap(function _callee23$(_context23) {
6008
+ while (1) switch (_context23.prev = _context23.next) {
5922
6009
  case 0:
5923
6010
  LOG_HEADER = 'Meeting:index#addMedia():waitForRemoteSDPAnswer -->';
5924
6011
  if (this.deferSDPAnswer) {
5925
- _context22.next = 4;
6012
+ _context23.next = 4;
5926
6013
  break;
5927
6014
  }
5928
6015
  _loggerProxy.default.logger.warn("".concat(LOG_HEADER, " offer not created yet"));
5929
- return _context22.abrupt("return", _promise.default.reject(new Error('waitForRemoteSDPAnswer() called before local sdp offer created')));
6016
+ return _context23.abrupt("return", _promise.default.reject(new Error('waitForRemoteSDPAnswer() called before local sdp offer created')));
5930
6017
  case 4:
5931
6018
  deferSDPAnswer = this.deferSDPAnswer;
5932
6019
  this.sdpResponseTimer = setTimeout(function () {
@@ -5934,12 +6021,12 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
5934
6021
  deferSDPAnswer.reject(new Error('Timed out waiting for REMOTE SDP ANSWER'));
5935
6022
  }, _constants.ROAP_OFFER_ANSWER_EXCHANGE_TIMEOUT);
5936
6023
  _loggerProxy.default.logger.info("".concat(LOG_HEADER, " waiting for REMOTE SDP ANSWER..."));
5937
- return _context22.abrupt("return", deferSDPAnswer.promise);
6024
+ return _context23.abrupt("return", deferSDPAnswer.promise);
5938
6025
  case 8:
5939
6026
  case "end":
5940
- return _context22.stop();
6027
+ return _context23.stop();
5941
6028
  }
5942
- }, _callee22, this);
6029
+ }, _callee23, this);
5943
6030
  }));
5944
6031
  function waitForRemoteSDPAnswer() {
5945
6032
  return _waitForRemoteSDPAnswer.apply(this, arguments);
@@ -5957,28 +6044,28 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
5957
6044
  }, {
5958
6045
  key: "retryEstablishMediaConnectionWithForcedTurnDiscovery",
5959
6046
  value: function () {
5960
- var _retryEstablishMediaConnectionWithForcedTurnDiscovery = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee23(remoteMediaManagerConfig, bundlePolicy) {
6047
+ var _retryEstablishMediaConnectionWithForcedTurnDiscovery = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee24(remoteMediaManagerConfig, bundlePolicy) {
5961
6048
  var LOG_HEADER;
5962
- return _regenerator.default.wrap(function _callee23$(_context23) {
5963
- while (1) switch (_context23.prev = _context23.next) {
6049
+ return _regenerator.default.wrap(function _callee24$(_context24) {
6050
+ while (1) switch (_context24.prev = _context24.next) {
5964
6051
  case 0:
5965
6052
  LOG_HEADER = 'Meeting:index#addMedia():retryEstablishMediaConnectionWithForcedTurnDiscovery -->';
5966
- _context23.prev = 1;
5967
- _context23.next = 4;
6053
+ _context24.prev = 1;
6054
+ _context24.next = 4;
5968
6055
  return this.establishMediaConnection(remoteMediaManagerConfig, bundlePolicy, true);
5969
6056
  case 4:
5970
- _context23.next = 10;
6057
+ _context24.next = 10;
5971
6058
  break;
5972
6059
  case 6:
5973
- _context23.prev = 6;
5974
- _context23.t0 = _context23["catch"](1);
5975
- _loggerProxy.default.logger.error("".concat(LOG_HEADER, " retry with TURN-TLS failed, media connection unable to connect, "), _context23.t0);
5976
- throw _context23.t0;
6060
+ _context24.prev = 6;
6061
+ _context24.t0 = _context24["catch"](1);
6062
+ _loggerProxy.default.logger.error("".concat(LOG_HEADER, " retry with TURN-TLS failed, media connection unable to connect, "), _context24.t0);
6063
+ throw _context24.t0;
5977
6064
  case 10:
5978
6065
  case "end":
5979
- return _context23.stop();
6066
+ return _context24.stop();
5980
6067
  }
5981
- }, _callee23, this, [[1, 6]]);
6068
+ }, _callee24, this, [[1, 6]]);
5982
6069
  }));
5983
6070
  function retryEstablishMediaConnectionWithForcedTurnDiscovery(_x19, _x20) {
5984
6071
  return _retryEstablishMediaConnectionWithForcedTurnDiscovery.apply(this, arguments);
@@ -5997,14 +6084,14 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
5997
6084
  }, {
5998
6085
  key: "retryWithForcedTurnDiscovery",
5999
6086
  value: function () {
6000
- var _retryWithForcedTurnDiscovery = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee24(remoteMediaManagerConfig, bundlePolicy) {
6087
+ var _retryWithForcedTurnDiscovery = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee25(remoteMediaManagerConfig, bundlePolicy) {
6001
6088
  var LOG_HEADER;
6002
- return _regenerator.default.wrap(function _callee24$(_context24) {
6003
- while (1) switch (_context24.prev = _context24.next) {
6089
+ return _regenerator.default.wrap(function _callee25$(_context25) {
6090
+ while (1) switch (_context25.prev = _context25.next) {
6004
6091
  case 0:
6005
6092
  this.retriedWithTurnServer = true;
6006
6093
  LOG_HEADER = 'Meeting:index#addMedia():retryWithForcedTurnDiscovery -->';
6007
- _context24.next = 4;
6094
+ _context25.next = 4;
6008
6095
  return this.cleanUpBeforeRetryWithTurnServer();
6009
6096
  case 4:
6010
6097
  _metrics.default.sendBehavioralMetric(_constants2.default.ADD_MEDIA_RETRY, {
@@ -6014,22 +6101,22 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
6014
6101
  reason: 'forcingTurnTls'
6015
6102
  });
6016
6103
  if (!(this.state === _constants.MEETING_STATE.STATES.LEFT)) {
6017
- _context24.next = 9;
6104
+ _context25.next = 9;
6018
6105
  break;
6019
6106
  }
6020
6107
  _loggerProxy.default.logger.info("".concat(LOG_HEADER, " meeting state was LEFT after first attempt to establish media connection. Attempting to rejoin. "));
6021
- _context24.next = 9;
6108
+ _context25.next = 9;
6022
6109
  return this.join({
6023
6110
  rejoin: true
6024
6111
  });
6025
6112
  case 9:
6026
- _context24.next = 11;
6113
+ _context25.next = 11;
6027
6114
  return this.retryEstablishMediaConnectionWithForcedTurnDiscovery(remoteMediaManagerConfig, bundlePolicy);
6028
6115
  case 11:
6029
6116
  case "end":
6030
- return _context24.stop();
6117
+ return _context25.stop();
6031
6118
  }
6032
- }, _callee24, this);
6119
+ }, _callee25, this);
6033
6120
  }));
6034
6121
  function retryWithForcedTurnDiscovery(_x21, _x22) {
6035
6122
  return _retryWithForcedTurnDiscovery.apply(this, arguments);
@@ -6050,30 +6137,30 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
6050
6137
  }, {
6051
6138
  key: "handleWaitForMediaConnectionConnectedError",
6052
6139
  value: function () {
6053
- var _handleWaitForMediaConnectionConnectedError = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee25(error, remoteMediaManagerConfig, bundlePolicy) {
6140
+ var _handleWaitForMediaConnectionConnectedError = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee26(error, remoteMediaManagerConfig, bundlePolicy) {
6054
6141
  var LOG_HEADER;
6055
- return _regenerator.default.wrap(function _callee25$(_context25) {
6056
- while (1) switch (_context25.prev = _context25.next) {
6142
+ return _regenerator.default.wrap(function _callee26$(_context26) {
6143
+ while (1) switch (_context26.prev = _context26.next) {
6057
6144
  case 0:
6058
6145
  LOG_HEADER = 'Meeting:index#addMedia():handleWaitForMediaConnectionConnectedError -->'; // @ts-ignore - config coming from registerPlugin
6059
6146
  if (this.turnServerUsed) {
6060
- _context25.next = 7;
6147
+ _context26.next = 7;
6061
6148
  break;
6062
6149
  }
6063
6150
  _loggerProxy.default.logger.info("".concat(LOG_HEADER, " error waiting for media to connect on UDP, TCP, retrying using TURN-TLS, "), error);
6064
- _context25.next = 5;
6151
+ _context26.next = 5;
6065
6152
  return this.retryWithForcedTurnDiscovery(remoteMediaManagerConfig, bundlePolicy);
6066
6153
  case 5:
6067
- _context25.next = 9;
6154
+ _context26.next = 9;
6068
6155
  break;
6069
6156
  case 7:
6070
6157
  _loggerProxy.default.logger.error("".concat(LOG_HEADER, " error waiting for media to connect using UDP, TCP and TURN-TLS"), error);
6071
6158
  throw new _webexErrors.AddMediaFailed();
6072
6159
  case 9:
6073
6160
  case "end":
6074
- return _context25.stop();
6161
+ return _context26.stop();
6075
6162
  }
6076
- }, _callee25, this);
6163
+ }, _callee26, this);
6077
6164
  }));
6078
6165
  function handleWaitForMediaConnectionConnectedError(_x23, _x24, _x25) {
6079
6166
  return _handleWaitForMediaConnectionConnectedError.apply(this, arguments);
@@ -6081,43 +6168,37 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
6081
6168
  return handleWaitForMediaConnectionConnectedError;
6082
6169
  }()
6083
6170
  /**
6084
- * Does TURN discovery, SDP offer/answer exhange, establishes ICE connection and DTLS handshake.
6171
+ * Performs TURN discovery as a separate call to the Locus /media API
6085
6172
  *
6086
- * @private
6087
- * @param {RemoteMediaManagerConfiguration} [remoteMediaManagerConfig]
6088
- * @param {BundlePolicy} [bundlePolicy]
6089
- * @param {boolean} [isForced] - let isForced be true to do turn discovery regardless of reachability results
6090
- * @returns {Promise<void>}
6173
+ * @param {boolean} isRetry
6174
+ * @param {boolean} isForced
6175
+ * @returns {Promise}
6091
6176
  */
6092
6177
  }, {
6093
- key: "establishMediaConnection",
6178
+ key: "doTurnDiscovery",
6094
6179
  value: function () {
6095
- var _establishMediaConnection = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee26(remoteMediaManagerConfig, bundlePolicy, isForced) {
6096
- var LOG_HEADER, cdl, isRetry, turnDiscoveryObject, turnServerInfo, mc;
6097
- return _regenerator.default.wrap(function _callee26$(_context26) {
6098
- while (1) switch (_context26.prev = _context26.next) {
6180
+ var _doTurnDiscovery = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee27(isRetry, isForced) {
6181
+ var cdl, turnDiscoveryResult;
6182
+ return _regenerator.default.wrap(function _callee27$(_context27) {
6183
+ while (1) switch (_context27.prev = _context27.next) {
6099
6184
  case 0:
6100
- LOG_HEADER = 'Meeting:index#addMedia():establishMediaConnection -->'; // @ts-ignore
6101
- cdl = this.webex.internal.newMetrics.callDiagnosticLatencies;
6102
- isRetry = this.retriedWithTurnServer;
6103
- _context26.prev = 3;
6104
6185
  // @ts-ignore
6186
+ cdl = this.webex.internal.newMetrics.callDiagnosticLatencies; // @ts-ignore
6105
6187
  this.webex.internal.newMetrics.submitInternalEvent({
6106
6188
  name: 'internal.client.add-media.turn-discovery.start'
6107
6189
  });
6108
- _context26.next = 7;
6190
+ _context27.next = 4;
6109
6191
  return this.roap.doTurnDiscovery(this, isRetry, isForced);
6110
- case 7:
6111
- turnDiscoveryObject = _context26.sent;
6112
- this.turnDiscoverySkippedReason = turnDiscoveryObject === null || turnDiscoveryObject === void 0 ? void 0 : turnDiscoveryObject.turnDiscoverySkippedReason;
6192
+ case 4:
6193
+ turnDiscoveryResult = _context27.sent;
6194
+ this.turnDiscoverySkippedReason = turnDiscoveryResult === null || turnDiscoveryResult === void 0 ? void 0 : turnDiscoveryResult.turnDiscoverySkippedReason;
6113
6195
  this.turnServerUsed = !this.turnDiscoverySkippedReason;
6114
6196
 
6115
6197
  // @ts-ignore
6116
6198
  this.webex.internal.newMetrics.submitInternalEvent({
6117
6199
  name: 'internal.client.add-media.turn-discovery.end'
6118
6200
  });
6119
- turnServerInfo = turnDiscoveryObject.turnServerInfo;
6120
- if (this.turnServerUsed && turnServerInfo) {
6201
+ if (this.turnServerUsed && turnDiscoveryResult.turnServerInfo) {
6121
6202
  _metrics.default.sendBehavioralMetric(_constants2.default.TURN_DISCOVERY_LATENCY, {
6122
6203
  correlation_id: this.correlationId,
6123
6204
  latency: cdl.getTurnDiscoveryTime(),
@@ -6125,13 +6206,56 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
6125
6206
  retriedWithTurnServer: this.retriedWithTurnServer
6126
6207
  });
6127
6208
  }
6128
- _context26.next = 15;
6209
+ return _context27.abrupt("return", turnDiscoveryResult);
6210
+ case 10:
6211
+ case "end":
6212
+ return _context27.stop();
6213
+ }
6214
+ }, _callee27, this);
6215
+ }));
6216
+ function doTurnDiscovery(_x26, _x27) {
6217
+ return _doTurnDiscovery.apply(this, arguments);
6218
+ }
6219
+ return doTurnDiscovery;
6220
+ }()
6221
+ /**
6222
+ * Does TURN discovery, SDP offer/answer exhange, establishes ICE connection and DTLS handshake.
6223
+ *
6224
+ * @private
6225
+ * @param {RemoteMediaManagerConfiguration} [remoteMediaManagerConfig]
6226
+ * @param {BundlePolicy} [bundlePolicy]
6227
+ * @param {boolean} [isForced] - let isForced be true to do turn discovery regardless of reachability results
6228
+ * @param {TurnServerInfo} [turnServerInfo]
6229
+ * @returns {Promise<void>}
6230
+ */
6231
+ }, {
6232
+ key: "establishMediaConnection",
6233
+ value: function () {
6234
+ var _establishMediaConnection = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee28(remoteMediaManagerConfig, bundlePolicy, isForced, turnServerInfo) {
6235
+ var LOG_HEADER, isRetry, _yield$this$doTurnDis, mc;
6236
+ return _regenerator.default.wrap(function _callee28$(_context28) {
6237
+ while (1) switch (_context28.prev = _context28.next) {
6238
+ case 0:
6239
+ LOG_HEADER = 'Meeting:index#addMedia():establishMediaConnection -->';
6240
+ isRetry = this.retriedWithTurnServer;
6241
+ _context28.prev = 2;
6242
+ if (turnServerInfo) {
6243
+ _context28.next = 8;
6244
+ break;
6245
+ }
6246
+ _context28.next = 6;
6247
+ return this.doTurnDiscovery(isRetry, isForced);
6248
+ case 6:
6249
+ _yield$this$doTurnDis = _context28.sent;
6250
+ turnServerInfo = _yield$this$doTurnDis.turnServerInfo;
6251
+ case 8:
6252
+ _context28.next = 10;
6129
6253
  return this.createMediaConnection(turnServerInfo, bundlePolicy);
6130
- case 15:
6131
- mc = _context26.sent;
6254
+ case 10:
6255
+ mc = _context28.sent;
6132
6256
  _loggerProxy.default.logger.info("".concat(LOG_HEADER, " media connection created"));
6133
6257
  if (!this.isMultistream) {
6134
- _context26.next = 25;
6258
+ _context28.next = 20;
6135
6259
  break;
6136
6260
  }
6137
6261
  this.remoteMediaManager = new _remoteMediaManager.RemoteMediaManager(this.receiveSlotManager, this.mediaRequestManagers, remoteMediaManagerConfig);
@@ -6139,42 +6263,42 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
6139
6263
  this.forwardEvent(this.remoteMediaManager, _remoteMediaManager.Event.InterpretationAudioCreated, _constants.EVENT_TRIGGERS.REMOTE_MEDIA_INTERPRETATION_AUDIO_CREATED);
6140
6264
  this.forwardEvent(this.remoteMediaManager, _remoteMediaManager.Event.ScreenShareAudioCreated, _constants.EVENT_TRIGGERS.REMOTE_MEDIA_SCREEN_SHARE_AUDIO_CREATED);
6141
6265
  this.forwardEvent(this.remoteMediaManager, _remoteMediaManager.Event.VideoLayoutChanged, _constants.EVENT_TRIGGERS.REMOTE_MEDIA_VIDEO_LAYOUT_CHANGED);
6142
- _context26.next = 25;
6266
+ _context28.next = 20;
6143
6267
  return this.remoteMediaManager.start();
6144
- case 25:
6145
- _context26.next = 27;
6268
+ case 20:
6269
+ _context28.next = 22;
6146
6270
  return mc.initiateOffer();
6147
- case 27:
6148
- _context26.next = 29;
6271
+ case 22:
6272
+ _context28.next = 24;
6149
6273
  return this.waitForRemoteSDPAnswer();
6150
- case 29:
6274
+ case 24:
6151
6275
  this.handleMediaLogging(this.mediaProperties);
6152
- _context26.next = 36;
6276
+ _context28.next = 31;
6153
6277
  break;
6154
- case 32:
6155
- _context26.prev = 32;
6156
- _context26.t0 = _context26["catch"](3);
6157
- _loggerProxy.default.logger.error("".concat(LOG_HEADER, " error establishing media connection, "), _context26.t0);
6158
- throw _context26.t0;
6159
- case 36:
6160
- _context26.prev = 36;
6161
- _context26.next = 39;
6278
+ case 27:
6279
+ _context28.prev = 27;
6280
+ _context28.t0 = _context28["catch"](2);
6281
+ _loggerProxy.default.logger.error("".concat(LOG_HEADER, " error establishing media connection, "), _context28.t0);
6282
+ throw _context28.t0;
6283
+ case 31:
6284
+ _context28.prev = 31;
6285
+ _context28.next = 34;
6162
6286
  return this.waitForMediaConnectionConnected();
6163
- case 39:
6164
- _context26.next = 45;
6287
+ case 34:
6288
+ _context28.next = 40;
6165
6289
  break;
6166
- case 41:
6167
- _context26.prev = 41;
6168
- _context26.t1 = _context26["catch"](36);
6169
- _context26.next = 45;
6170
- return this.handleWaitForMediaConnectionConnectedError(_context26.t1, remoteMediaManagerConfig, bundlePolicy);
6171
- case 45:
6290
+ case 36:
6291
+ _context28.prev = 36;
6292
+ _context28.t1 = _context28["catch"](31);
6293
+ _context28.next = 40;
6294
+ return this.handleWaitForMediaConnectionConnectedError(_context28.t1, remoteMediaManagerConfig, bundlePolicy);
6295
+ case 40:
6172
6296
  case "end":
6173
- return _context26.stop();
6297
+ return _context28.stop();
6174
6298
  }
6175
- }, _callee26, this, [[3, 32], [36, 41]]);
6299
+ }, _callee28, this, [[2, 27], [31, 36]]);
6176
6300
  }));
6177
- function establishMediaConnection(_x26, _x27, _x28) {
6301
+ function establishMediaConnection(_x28, _x29, _x30, _x31) {
6178
6302
  return _establishMediaConnection.apply(this, arguments);
6179
6303
  }
6180
6304
  return establishMediaConnection;
@@ -6188,22 +6312,22 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
6188
6312
  }, {
6189
6313
  key: "cleanUpOnAddMediaFailure",
6190
6314
  value: function () {
6191
- var _cleanUpOnAddMediaFailure = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee27() {
6192
- return _regenerator.default.wrap(function _callee27$(_context27) {
6193
- while (1) switch (_context27.prev = _context27.next) {
6315
+ var _cleanUpOnAddMediaFailure = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee29() {
6316
+ return _regenerator.default.wrap(function _callee29$(_context29) {
6317
+ while (1) switch (_context29.prev = _context29.next) {
6194
6318
  case 0:
6195
6319
  if (!this.statsAnalyzer) {
6196
- _context27.next = 3;
6320
+ _context29.next = 3;
6197
6321
  break;
6198
6322
  }
6199
- _context27.next = 3;
6323
+ _context29.next = 3;
6200
6324
  return this.statsAnalyzer.stopAnalyzer();
6201
6325
  case 3:
6202
6326
  this.statsAnalyzer = null;
6203
6327
 
6204
6328
  // when media fails, we want to upload a webrtc dump to see whats going on
6205
6329
  // this function is async, but returns once the stats have been gathered
6206
- _context27.next = 6;
6330
+ _context29.next = 6;
6207
6331
  return this.forceSendStatsReport({
6208
6332
  callFrom: 'addMedia'
6209
6333
  });
@@ -6214,9 +6338,9 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
6214
6338
  }
6215
6339
  case 7:
6216
6340
  case "end":
6217
- return _context27.stop();
6341
+ return _context29.stop();
6218
6342
  }
6219
- }, _callee27, this);
6343
+ }, _callee29, this);
6220
6344
  }));
6221
6345
  function cleanUpOnAddMediaFailure() {
6222
6346
  return _cleanUpOnAddMediaFailure.apply(this, arguments);
@@ -6233,11 +6357,11 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
6233
6357
  }, {
6234
6358
  key: "cleanUpBeforeRetryWithTurnServer",
6235
6359
  value: function () {
6236
- var _cleanUpBeforeRetryWithTurnServer = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee28() {
6237
- return _regenerator.default.wrap(function _callee28$(_context28) {
6238
- while (1) switch (_context28.prev = _context28.next) {
6360
+ var _cleanUpBeforeRetryWithTurnServer = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee30() {
6361
+ return _regenerator.default.wrap(function _callee30$(_context30) {
6362
+ while (1) switch (_context30.prev = _context30.next) {
6239
6363
  case 0:
6240
- _context28.next = 2;
6364
+ _context30.next = 2;
6241
6365
  return this.forceSendStatsReport({
6242
6366
  callFrom: 'cleanUpBeforeRetryWithTurnServer'
6243
6367
  });
@@ -6257,9 +6381,9 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
6257
6381
  }
6258
6382
  case 3:
6259
6383
  case "end":
6260
- return _context28.stop();
6384
+ return _context30.stop();
6261
6385
  }
6262
- }, _callee28, this);
6386
+ }, _callee30, this);
6263
6387
  }));
6264
6388
  function cleanUpBeforeRetryWithTurnServer() {
6265
6389
  return _cleanUpBeforeRetryWithTurnServer.apply(this, arguments);
@@ -6270,6 +6394,7 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
6270
6394
  * Creates a media connection to the server. Media connection is required for sending or receiving any audio/video.
6271
6395
  *
6272
6396
  * @param {AddMediaOptions} options
6397
+ * @param {TurnServerInfo} turnServerInfo - TURN server information (used only internally by the SDK)
6273
6398
  * @returns {Promise<void>}
6274
6399
  * @public
6275
6400
  * @memberof Meeting
@@ -6277,9 +6402,10 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
6277
6402
  }, {
6278
6403
  key: "addMedia",
6279
6404
  value: function () {
6280
- var _addMedia = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee29() {
6405
+ var _addMedia = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee31() {
6281
6406
  var _this$webex$meetings$2, _this$webex$meetings$3;
6282
6407
  var options,
6408
+ turnServerInfo,
6283
6409
  LOG_HEADER,
6284
6410
  localStreams,
6285
6411
  _options$audioEnabled,
@@ -6292,7 +6418,6 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
6292
6418
  shareVideoEnabled,
6293
6419
  remoteMediaManagerConfig,
6294
6420
  bundlePolicy,
6295
- allowMediaInLobby,
6296
6421
  _this$remoteMediaMana,
6297
6422
  connectionType,
6298
6423
  reachabilityStats,
@@ -6318,38 +6443,39 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
6318
6443
  _this$mediaProperties39,
6319
6444
  _this$mediaProperties40,
6320
6445
  reachabilityMetrics,
6321
- _args29 = arguments;
6322
- return _regenerator.default.wrap(function _callee29$(_context29) {
6323
- while (1) switch (_context29.prev = _context29.next) {
6446
+ _args31 = arguments;
6447
+ return _regenerator.default.wrap(function _callee31$(_context31) {
6448
+ while (1) switch (_context31.prev = _context31.next) {
6324
6449
  case 0:
6325
- options = _args29.length > 0 && _args29[0] !== undefined ? _args29[0] : {};
6450
+ options = _args31.length > 0 && _args31[0] !== undefined ? _args31[0] : {};
6451
+ turnServerInfo = _args31.length > 1 && _args31[1] !== undefined ? _args31[1] : undefined;
6326
6452
  this.retriedWithTurnServer = false;
6327
6453
  this.hasMediaConnectionConnectedAtLeastOnce = false;
6328
6454
  LOG_HEADER = 'Meeting:index#addMedia -->';
6329
- _loggerProxy.default.logger.info("".concat(LOG_HEADER, " called with: ").concat((0, _stringify.default)(options)));
6455
+ _loggerProxy.default.logger.info("".concat(LOG_HEADER, " called with: ").concat((0, _stringify.default)(options), ", ").concat((0, _stringify.default)(turnServerInfo)));
6330
6456
  if (!(options.allowMediaInLobby !== true && this.meetingState !== _constants.FULL_STATE.ACTIVE)) {
6331
- _context29.next = 7;
6457
+ _context31.next = 8;
6332
6458
  break;
6333
6459
  }
6334
6460
  throw new _webexErrors.MeetingNotActiveError();
6335
- case 7:
6461
+ case 8:
6336
6462
  if (!_util.default.isUserInLeftState(this.locusInfo)) {
6337
- _context29.next = 9;
6463
+ _context31.next = 10;
6338
6464
  break;
6339
6465
  }
6340
6466
  throw new _webexErrors.UserNotJoinedError();
6341
- case 9:
6342
- localStreams = options.localStreams, _options$audioEnabled = options.audioEnabled, audioEnabled = _options$audioEnabled === void 0 ? true : _options$audioEnabled, _options$videoEnabled = options.videoEnabled, videoEnabled = _options$videoEnabled === void 0 ? true : _options$videoEnabled, _options$shareAudioEn = options.shareAudioEnabled, shareAudioEnabled = _options$shareAudioEn === void 0 ? true : _options$shareAudioEn, _options$shareVideoEn = options.shareVideoEnabled, shareVideoEnabled = _options$shareVideoEn === void 0 ? true : _options$shareVideoEn, remoteMediaManagerConfig = options.remoteMediaManagerConfig, bundlePolicy = options.bundlePolicy, allowMediaInLobby = options.allowMediaInLobby;
6467
+ case 10:
6468
+ localStreams = options.localStreams, _options$audioEnabled = options.audioEnabled, audioEnabled = _options$audioEnabled === void 0 ? true : _options$audioEnabled, _options$videoEnabled = options.videoEnabled, videoEnabled = _options$videoEnabled === void 0 ? true : _options$videoEnabled, _options$shareAudioEn = options.shareAudioEnabled, shareAudioEnabled = _options$shareAudioEn === void 0 ? true : _options$shareAudioEn, _options$shareVideoEn = options.shareVideoEnabled, shareVideoEnabled = _options$shareVideoEn === void 0 ? true : _options$shareVideoEn, remoteMediaManagerConfig = options.remoteMediaManagerConfig, bundlePolicy = options.bundlePolicy;
6343
6469
  this.allowMediaInLobby = options === null || options === void 0 ? void 0 : options.allowMediaInLobby;
6344
6470
 
6345
6471
  // If the user is unjoined or guest waiting in lobby dont allow the user to addMedia
6346
6472
  // @ts-ignore - isUserUnadmitted coming from SelfUtil
6347
- if (!(this.isUserUnadmitted && !this.wirelessShare && !allowMediaInLobby)) {
6348
- _context29.next = 13;
6473
+ if (!(this.isUserUnadmitted && !this.wirelessShare && !this.allowMediaInLobby)) {
6474
+ _context31.next = 14;
6349
6475
  break;
6350
6476
  }
6351
6477
  throw new _webexErrors.UserInLobbyError();
6352
- case 13:
6478
+ case 14:
6353
6479
  // @ts-ignore
6354
6480
  this.webex.internal.newMetrics.submitClientEvent({
6355
6481
  name: 'client.media.capabilities',
@@ -6404,33 +6530,33 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
6404
6530
  });
6405
6531
  this.audio = (0, _muteState.createMuteState)(_constants.AUDIO, this, audioEnabled);
6406
6532
  this.video = (0, _muteState.createMuteState)(_constants.VIDEO, this, videoEnabled);
6407
- _context29.prev = 18;
6408
- _context29.next = 21;
6533
+ _context31.prev = 19;
6534
+ _context31.next = 22;
6409
6535
  return this.setUpLocalStreamReferences(localStreams);
6410
- case 21:
6536
+ case 22:
6411
6537
  this.setMercuryListener();
6412
6538
  this.createStatsAnalyzer();
6413
- _context29.next = 25;
6414
- return this.establishMediaConnection(remoteMediaManagerConfig, bundlePolicy, false);
6415
- case 25:
6416
- _context29.next = 27;
6539
+ _context31.next = 26;
6540
+ return this.establishMediaConnection(remoteMediaManagerConfig, bundlePolicy, false, turnServerInfo);
6541
+ case 26:
6542
+ _context31.next = 28;
6417
6543
  return Meeting.handleDeviceLogging();
6418
- case 27:
6544
+ case 28:
6419
6545
  if (!this.mediaProperties.hasLocalShareStream()) {
6420
- _context29.next = 30;
6546
+ _context31.next = 31;
6421
6547
  break;
6422
6548
  }
6423
- _context29.next = 30;
6549
+ _context31.next = 31;
6424
6550
  return this.enqueueScreenShareFloorRequest();
6425
- case 30:
6426
- _context29.next = 32;
6551
+ case 31:
6552
+ _context31.next = 33;
6427
6553
  return this.mediaProperties.getCurrentConnectionType();
6428
- case 32:
6429
- connectionType = _context29.sent;
6430
- _context29.next = 35;
6554
+ case 33:
6555
+ connectionType = _context31.sent;
6556
+ _context31.next = 36;
6431
6557
  return this.webex.meetings.reachability.getReachabilityMetrics();
6432
- case 35:
6433
- reachabilityStats = _context29.sent;
6558
+ case 36:
6559
+ reachabilityStats = _context31.sent;
6434
6560
  _metrics.default.sendBehavioralMetric(_constants2.default.ADD_MEDIA_SUCCESS, _objectSpread({
6435
6561
  correlation_id: this.correlationId,
6436
6562
  locus_id: this.locusUrl.split('/').pop(),
@@ -6449,24 +6575,24 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
6449
6575
 
6450
6576
  // We can log ReceiveSlot SSRCs only after the SDP exchange, so doing it here:
6451
6577
  (_this$remoteMediaMana = this.remoteMediaManager) === null || _this$remoteMediaMana === void 0 ? void 0 : _this$remoteMediaMana.logAllReceiveSlots();
6452
- _context29.next = 54;
6578
+ _context31.next = 55;
6453
6579
  break;
6454
- case 42:
6455
- _context29.prev = 42;
6456
- _context29.t0 = _context29["catch"](18);
6457
- _loggerProxy.default.logger.error("".concat(LOG_HEADER, " failed to establish media connection: "), _context29.t0);
6580
+ case 43:
6581
+ _context31.prev = 43;
6582
+ _context31.t0 = _context31["catch"](19);
6583
+ _loggerProxy.default.logger.error("".concat(LOG_HEADER, " failed to establish media connection: "), _context31.t0);
6458
6584
 
6459
6585
  // @ts-ignore
6460
- _context29.next = 47;
6586
+ _context31.next = 48;
6461
6587
  return this.webex.meetings.reachability.getReachabilityMetrics();
6462
- case 47:
6463
- reachabilityMetrics = _context29.sent;
6588
+ case 48:
6589
+ reachabilityMetrics = _context31.sent;
6464
6590
  _metrics.default.sendBehavioralMetric(_constants2.default.ADD_MEDIA_FAILURE, _objectSpread({
6465
6591
  correlation_id: this.correlationId,
6466
6592
  locus_id: this.locusUrl.split('/').pop(),
6467
- reason: _context29.t0.message,
6468
- stack: _context29.t0.stack,
6469
- code: _context29.t0.code,
6593
+ reason: _context31.t0.message,
6594
+ stack: _context31.t0.stack,
6595
+ code: _context31.t0.code,
6470
6596
  turnDiscoverySkippedReason: this.turnDiscoverySkippedReason,
6471
6597
  turnServerUsed: this.turnServerUsed,
6472
6598
  retriedWithTurnServer: this.retriedWithTurnServer,
@@ -6475,25 +6601,25 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
6475
6601
  connectionState: ((_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.connectionState) || ((_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.connectionState) || 'unknown',
6476
6602
  iceConnectionState: ((_this$mediaProperties34 = this.mediaProperties.webrtcMediaConnection) === null || _this$mediaProperties34 === void 0 ? void 0 : (_this$mediaProperties35 = _this$mediaProperties34.multistreamConnection) === null || _this$mediaProperties35 === void 0 ? void 0 : (_this$mediaProperties36 = _this$mediaProperties35.pc) === null || _this$mediaProperties36 === void 0 ? void 0 : (_this$mediaProperties37 = _this$mediaProperties36.pc) === null || _this$mediaProperties37 === void 0 ? void 0 : _this$mediaProperties37.iceConnectionState) || ((_this$mediaProperties38 = this.mediaProperties.webrtcMediaConnection) === null || _this$mediaProperties38 === void 0 ? void 0 : (_this$mediaProperties39 = _this$mediaProperties38.mediaConnection) === null || _this$mediaProperties39 === void 0 ? void 0 : (_this$mediaProperties40 = _this$mediaProperties39.pc) === null || _this$mediaProperties40 === void 0 ? void 0 : _this$mediaProperties40.iceConnectionState) || 'unknown'
6477
6603
  }, reachabilityMetrics));
6478
- _context29.next = 51;
6604
+ _context31.next = 52;
6479
6605
  return this.cleanUpOnAddMediaFailure();
6480
- case 51:
6606
+ case 52:
6481
6607
  // Upload logs on error while adding media
6482
6608
  _triggerProxy.default.trigger(this, {
6483
6609
  file: 'meeting/index',
6484
6610
  function: 'addMedia'
6485
6611
  }, _constants.EVENTS.REQUEST_UPLOAD_LOGS, this);
6486
- if (_context29.t0 instanceof _internalMediaCore.Errors.SdpError) {
6612
+ if (_context31.t0 instanceof _internalMediaCore.Errors.SdpError) {
6487
6613
  this.leave({
6488
6614
  reason: _constants.MEETING_REMOVED_REASON.MEETING_CONNECTION_FAILED
6489
6615
  });
6490
6616
  }
6491
- throw _context29.t0;
6492
- case 54:
6617
+ throw _context31.t0;
6618
+ case 55:
6493
6619
  case "end":
6494
- return _context29.stop();
6620
+ return _context31.stop();
6495
6621
  }
6496
- }, _callee29, this, [[18, 42]]);
6622
+ }, _callee31, this, [[19, 43]]);
6497
6623
  }));
6498
6624
  function addMedia() {
6499
6625
  return _addMedia.apply(this, arguments);
@@ -6531,7 +6657,7 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
6531
6657
  * @memberof Meeting
6532
6658
  */
6533
6659
  function enqueueMediaUpdate(mediaUpdateType) {
6534
- var _this40 = this;
6660
+ var _this39 = this;
6535
6661
  var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
6536
6662
  var canUpdateMediaNow = this.canUpdateMedia();
6537
6663
  return new _promise.default(function (resolve, reject) {
@@ -6542,9 +6668,9 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
6542
6668
  options: options
6543
6669
  };
6544
6670
  _loggerProxy.default.logger.log("Meeting:index#enqueueMediaUpdate --> enqueuing media update type=".concat(mediaUpdateType));
6545
- _this40.queuedMediaUpdates.push(queueItem);
6671
+ _this39.queuedMediaUpdates.push(queueItem);
6546
6672
  if (canUpdateMediaNow) {
6547
- _this40.processNextQueuedMediaUpdate();
6673
+ _this39.processNextQueuedMediaUpdate();
6548
6674
  }
6549
6675
  });
6550
6676
  }
@@ -6574,35 +6700,35 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
6574
6700
  * @memberof Meeting
6575
6701
  */
6576
6702
  function () {
6577
- var _updateMedia = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee30(options) {
6703
+ var _updateMedia = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee32(options) {
6578
6704
  var audioEnabled, videoEnabled, shareAudioEnabled, shareVideoEnabled;
6579
- return _regenerator.default.wrap(function _callee30$(_context30) {
6580
- while (1) switch (_context30.prev = _context30.next) {
6705
+ return _regenerator.default.wrap(function _callee32$(_context32) {
6706
+ while (1) switch (_context32.prev = _context32.next) {
6581
6707
  case 0:
6582
6708
  this.checkMediaConnection();
6583
6709
  audioEnabled = options.audioEnabled, videoEnabled = options.videoEnabled, shareAudioEnabled = options.shareAudioEnabled, shareVideoEnabled = options.shareVideoEnabled;
6584
6710
  _loggerProxy.default.logger.log("Meeting:index#updateMedia --> called with options=".concat((0, _stringify.default)(options)));
6585
6711
  if (this.canUpdateMedia()) {
6586
- _context30.next = 5;
6712
+ _context32.next = 5;
6587
6713
  break;
6588
6714
  }
6589
- return _context30.abrupt("return", this.enqueueMediaUpdate(MEDIA_UPDATE_TYPE.UPDATE_MEDIA, options));
6715
+ return _context32.abrupt("return", this.enqueueMediaUpdate(MEDIA_UPDATE_TYPE.UPDATE_MEDIA, options));
6590
6716
  case 5:
6591
6717
  if (!this.isMultistream) {
6592
- _context30.next = 10;
6718
+ _context32.next = 10;
6593
6719
  break;
6594
6720
  }
6595
6721
  if (!(shareAudioEnabled !== undefined || shareVideoEnabled !== undefined)) {
6596
- _context30.next = 8;
6722
+ _context32.next = 8;
6597
6723
  break;
6598
6724
  }
6599
6725
  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');
6600
6726
  case 8:
6601
- _context30.next = 12;
6727
+ _context32.next = 12;
6602
6728
  break;
6603
6729
  case 10:
6604
6730
  if (!(shareAudioEnabled !== undefined)) {
6605
- _context30.next = 12;
6731
+ _context32.next = 12;
6606
6732
  break;
6607
6733
  }
6608
6734
  throw new Error('toggling shareAudioEnabled in a transcoded meeting is not supported as of now');
@@ -6627,20 +6753,20 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
6627
6753
  this.mediaProperties.mediaDirection.receiveShare = !!(shareAudioEnabled || shareVideoEnabled);
6628
6754
  }
6629
6755
  if (this.isMultistream) {
6630
- _context30.next = 18;
6756
+ _context32.next = 18;
6631
6757
  break;
6632
6758
  }
6633
- _context30.next = 18;
6759
+ _context32.next = 18;
6634
6760
  return this.updateTranscodedMediaConnection();
6635
6761
  case 18:
6636
- return _context30.abrupt("return", undefined);
6762
+ return _context32.abrupt("return", undefined);
6637
6763
  case 19:
6638
6764
  case "end":
6639
- return _context30.stop();
6765
+ return _context32.stop();
6640
6766
  }
6641
- }, _callee30, this);
6767
+ }, _callee32, this);
6642
6768
  }));
6643
- function updateMedia(_x29) {
6769
+ function updateMedia(_x32) {
6644
6770
  return _updateMedia.apply(this, arguments);
6645
6771
  }
6646
6772
  return updateMedia;
@@ -6655,7 +6781,7 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
6655
6781
  }, {
6656
6782
  key: "acknowledge",
6657
6783
  value: function acknowledge(type) {
6658
- var _this41 = this;
6784
+ var _this40 = this;
6659
6785
  if (!type) {
6660
6786
  return _promise.default.reject(new _parameter.default('Type must be set to acknowledge the meeting.'));
6661
6787
  }
@@ -6667,12 +6793,12 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
6667
6793
  }).then(function (response) {
6668
6794
  return _promise.default.resolve(response);
6669
6795
  }).then(function (response) {
6670
- _this41.meetingFiniteStateMachine.ring(type);
6796
+ _this40.meetingFiniteStateMachine.ring(type);
6671
6797
  // @ts-ignore
6672
- _this41.webex.internal.newMetrics.submitClientEvent({
6798
+ _this40.webex.internal.newMetrics.submitClientEvent({
6673
6799
  name: 'client.alert.displayed',
6674
6800
  options: {
6675
- meetingId: _this41.id
6801
+ meetingId: _this40.id
6676
6802
  }
6677
6803
  });
6678
6804
  return _promise.default.resolve({
@@ -6697,12 +6823,12 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
6697
6823
  }, {
6698
6824
  key: "decline",
6699
6825
  value: function decline(reason) {
6700
- var _this42 = this;
6826
+ var _this41 = this;
6701
6827
  return _util.default.declineMeeting(this, reason).then(function (decline) {
6702
- _this42.meetingFiniteStateMachine.decline();
6828
+ _this41.meetingFiniteStateMachine.decline();
6703
6829
  return _promise.default.resolve(decline);
6704
6830
  }).catch(function (error) {
6705
- _this42.meetingFiniteStateMachine.fail(error);
6831
+ _this41.meetingFiniteStateMachine.fail(error);
6706
6832
  return _promise.default.reject(error);
6707
6833
  });
6708
6834
  }
@@ -6753,7 +6879,7 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
6753
6879
  }, {
6754
6880
  key: "leave",
6755
6881
  value: function leave() {
6756
- var _this43 = this;
6882
+ var _this42 = this;
6757
6883
  var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
6758
6884
  var leaveReason = options.reason || _constants.MEETING_REMOVED_REASON.CLIENT_LEAVE_REQUEST;
6759
6885
 
@@ -6765,7 +6891,7 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
6765
6891
  var payload = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
6766
6892
  return (
6767
6893
  // @ts-ignore
6768
- _this43.webex.internal.newMetrics.submitClientEvent({
6894
+ _this42.webex.internal.newMetrics.submitClientEvent({
6769
6895
  name: 'client.call.leave',
6770
6896
  payload: _objectSpread({
6771
6897
  trigger: 'user-interaction',
@@ -6773,7 +6899,7 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
6773
6899
  leaveReason: options.clientEventLeaveReason
6774
6900
  }, payload),
6775
6901
  options: {
6776
- meetingId: _this43.id
6902
+ meetingId: _this42.id
6777
6903
  }
6778
6904
  })
6779
6905
  );
@@ -6782,24 +6908,24 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
6782
6908
  return _util.default.leaveMeeting(this, options).then(function (leave) {
6783
6909
  // CA team recommends submitting this *after* locus /leave
6784
6910
  submitLeaveMetric();
6785
- _this43.meetingFiniteStateMachine.leave();
6786
- _this43.clearMeetingData();
6911
+ _this42.meetingFiniteStateMachine.leave();
6912
+ _this42.clearMeetingData();
6787
6913
 
6788
6914
  // upload logs on leave irrespective of meeting delete
6789
- _triggerProxy.default.trigger(_this43, {
6915
+ _triggerProxy.default.trigger(_this42, {
6790
6916
  file: 'meeting/index',
6791
6917
  function: 'leave'
6792
- }, _constants.EVENTS.REQUEST_UPLOAD_LOGS, _this43);
6918
+ }, _constants.EVENTS.REQUEST_UPLOAD_LOGS, _this42);
6793
6919
 
6794
6920
  // TODO: more testing before we remove this code, we are not sure the scenarios for destroy here
6795
- if (_this43.wirelessShare || _this43.guest) {
6921
+ if (_this42.wirelessShare || _this42.guest) {
6796
6922
  // If screen sharing clean the meeting object
6797
- _triggerProxy.default.trigger(_this43, {
6923
+ _triggerProxy.default.trigger(_this42, {
6798
6924
  file: 'meeting/index',
6799
6925
  function: 'leave'
6800
6926
  }, _constants.EVENTS.DESTROY_MEETING, {
6801
6927
  reason: options.reason,
6802
- meetingId: _this43.id
6928
+ meetingId: _this42.id
6803
6929
  });
6804
6930
  }
6805
6931
  _loggerProxy.default.logger.log('Meeting:index#leave --> LEAVE REASON ', leaveReason);
@@ -6816,16 +6942,16 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
6816
6942
  shownToUser: false
6817
6943
  }]
6818
6944
  });
6819
- _this43.meetingFiniteStateMachine.fail(error);
6945
+ _this42.meetingFiniteStateMachine.fail(error);
6820
6946
  _loggerProxy.default.logger.error('Meeting:index#leave --> Failed to leave ', error);
6821
6947
  // upload logs on leave irrespective of meeting delete
6822
- _triggerProxy.default.trigger(_this43, {
6948
+ _triggerProxy.default.trigger(_this42, {
6823
6949
  file: 'meeting/index',
6824
6950
  function: 'leave'
6825
- }, _constants.EVENTS.REQUEST_UPLOAD_LOGS, _this43);
6951
+ }, _constants.EVENTS.REQUEST_UPLOAD_LOGS, _this42);
6826
6952
  _metrics.default.sendBehavioralMetric(_constants2.default.MEETING_LEAVE_FAILURE, {
6827
- correlation_id: _this43.correlationId,
6828
- locus_id: _this43.locusUrl.split('/').pop(),
6953
+ correlation_id: _this42.correlationId,
6954
+ locus_id: _this42.locusUrl.split('/').pop(),
6829
6955
  reason: error.message,
6830
6956
  stack: error.stack,
6831
6957
  code: error.code
@@ -6845,7 +6971,7 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
6845
6971
  }, {
6846
6972
  key: "startWhiteboardShare",
6847
6973
  value: function startWhiteboardShare(channelUrl, resourceToken) {
6848
- var _this44 = this;
6974
+ var _this43 = this;
6849
6975
  var whiteboard = this.locusInfo.mediaShares.find(function (element) {
6850
6976
  return element.name === 'whiteboard';
6851
6977
  });
@@ -6874,13 +7000,13 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
6874
7000
  body.resourceToken = resourceToken;
6875
7001
  }
6876
7002
  return this.meetingRequest.changeMeetingFloor(body).then(function () {
6877
- _this44.screenShareFloorState = ScreenShareFloorStatus.RELEASED;
7003
+ _this43.screenShareFloorState = ScreenShareFloorStatus.RELEASED;
6878
7004
  return _promise.default.resolve();
6879
7005
  }).catch(function (error) {
6880
7006
  _loggerProxy.default.logger.error('Meeting:index#startWhiteboardShare --> Error ', error);
6881
7007
  _metrics.default.sendBehavioralMetric(_constants2.default.MEETING_START_WHITEBOARD_SHARE_FAILURE, {
6882
- correlation_id: _this44.correlationId,
6883
- locus_id: _this44.locusUrl.split('/').pop(),
7008
+ correlation_id: _this43.correlationId,
7009
+ locus_id: _this43.locusUrl.split('/').pop(),
6884
7010
  reason: error.message,
6885
7011
  stack: error.stack,
6886
7012
  board: {
@@ -6903,7 +7029,7 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
6903
7029
  }, {
6904
7030
  key: "stopWhiteboardShare",
6905
7031
  value: function stopWhiteboardShare(channelUrl) {
6906
- var _this45 = this;
7032
+ var _this44 = this;
6907
7033
  var whiteboard = this.locusInfo.mediaShares.find(function (element) {
6908
7034
  return element.name === 'whiteboard';
6909
7035
  });
@@ -6926,8 +7052,8 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
6926
7052
  }).catch(function (error) {
6927
7053
  _loggerProxy.default.logger.error('Meeting:index#stopWhiteboardShare --> Error ', error);
6928
7054
  _metrics.default.sendBehavioralMetric(_constants2.default.MEETING_STOP_WHITEBOARD_SHARE_FAILURE, {
6929
- correlation_id: _this45.correlationId,
6930
- locus_id: _this45.locusUrl.split('/').pop(),
7055
+ correlation_id: _this44.correlationId,
7056
+ locus_id: _this44.locusUrl.split('/').pop(),
6931
7057
  reason: error.message,
6932
7058
  stack: error.stack,
6933
7059
  board: {
@@ -6949,7 +7075,7 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
6949
7075
  }, {
6950
7076
  key: "requestScreenShareFloor",
6951
7077
  value: function requestScreenShareFloor() {
6952
- var _this46 = this;
7078
+ var _this45 = this;
6953
7079
  if (!this.mediaProperties.hasLocalShareStream() || !this.mediaProperties.mediaDirection.sendShare) {
6954
7080
  _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, ")"));
6955
7081
  this.screenShareFloorState = ScreenShareFloorStatus.RELEASED;
@@ -6980,34 +7106,34 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
6980
7106
  resourceUrl: this.resourceUrl,
6981
7107
  shareInstanceId: this.localShareInstanceId
6982
7108
  }).then(function () {
6983
- _this46.screenShareFloorState = ScreenShareFloorStatus.GRANTED;
7109
+ _this45.screenShareFloorState = ScreenShareFloorStatus.GRANTED;
6984
7110
  _metrics.default.sendBehavioralMetric(_constants2.default.MEETING_SHARE_SUCCESS, {
6985
- correlation_id: _this46.correlationId,
6986
- locus_id: _this46.locusUrl.split('/').pop()
7111
+ correlation_id: _this45.correlationId,
7112
+ locus_id: _this45.locusUrl.split('/').pop()
6987
7113
  });
6988
7114
  return _promise.default.resolve();
6989
7115
  }).catch(function (error) {
6990
7116
  _loggerProxy.default.logger.error('Meeting:index#share --> Error ', error);
6991
7117
  _metrics.default.sendBehavioralMetric(_constants2.default.MEETING_SHARE_FAILURE, {
6992
- correlation_id: _this46.correlationId,
6993
- locus_id: _this46.locusUrl.split('/').pop(),
7118
+ correlation_id: _this45.correlationId,
7119
+ locus_id: _this45.locusUrl.split('/').pop(),
6994
7120
  reason: error.message,
6995
7121
  stack: error.stack
6996
7122
  });
6997
7123
 
6998
7124
  // @ts-ignore
6999
- _this46.webex.internal.newMetrics.submitClientEvent({
7125
+ _this45.webex.internal.newMetrics.submitClientEvent({
7000
7126
  name: 'client.share.floor-granted.local',
7001
7127
  payload: {
7002
7128
  mediaType: 'share',
7003
7129
  errors: _util.default.getChangeMeetingFloorErrorPayload(error.message),
7004
- shareInstanceId: _this46.localShareInstanceId
7130
+ shareInstanceId: _this45.localShareInstanceId
7005
7131
  },
7006
7132
  options: {
7007
- meetingId: _this46.id
7133
+ meetingId: _this45.id
7008
7134
  }
7009
7135
  });
7010
- _this46.screenShareFloorState = ScreenShareFloorStatus.RELEASED;
7136
+ _this45.screenShareFloorState = ScreenShareFloorStatus.RELEASED;
7011
7137
  return _promise.default.reject(error);
7012
7138
  });
7013
7139
  }
@@ -7030,10 +7156,10 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
7030
7156
  }, {
7031
7157
  key: "requestScreenShareFloorIfPending",
7032
7158
  value: function requestScreenShareFloorIfPending() {
7033
- var _this47 = this;
7159
+ var _this46 = this;
7034
7160
  if (this.floorGrantPending && this.state === _constants.MEETING_STATE.STATES.JOINED) {
7035
7161
  this.requestScreenShareFloor().then(function () {
7036
- _this47.floorGrantPending = false;
7162
+ _this46.floorGrantPending = false;
7037
7163
  });
7038
7164
  }
7039
7165
  }
@@ -7047,7 +7173,7 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
7047
7173
  }, {
7048
7174
  key: "releaseScreenShareFloor",
7049
7175
  value: function releaseScreenShareFloor() {
7050
- var _this48 = this;
7176
+ var _this47 = this;
7051
7177
  var content = this.locusInfo.mediaShares.find(function (element) {
7052
7178
  return element.name === _constants.CONTENT;
7053
7179
  });
@@ -7082,8 +7208,8 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
7082
7208
  }).catch(function (error) {
7083
7209
  _loggerProxy.default.logger.error('Meeting:index#releaseScreenShareFloor --> Error ', error);
7084
7210
  _metrics.default.sendBehavioralMetric(_constants2.default.STOP_FLOOR_REQUEST_FAILURE, {
7085
- correlation_id: _this48.correlationId,
7086
- locus_id: _this48.locusUrl.split('/').pop(),
7211
+ correlation_id: _this47.correlationId,
7212
+ locus_id: _this47.locusUrl.split('/').pop(),
7087
7213
  reason: error.message,
7088
7214
  stack: error.stack
7089
7215
  });
@@ -7262,7 +7388,7 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
7262
7388
  }, {
7263
7389
  key: "changeVideoLayout",
7264
7390
  value: function changeVideoLayout(layoutType) {
7265
- var _this49 = this;
7391
+ var _this48 = this;
7266
7392
  var renderInfo = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
7267
7393
  var main = renderInfo.main,
7268
7394
  content = renderInfo.content;
@@ -7316,7 +7442,7 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
7316
7442
  }
7317
7443
  this.lastVideoLayoutInfo = (0, _cloneDeep2.default)(layoutInfo);
7318
7444
  this.locusInfo.once(_constants.LOCUSINFO.EVENTS.CONTROLS_MEETING_LAYOUT_UPDATED, function (envelope) {
7319
- _triggerProxy.default.trigger(_this49, {
7445
+ _triggerProxy.default.trigger(_this48, {
7320
7446
  file: 'meeting/index',
7321
7447
  function: 'changeVideoLayout'
7322
7448
  }, _constants.EVENT_TRIGGERS.MEETING_CONTROLS_LAYOUT_UPDATE, {
@@ -7439,7 +7565,7 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
7439
7565
  }, {
7440
7566
  key: "endMeetingForAll",
7441
7567
  value: function endMeetingForAll() {
7442
- var _this50 = this;
7568
+ var _this49 = this;
7443
7569
  // @ts-ignore
7444
7570
  this.webex.internal.newMetrics.submitClientEvent({
7445
7571
  name: 'client.call.leave',
@@ -7457,25 +7583,25 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
7457
7583
  locus_id: this.locusId
7458
7584
  });
7459
7585
  return _util.default.endMeetingForAll(this).then(function (end) {
7460
- _this50.meetingFiniteStateMachine.end();
7461
- _this50.clearMeetingData();
7586
+ _this49.meetingFiniteStateMachine.end();
7587
+ _this49.clearMeetingData();
7462
7588
  // upload logs on leave irrespective of meeting delete
7463
- _triggerProxy.default.trigger(_this50, {
7589
+ _triggerProxy.default.trigger(_this49, {
7464
7590
  file: 'meeting/index',
7465
7591
  function: 'endMeetingForAll'
7466
- }, _constants.EVENTS.REQUEST_UPLOAD_LOGS, _this50);
7592
+ }, _constants.EVENTS.REQUEST_UPLOAD_LOGS, _this49);
7467
7593
  return end;
7468
7594
  }).catch(function (error) {
7469
- _this50.meetingFiniteStateMachine.fail(error);
7595
+ _this49.meetingFiniteStateMachine.fail(error);
7470
7596
  _loggerProxy.default.logger.error('Meeting:index#endMeetingForAll --> Failed to end meeting ', error);
7471
7597
  // upload logs on leave irrespective of meeting delete
7472
- _triggerProxy.default.trigger(_this50, {
7598
+ _triggerProxy.default.trigger(_this49, {
7473
7599
  file: 'meeting/index',
7474
7600
  function: 'endMeetingForAll'
7475
- }, _constants.EVENTS.REQUEST_UPLOAD_LOGS, _this50);
7601
+ }, _constants.EVENTS.REQUEST_UPLOAD_LOGS, _this49);
7476
7602
  _metrics.default.sendBehavioralMetric(_constants2.default.MEETING_END_ALL_FAILURE, {
7477
- correlation_id: _this50.correlationId,
7478
- locus_id: _this50.locusUrl.split('/').pop(),
7603
+ correlation_id: _this49.correlationId,
7604
+ locus_id: _this49.locusUrl.split('/').pop(),
7479
7605
  reason: error.message,
7480
7606
  stack: error.stack,
7481
7607
  code: error.code
@@ -7571,39 +7697,39 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
7571
7697
  }, {
7572
7698
  key: "enableMusicMode",
7573
7699
  value: function () {
7574
- var _enableMusicMode = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee31(shouldEnableMusicMode) {
7575
- return _regenerator.default.wrap(function _callee31$(_context31) {
7576
- while (1) switch (_context31.prev = _context31.next) {
7700
+ var _enableMusicMode = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee33(shouldEnableMusicMode) {
7701
+ return _regenerator.default.wrap(function _callee33$(_context33) {
7702
+ while (1) switch (_context33.prev = _context33.next) {
7577
7703
  case 0:
7578
7704
  this.checkMediaConnection();
7579
7705
  if (this.isMultistream) {
7580
- _context31.next = 3;
7706
+ _context33.next = 3;
7581
7707
  break;
7582
7708
  }
7583
7709
  throw new Error('enableMusicMode() only supported with multistream');
7584
7710
  case 3:
7585
7711
  if (!shouldEnableMusicMode) {
7586
- _context31.next = 8;
7712
+ _context33.next = 8;
7587
7713
  break;
7588
7714
  }
7589
- _context31.next = 6;
7715
+ _context33.next = 6;
7590
7716
  return this.sendSlotManager.setCodecParameters(_internalMediaCore.MediaType.AudioMain, {
7591
7717
  maxaveragebitrate: '64000',
7592
7718
  maxplaybackrate: '48000'
7593
7719
  });
7594
7720
  case 6:
7595
- _context31.next = 10;
7721
+ _context33.next = 10;
7596
7722
  break;
7597
7723
  case 8:
7598
- _context31.next = 10;
7724
+ _context33.next = 10;
7599
7725
  return this.sendSlotManager.deleteCodecParameters(_internalMediaCore.MediaType.AudioMain, ['maxaveragebitrate', 'maxplaybackrate']);
7600
7726
  case 10:
7601
7727
  case "end":
7602
- return _context31.stop();
7728
+ return _context33.stop();
7603
7729
  }
7604
- }, _callee31, this);
7730
+ }, _callee33, this);
7605
7731
  }));
7606
- function enableMusicMode(_x30) {
7732
+ function enableMusicMode(_x33) {
7607
7733
  return _enableMusicMode.apply(this, arguments);
7608
7734
  }
7609
7735
  return enableMusicMode;
@@ -7623,7 +7749,7 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
7623
7749
  _this$mediaProperties48,
7624
7750
  _this$mediaProperties49,
7625
7751
  _this$mediaProperties50,
7626
- _this51 = this;
7752
+ _this50 = this;
7627
7753
  var LOG_HEADER = 'Meeting:index#updateTranscodedMediaConnection -->';
7628
7754
  _loggerProxy.default.logger.info("".concat(LOG_HEADER, " starting"));
7629
7755
  if (!this.canUpdateMedia()) {
@@ -7648,8 +7774,8 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
7648
7774
  }).catch(function (error) {
7649
7775
  _loggerProxy.default.logger.error("".concat(LOG_HEADER, " Error: "), error);
7650
7776
  _metrics.default.sendBehavioralMetric(_constants2.default.UPDATE_MEDIA_FAILURE, {
7651
- correlation_id: _this51.correlationId,
7652
- locus_id: _this51.locusUrl.split('/').pop(),
7777
+ correlation_id: _this50.correlationId,
7778
+ locus_id: _this50.locusUrl.split('/').pop(),
7653
7779
  reason: error.message,
7654
7780
  stack: error.stack
7655
7781
  });
@@ -7693,25 +7819,25 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
7693
7819
  }, {
7694
7820
  key: "publishStream",
7695
7821
  value: function () {
7696
- var _publishStream = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee32(mediaType, stream) {
7697
- return _regenerator.default.wrap(function _callee32$(_context32) {
7698
- while (1) switch (_context32.prev = _context32.next) {
7822
+ var _publishStream = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee34(mediaType, stream) {
7823
+ return _regenerator.default.wrap(function _callee34$(_context34) {
7824
+ while (1) switch (_context34.prev = _context34.next) {
7699
7825
  case 0:
7700
7826
  if (stream) {
7701
- _context32.next = 2;
7827
+ _context34.next = 2;
7702
7828
  break;
7703
7829
  }
7704
- return _context32.abrupt("return");
7830
+ return _context34.abrupt("return");
7705
7831
  case 2:
7706
7832
  if (!this.mediaProperties.webrtcMediaConnection) {
7707
- _context32.next = 7;
7833
+ _context34.next = 7;
7708
7834
  break;
7709
7835
  }
7710
7836
  if (!(this.isMultistream && this.mediaProperties.webrtcMediaConnection)) {
7711
- _context32.next = 6;
7837
+ _context34.next = 6;
7712
7838
  break;
7713
7839
  }
7714
- _context32.next = 6;
7840
+ _context34.next = 6;
7715
7841
  return this.sendSlotManager.publishStream(mediaType, stream);
7716
7842
  case 6:
7717
7843
  this.emitPublishStateChangeEvent({
@@ -7722,11 +7848,11 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
7722
7848
  });
7723
7849
  case 7:
7724
7850
  case "end":
7725
- return _context32.stop();
7851
+ return _context34.stop();
7726
7852
  }
7727
- }, _callee32, this);
7853
+ }, _callee34, this);
7728
7854
  }));
7729
- function publishStream(_x31, _x32) {
7855
+ function publishStream(_x34, _x35) {
7730
7856
  return _publishStream.apply(this, arguments);
7731
7857
  }
7732
7858
  return publishStream;
@@ -7741,21 +7867,21 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
7741
7867
  }, {
7742
7868
  key: "unpublishStream",
7743
7869
  value: function () {
7744
- var _unpublishStream = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee33(mediaType, stream) {
7745
- return _regenerator.default.wrap(function _callee33$(_context33) {
7746
- while (1) switch (_context33.prev = _context33.next) {
7870
+ var _unpublishStream = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee35(mediaType, stream) {
7871
+ return _regenerator.default.wrap(function _callee35$(_context35) {
7872
+ while (1) switch (_context35.prev = _context35.next) {
7747
7873
  case 0:
7748
7874
  if (stream) {
7749
- _context33.next = 2;
7875
+ _context35.next = 2;
7750
7876
  break;
7751
7877
  }
7752
- return _context33.abrupt("return");
7878
+ return _context35.abrupt("return");
7753
7879
  case 2:
7754
7880
  if (!(this.isMultistream && this.mediaProperties.webrtcMediaConnection)) {
7755
- _context33.next = 5;
7881
+ _context35.next = 5;
7756
7882
  break;
7757
7883
  }
7758
- _context33.next = 5;
7884
+ _context35.next = 5;
7759
7885
  return this.sendSlotManager.unpublishStream(mediaType);
7760
7886
  case 5:
7761
7887
  this.emitPublishStateChangeEvent({
@@ -7766,11 +7892,11 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
7766
7892
  });
7767
7893
  case 6:
7768
7894
  case "end":
7769
- return _context33.stop();
7895
+ return _context35.stop();
7770
7896
  }
7771
- }, _callee33, this);
7897
+ }, _callee35, this);
7772
7898
  }));
7773
- function unpublishStream(_x33, _x34) {
7899
+ function unpublishStream(_x36, _x37) {
7774
7900
  return _unpublishStream.apply(this, arguments);
7775
7901
  }
7776
7902
  return unpublishStream;
@@ -7784,61 +7910,61 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
7784
7910
  }, {
7785
7911
  key: "publishStreams",
7786
7912
  value: function () {
7787
- var _publishStreams = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee34(streams) {
7913
+ var _publishStreams = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee36(streams) {
7788
7914
  var _streams$screenShare, _streams$screenShare2, _streams$screenShare3, _streams$screenShare4;
7789
7915
  var floorRequestNeeded, _streams$screenShare5;
7790
- return _regenerator.default.wrap(function _callee34$(_context34) {
7791
- while (1) switch (_context34.prev = _context34.next) {
7916
+ return _regenerator.default.wrap(function _callee36$(_context36) {
7917
+ while (1) switch (_context36.prev = _context36.next) {
7792
7918
  case 0:
7793
7919
  this.checkMediaConnection();
7794
7920
  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))) {
7795
- _context34.next = 3;
7921
+ _context36.next = 3;
7796
7922
  break;
7797
7923
  }
7798
- return _context34.abrupt("return");
7924
+ return _context36.abrupt("return");
7799
7925
  case 3:
7800
7926
  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
7801
7927
  if (!(this.isMultistream && (_streams$screenShare3 = streams.screenShare) !== null && _streams$screenShare3 !== void 0 && _streams$screenShare3.audio)) {
7802
- _context34.next = 8;
7928
+ _context36.next = 8;
7803
7929
  break;
7804
7930
  }
7805
- _context34.next = 7;
7931
+ _context36.next = 7;
7806
7932
  return this.setLocalShareAudioStream(streams.screenShare.audio);
7807
7933
  case 7:
7808
7934
  floorRequestNeeded = this.screenShareFloorState === ScreenShareFloorStatus.RELEASED;
7809
7935
  case 8:
7810
7936
  if (!((_streams$screenShare4 = streams.screenShare) !== null && _streams$screenShare4 !== void 0 && _streams$screenShare4.video)) {
7811
- _context34.next = 12;
7937
+ _context36.next = 12;
7812
7938
  break;
7813
7939
  }
7814
- _context34.next = 11;
7940
+ _context36.next = 11;
7815
7941
  return this.setLocalShareVideoStream((_streams$screenShare5 = streams.screenShare) === null || _streams$screenShare5 === void 0 ? void 0 : _streams$screenShare5.video);
7816
7942
  case 11:
7817
7943
  floorRequestNeeded = this.screenShareFloorState === ScreenShareFloorStatus.RELEASED;
7818
7944
  case 12:
7819
7945
  if (!streams.microphone) {
7820
- _context34.next = 15;
7946
+ _context36.next = 15;
7821
7947
  break;
7822
7948
  }
7823
- _context34.next = 15;
7949
+ _context36.next = 15;
7824
7950
  return this.setLocalAudioStream(streams.microphone);
7825
7951
  case 15:
7826
7952
  if (!streams.camera) {
7827
- _context34.next = 18;
7953
+ _context36.next = 18;
7828
7954
  break;
7829
7955
  }
7830
- _context34.next = 18;
7956
+ _context36.next = 18;
7831
7957
  return this.setLocalVideoStream(streams.camera);
7832
7958
  case 18:
7833
7959
  if (this.isMultistream) {
7834
- _context34.next = 21;
7960
+ _context36.next = 21;
7835
7961
  break;
7836
7962
  }
7837
- _context34.next = 21;
7963
+ _context36.next = 21;
7838
7964
  return this.updateTranscodedMediaConnection();
7839
7965
  case 21:
7840
7966
  if (!floorRequestNeeded) {
7841
- _context34.next = 27;
7967
+ _context36.next = 27;
7842
7968
  break;
7843
7969
  }
7844
7970
  this.localShareInstanceId = _uuid.default.v4();
@@ -7862,15 +7988,15 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
7862
7988
  // we're sending the http request to Locus to request the screen share floor
7863
7989
  // only after the SDP update, because that's how it's always been done for transcoded meetings
7864
7990
  // and also if sharing from the start, we need confluence to have been created
7865
- _context34.next = 27;
7991
+ _context36.next = 27;
7866
7992
  return this.enqueueScreenShareFloorRequest();
7867
7993
  case 27:
7868
7994
  case "end":
7869
- return _context34.stop();
7995
+ return _context36.stop();
7870
7996
  }
7871
- }, _callee34, this);
7997
+ }, _callee36, this);
7872
7998
  }));
7873
- function publishStreams(_x35) {
7999
+ function publishStreams(_x38) {
7874
8000
  return _publishStreams.apply(this, arguments);
7875
8001
  }
7876
8002
  return publishStreams;
@@ -7884,10 +8010,10 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
7884
8010
  }, {
7885
8011
  key: "unpublishStreams",
7886
8012
  value: function () {
7887
- var _unpublishStreams = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee35(streams) {
8013
+ var _unpublishStreams = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee37(streams) {
7888
8014
  var promises, _iterator, _step, stream;
7889
- return _regenerator.default.wrap(function _callee35$(_context35) {
7890
- while (1) switch (_context35.prev = _context35.next) {
8015
+ return _regenerator.default.wrap(function _callee37$(_context37) {
8016
+ while (1) switch (_context37.prev = _context37.next) {
7891
8017
  case 0:
7892
8018
  this.checkMediaConnection();
7893
8019
  promises = [];
@@ -7918,7 +8044,7 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
7918
8044
  if (!this.isMultistream) {
7919
8045
  promises.push(this.updateTranscodedMediaConnection());
7920
8046
  }
7921
- _context35.next = 7;
8047
+ _context37.next = 7;
7922
8048
  return _promise.default.all(promises);
7923
8049
  case 7:
7924
8050
  // we're allowing for the SDK to support just audio share as well
@@ -7939,11 +8065,11 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
7939
8065
  }
7940
8066
  case 8:
7941
8067
  case "end":
7942
- return _context35.stop();
8068
+ return _context37.stop();
7943
8069
  }
7944
- }, _callee35, this);
8070
+ }, _callee37, this);
7945
8071
  }));
7946
- function unpublishStreams(_x36) {
8072
+ function unpublishStreams(_x39) {
7947
8073
  return _unpublishStreams.apply(this, arguments);
7948
8074
  }
7949
8075
  return unpublishStreams;
@@ -8002,27 +8128,27 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
8002
8128
  }], [{
8003
8129
  key: "handleDeviceLogging",
8004
8130
  value: function () {
8005
- var _handleDeviceLogging = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee36() {
8131
+ var _handleDeviceLogging = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee38() {
8006
8132
  var devices;
8007
- return _regenerator.default.wrap(function _callee36$(_context36) {
8008
- while (1) switch (_context36.prev = _context36.next) {
8133
+ return _regenerator.default.wrap(function _callee38$(_context38) {
8134
+ while (1) switch (_context38.prev = _context38.next) {
8009
8135
  case 0:
8010
- _context36.prev = 0;
8011
- _context36.next = 3;
8136
+ _context38.prev = 0;
8137
+ _context38.next = 3;
8012
8138
  return (0, _mediaHelpers.getDevices)();
8013
8139
  case 3:
8014
- devices = _context36.sent;
8140
+ devices = _context38.sent;
8015
8141
  _util.default.handleDeviceLogging(devices);
8016
- _context36.next = 9;
8142
+ _context38.next = 9;
8017
8143
  break;
8018
8144
  case 7:
8019
- _context36.prev = 7;
8020
- _context36.t0 = _context36["catch"](0);
8145
+ _context38.prev = 7;
8146
+ _context38.t0 = _context38["catch"](0);
8021
8147
  case 9:
8022
8148
  case "end":
8023
- return _context36.stop();
8149
+ return _context38.stop();
8024
8150
  }
8025
- }, _callee36, null, [[0, 7]]);
8151
+ }, _callee38, null, [[0, 7]]);
8026
8152
  }));
8027
8153
  function handleDeviceLogging() {
8028
8154
  return _handleDeviceLogging.apply(this, arguments);