@webex/plugin-meetings 2.60.1-next.6 → 2.60.1-next.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. package/README.md +12 -0
  2. package/dist/breakouts/breakout.js +1 -1
  3. package/dist/breakouts/index.js +1 -1
  4. package/dist/constants.d.ts +14 -2
  5. package/dist/constants.js +18 -6
  6. package/dist/constants.js.map +1 -1
  7. package/dist/interpretation/index.js +1 -1
  8. package/dist/interpretation/siLanguage.js +1 -1
  9. package/dist/locus-info/index.d.ts +1 -1
  10. package/dist/locus-info/index.js +8 -8
  11. package/dist/locus-info/index.js.map +1 -1
  12. package/dist/meeting/index.d.ts +63 -19
  13. package/dist/meeting/index.js +703 -579
  14. package/dist/meeting/index.js.map +1 -1
  15. package/dist/meeting/request.js +25 -18
  16. package/dist/meeting/request.js.map +1 -1
  17. package/dist/meeting/util.d.ts +16 -0
  18. package/dist/meeting/util.js +71 -0
  19. package/dist/meeting/util.js.map +1 -1
  20. package/dist/meetings/index.d.ts +25 -3
  21. package/dist/meetings/index.js +83 -32
  22. package/dist/meetings/index.js.map +1 -1
  23. package/dist/reachability/index.js +11 -6
  24. package/dist/reachability/index.js.map +1 -1
  25. package/dist/reconnection-manager/index.js +3 -1
  26. package/dist/reconnection-manager/index.js.map +1 -1
  27. package/dist/roap/index.js +50 -54
  28. package/dist/roap/index.js.map +1 -1
  29. package/dist/statsAnalyzer/index.js +1 -1
  30. package/dist/statsAnalyzer/index.js.map +1 -1
  31. package/dist/statsAnalyzer/mqaUtil.js +13 -10
  32. package/dist/statsAnalyzer/mqaUtil.js.map +1 -1
  33. package/dist/webinar/index.js +1 -1
  34. package/package.json +22 -22
  35. package/src/constants.ts +15 -2
  36. package/src/locus-info/index.ts +13 -12
  37. package/src/meeting/index.ts +256 -130
  38. package/src/meeting/request.ts +7 -0
  39. package/src/meeting/util.ts +97 -0
  40. package/src/meetings/index.ts +59 -18
  41. package/src/reachability/index.ts +7 -4
  42. package/src/reconnection-manager/index.ts +1 -1
  43. package/src/roap/index.ts +49 -51
  44. package/src/statsAnalyzer/index.ts +2 -2
  45. package/src/statsAnalyzer/mqaUtil.ts +15 -14
  46. package/test/unit/spec/locus-info/index.js +53 -5
  47. package/test/unit/spec/meeting/index.js +1792 -1139
  48. package/test/unit/spec/meeting/request.js +22 -12
  49. package/test/unit/spec/meeting/utils.js +93 -0
  50. package/test/unit/spec/meetings/index.js +180 -21
  51. package/test/unit/spec/reachability/index.ts +2 -1
  52. package/test/unit/spec/reconnection-manager/index.js +1 -0
  53. package/test/unit/spec/roap/index.ts +28 -42
  54. package/test/unit/spec/stats-analyzer/index.js +415 -30
@@ -488,6 +488,8 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
488
488
  (0, _defineProperty3.default)((0, _assertThisInitialized2.default)(_this), "environment", void 0);
489
489
  (0, _defineProperty3.default)((0, _assertThisInitialized2.default)(_this), "namespace", _constants.MEETINGS);
490
490
  (0, _defineProperty3.default)((0, _assertThisInitialized2.default)(_this), "allowMediaInLobby", void 0);
491
+ (0, _defineProperty3.default)((0, _assertThisInitialized2.default)(_this), "localShareInstanceId", void 0);
492
+ (0, _defineProperty3.default)((0, _assertThisInitialized2.default)(_this), "remoteShareInstanceId", void 0);
491
493
  (0, _defineProperty3.default)((0, _assertThisInitialized2.default)(_this), "turnDiscoverySkippedReason", void 0);
492
494
  (0, _defineProperty3.default)((0, _assertThisInitialized2.default)(_this), "turnServerUsed", void 0);
493
495
  (0, _defineProperty3.default)((0, _assertThisInitialized2.default)(_this), "areVoiceaEventsSetup", false);
@@ -717,9 +719,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
717
719
  sdp: event.roapMessage.sdp,
718
720
  seq: event.roapMessage.seq,
719
721
  tieBreaker: event.roapMessage.tieBreaker,
720
- meeting: (0, _assertThisInitialized2.default)(_this),
721
- // or can pass meeting ID
722
- reconnect: _this.reconnectionManager.isReconnectInProgress()
722
+ meeting: (0, _assertThisInitialized2.default)(_this) // or can pass meeting ID
723
723
  }).then(function (_ref2) {
724
724
  var roapAnswer = _ref2.roapAnswer;
725
725
  if (roapAnswer) {
@@ -969,7 +969,8 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
969
969
  _this.webex.internal.newMetrics.submitClientEvent({
970
970
  name: 'client.media.tx.start',
971
971
  payload: {
972
- mediaType: data.type
972
+ mediaType: data.type,
973
+ shareInstanceId: data.type === 'share' ? _this.localShareInstanceId : undefined
973
974
  },
974
975
  options: {
975
976
  meetingId: _this.id
@@ -981,7 +982,8 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
981
982
  _this.webex.internal.newMetrics.submitClientEvent({
982
983
  name: 'client.media.tx.stop',
983
984
  payload: {
984
- mediaType: data.type
985
+ mediaType: data.type,
986
+ shareInstanceId: data.type === 'share' ? _this.localShareInstanceId : undefined
985
987
  },
986
988
  options: {
987
989
  meetingId: _this.id
@@ -997,7 +999,8 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
997
999
  _this.webex.internal.newMetrics.submitClientEvent({
998
1000
  name: 'client.media.rx.start',
999
1001
  payload: {
1000
- mediaType: data.type
1002
+ mediaType: data.type,
1003
+ shareInstanceId: data.type === 'share' ? _this.remoteShareInstanceId : undefined
1001
1004
  },
1002
1005
  options: {
1003
1006
  meetingId: _this.id
@@ -1009,7 +1012,8 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
1009
1012
  _this.webex.internal.newMetrics.submitClientEvent({
1010
1013
  name: 'client.media.rx.stop',
1011
1014
  payload: {
1012
- mediaType: data.type
1015
+ mediaType: data.type,
1016
+ shareInstanceId: data.type === 'share' ? _this.remoteShareInstanceId : undefined
1013
1017
  },
1014
1018
  options: {
1015
1019
  meetingId: _this.id
@@ -1892,6 +1896,24 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
1892
1896
  */
1893
1897
  _this.keepAliveTimerId = null;
1894
1898
 
1899
+ /**
1900
+ * id for tracking Local Share instances in Call Analyzer
1901
+ * @instance
1902
+ * @type {String}
1903
+ * @private
1904
+ * @memberof Meeting
1905
+ */
1906
+ _this.localShareInstanceId = null;
1907
+
1908
+ /**
1909
+ * id for tracking Remote Share instances in Call Analyzer
1910
+ * @instance
1911
+ * @type {String}
1912
+ * @private
1913
+ * @memberof Meeting
1914
+ */
1915
+ _this.remoteShareInstanceId = null;
1916
+
1895
1917
  /**
1896
1918
  * The class that helps to control recording functions: start, stop, pause, resume, etc
1897
1919
  * @instance
@@ -2053,6 +2075,99 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
2053
2075
  this.callStateForMetrics.correlationId = correlationId;
2054
2076
  }
2055
2077
 
2078
+ /**
2079
+ * Set meeting info and trigger `MEETING_INFO_AVAILABLE` event
2080
+ * @param {any} info
2081
+ * @param {string} [meetingLookupUrl] Lookup url, defined when the meeting info fetched
2082
+ * @returns {void}
2083
+ */
2084
+ }, {
2085
+ key: "setMeetingInfo",
2086
+ value: function setMeetingInfo(info, meetingLookupUrl) {
2087
+ this.meetingInfo = info ? _objectSpread(_objectSpread({}, info), {}, {
2088
+ meetingLookupUrl: meetingLookupUrl
2089
+ }) : null;
2090
+ this.meetingInfoFailureReason = _constants.MEETING_INFO_FAILURE_REASON.NONE;
2091
+ this.requiredCaptcha = null;
2092
+ if (this.passwordStatus === _constants.PASSWORD_STATUS.REQUIRED || this.passwordStatus === _constants.PASSWORD_STATUS.VERIFIED) {
2093
+ this.passwordStatus = _constants.PASSWORD_STATUS.VERIFIED;
2094
+ } else {
2095
+ this.passwordStatus = _constants.PASSWORD_STATUS.NOT_REQUIRED;
2096
+ }
2097
+ _triggerProxy.default.trigger(this, {
2098
+ file: 'meetings',
2099
+ function: 'fetchMeetingInfo'
2100
+ }, _constants.EVENT_TRIGGERS.MEETING_INFO_AVAILABLE);
2101
+ this.updateMeetingActions();
2102
+ }
2103
+
2104
+ /**
2105
+ * Add pre-fetched meeting info
2106
+ *
2107
+ * The passed meeting info should be be complete, e.g.: fetched after password or captcha provided
2108
+ *
2109
+ * @param {Object} meetingInfo - Complete meeting info
2110
+ * @param {FetchMeetingInfoParams} fetchParams - Fetch parameters for validation
2111
+ * @param {String|undefined} meetingLookupUrl - Lookup url, defined when the meeting info fetched
2112
+ * @returns {Promise<void>}
2113
+ */
2114
+ }, {
2115
+ key: "injectMeetingInfo",
2116
+ value: (function () {
2117
+ var _injectMeetingInfo = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4(meetingInfo, fetchParams, meetingLookupUrl) {
2118
+ return _regenerator.default.wrap(function _callee4$(_context4) {
2119
+ while (1) switch (_context4.prev = _context4.next) {
2120
+ case 0:
2121
+ _context4.next = 2;
2122
+ return this.prepForFetchMeetingInfo(fetchParams, 'injectMeetingInfo');
2123
+ case 2:
2124
+ this.parseMeetingInfo(meetingInfo, this.destination);
2125
+ this.setMeetingInfo(meetingInfo, meetingLookupUrl);
2126
+ case 4:
2127
+ case "end":
2128
+ return _context4.stop();
2129
+ }
2130
+ }, _callee4, this);
2131
+ }));
2132
+ function injectMeetingInfo(_x2, _x3, _x4) {
2133
+ return _injectMeetingInfo.apply(this, arguments);
2134
+ }
2135
+ return injectMeetingInfo;
2136
+ }()
2137
+ /**
2138
+ * Validate fetch parameters and clear the fetchMeetingInfoTimeout timeout
2139
+ *
2140
+ * @param {FetchMeetingInfoParams} fetchParams - fetch parameters for validation
2141
+ * @param {String} caller - Name of the caller for logging
2142
+ *
2143
+ * @returns {Promise<void>}
2144
+ * @private
2145
+ */
2146
+ )
2147
+ }, {
2148
+ key: "prepForFetchMeetingInfo",
2149
+ value: function prepForFetchMeetingInfo(_ref7, caller) {
2150
+ var _ref7$password = _ref7.password,
2151
+ password = _ref7$password === void 0 ? null : _ref7$password,
2152
+ _ref7$captchaCode = _ref7.captchaCode,
2153
+ captchaCode = _ref7$captchaCode === void 0 ? null : _ref7$captchaCode,
2154
+ _ref7$extraParams = _ref7.extraParams,
2155
+ extraParams = _ref7$extraParams === void 0 ? {} : _ref7$extraParams;
2156
+ // when fetch meeting info is called directly by the client, we want to clear out the random timer for sdk to do it
2157
+ if (this.fetchMeetingInfoTimeoutId) {
2158
+ clearTimeout(this.fetchMeetingInfoTimeoutId);
2159
+ this.fetchMeetingInfoTimeoutId = undefined;
2160
+ }
2161
+ if (captchaCode && !this.requiredCaptcha) {
2162
+ return _promise.default.reject(new Error("".concat(caller, "() called with captchaCode when captcha was not required")));
2163
+ }
2164
+ if (password && this.passwordStatus !== _constants.PASSWORD_STATUS.REQUIRED && this.passwordStatus !== _constants.PASSWORD_STATUS.UNKNOWN) {
2165
+ return _promise.default.reject(new Error("".concat(caller, "() called with password when password was not required")));
2166
+ }
2167
+ this.meetingInfoExtraParams = (0, _lodash.cloneDeep)(extraParams);
2168
+ return _promise.default.resolve();
2169
+ }
2170
+
2056
2171
  /**
2057
2172
  * Internal method for fetching meeting info
2058
2173
  *
@@ -2061,18 +2176,18 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
2061
2176
  }, {
2062
2177
  key: "fetchMeetingInfoInternal",
2063
2178
  value: (function () {
2064
- var _fetchMeetingInfoInternal = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4(_ref7) {
2065
- var destination, destinationType, _ref7$password, password, _ref7$captchaCode, captchaCode, _ref7$extraParams, extraParams, _ref7$sendCAevents, sendCAevents, captchaInfo, info, _err$body, _err$body2;
2066
- return _regenerator.default.wrap(function _callee4$(_context4) {
2067
- while (1) switch (_context4.prev = _context4.next) {
2179
+ var _fetchMeetingInfoInternal = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee5(_ref8) {
2180
+ var destination, destinationType, _ref8$password, password, _ref8$captchaCode, captchaCode, _ref8$extraParams, extraParams, _ref8$sendCAevents, sendCAevents, captchaInfo, info, _err$body, _err$body2;
2181
+ return _regenerator.default.wrap(function _callee5$(_context5) {
2182
+ while (1) switch (_context5.prev = _context5.next) {
2068
2183
  case 0:
2069
- destination = _ref7.destination, destinationType = _ref7.destinationType, _ref7$password = _ref7.password, password = _ref7$password === void 0 ? null : _ref7$password, _ref7$captchaCode = _ref7.captchaCode, captchaCode = _ref7$captchaCode === void 0 ? null : _ref7$captchaCode, _ref7$extraParams = _ref7.extraParams, extraParams = _ref7$extraParams === void 0 ? {} : _ref7$extraParams, _ref7$sendCAevents = _ref7.sendCAevents, sendCAevents = _ref7$sendCAevents === void 0 ? false : _ref7$sendCAevents;
2070
- _context4.prev = 1;
2184
+ destination = _ref8.destination, destinationType = _ref8.destinationType, _ref8$password = _ref8.password, password = _ref8$password === void 0 ? null : _ref8$password, _ref8$captchaCode = _ref8.captchaCode, captchaCode = _ref8$captchaCode === void 0 ? null : _ref8$captchaCode, _ref8$extraParams = _ref8.extraParams, extraParams = _ref8$extraParams === void 0 ? {} : _ref8$extraParams, _ref8$sendCAevents = _ref8.sendCAevents, sendCAevents = _ref8$sendCAevents === void 0 ? false : _ref8$sendCAevents;
2185
+ _context5.prev = 1;
2071
2186
  captchaInfo = captchaCode ? {
2072
2187
  code: captchaCode,
2073
2188
  id: this.requiredCaptcha.captchaId
2074
2189
  } : null;
2075
- _context4.next = 5;
2190
+ _context5.next = 5;
2076
2191
  return this.attrs.meetingInfoProvider.fetchMeetingInfo(destination, destinationType, password, captchaInfo,
2077
2192
  // @ts-ignore - config coming from registerPlugin
2078
2193
  this.config.installedOrgID, this.locusId, extraParams, {
@@ -2080,86 +2195,72 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
2080
2195
  sendCAevents: sendCAevents
2081
2196
  });
2082
2197
  case 5:
2083
- info = _context4.sent;
2084
- this.parseMeetingInfo(info, this.destination);
2085
- this.meetingInfo = info ? _objectSpread(_objectSpread({}, info.body), {}, {
2086
- meetingLookupUrl: info === null || info === void 0 ? void 0 : info.url
2087
- }) : null;
2088
- this.meetingInfoFailureReason = _constants.MEETING_INFO_FAILURE_REASON.NONE;
2089
- this.requiredCaptcha = null;
2090
- if (this.passwordStatus === _constants.PASSWORD_STATUS.REQUIRED || this.passwordStatus === _constants.PASSWORD_STATUS.VERIFIED) {
2091
- this.passwordStatus = _constants.PASSWORD_STATUS.VERIFIED;
2092
- } else {
2093
- this.passwordStatus = _constants.PASSWORD_STATUS.NOT_REQUIRED;
2094
- }
2095
- _triggerProxy.default.trigger(this, {
2096
- file: 'meetings',
2097
- function: 'fetchMeetingInfo'
2098
- }, _constants.EVENT_TRIGGERS.MEETING_INFO_AVAILABLE);
2099
- this.updateMeetingActions();
2100
- return _context4.abrupt("return", _promise.default.resolve());
2101
- case 16:
2102
- _context4.prev = 16;
2103
- _context4.t0 = _context4["catch"](1);
2198
+ info = _context5.sent;
2199
+ this.parseMeetingInfo(info === null || info === void 0 ? void 0 : info.body, this.destination, info === null || info === void 0 ? void 0 : info.errors);
2200
+ this.setMeetingInfo(info === null || info === void 0 ? void 0 : info.body, info === null || info === void 0 ? void 0 : info.url);
2201
+ return _context5.abrupt("return", _promise.default.resolve());
2202
+ case 11:
2203
+ _context5.prev = 11;
2204
+ _context5.t0 = _context5["catch"](1);
2104
2205
  this.updateMeetingActions();
2105
- if (!(_context4.t0 instanceof _meetingInfoV.MeetingInfoV2PolicyError)) {
2106
- _context4.next = 26;
2206
+ if (!(_context5.t0 instanceof _meetingInfoV.MeetingInfoV2PolicyError)) {
2207
+ _context5.next = 21;
2107
2208
  break;
2108
2209
  }
2109
2210
  this.meetingInfoFailureReason = _constants.MEETING_INFO_FAILURE_REASON.POLICY;
2110
- this.meetingInfoFailureCode = _context4.t0.wbxAppApiCode;
2111
- if (_context4.t0.meetingInfo) {
2112
- this.meetingInfo = _context4.t0.meetingInfo;
2211
+ this.meetingInfoFailureCode = _context5.t0.wbxAppApiCode;
2212
+ if (_context5.t0.meetingInfo) {
2213
+ this.meetingInfo = _context5.t0.meetingInfo;
2113
2214
  }
2114
2215
  throw new _permission.default();
2115
- case 26:
2116
- if (!(_context4.t0 instanceof _meetingInfoV.MeetingInfoV2PasswordError)) {
2117
- _context4.next = 38;
2216
+ case 21:
2217
+ if (!(_context5.t0 instanceof _meetingInfoV.MeetingInfoV2PasswordError)) {
2218
+ _context5.next = 33;
2118
2219
  break;
2119
2220
  }
2120
2221
  _loggerProxy.default.logger.info( // @ts-ignore
2121
- "Meeting:index#fetchMeetingInfo --> Info Unable to fetch meeting info for ".concat(this.destination, " - password required (code=").concat(_context4.t0 === null || _context4.t0 === void 0 ? void 0 : (_err$body = _context4.t0.body) === null || _err$body === void 0 ? void 0 : _err$body.code, ")."));
2222
+ "Meeting:index#fetchMeetingInfo --> Info Unable to fetch meeting info for ".concat(this.destination, " - password required (code=").concat(_context5.t0 === null || _context5.t0 === void 0 ? void 0 : (_err$body = _context5.t0.body) === null || _err$body === void 0 ? void 0 : _err$body.code, ")."));
2122
2223
 
2123
2224
  // when wbxappapi requires password it still populates partial meeting info in the response
2124
- if (_context4.t0.meetingInfo) {
2125
- this.meetingInfo = _context4.t0.meetingInfo;
2126
- this.meetingNumber = _context4.t0.meetingInfo.meetingNumber;
2225
+ if (_context5.t0.meetingInfo) {
2226
+ this.meetingInfo = _context5.t0.meetingInfo;
2227
+ this.meetingNumber = _context5.t0.meetingInfo.meetingNumber;
2127
2228
  }
2128
- this.meetingInfoFailureCode = _context4.t0.wbxAppApiCode;
2229
+ this.meetingInfoFailureCode = _context5.t0.wbxAppApiCode;
2129
2230
  this.passwordStatus = _constants.PASSWORD_STATUS.REQUIRED;
2130
2231
  this.meetingInfoFailureReason = _constants.MEETING_INFO_FAILURE_REASON.WRONG_PASSWORD;
2131
2232
  if (!this.requiredCaptcha) {
2132
- _context4.next = 35;
2233
+ _context5.next = 30;
2133
2234
  break;
2134
2235
  }
2135
- _context4.next = 35;
2236
+ _context5.next = 30;
2136
2237
  return this.refreshCaptcha();
2137
- case 35:
2238
+ case 30:
2138
2239
  throw new _passwordError.default();
2139
- case 38:
2140
- if (!(_context4.t0 instanceof _meetingInfoV.MeetingInfoV2CaptchaError)) {
2141
- _context4.next = 47;
2240
+ case 33:
2241
+ if (!(_context5.t0 instanceof _meetingInfoV.MeetingInfoV2CaptchaError)) {
2242
+ _context5.next = 42;
2142
2243
  break;
2143
2244
  }
2144
2245
  _loggerProxy.default.logger.info( // @ts-ignore
2145
- "Meeting:index#fetchMeetingInfo --> Info Unable to fetch meeting info for ".concat(this.destination, " - captcha required (code=").concat(_context4.t0 === null || _context4.t0 === void 0 ? void 0 : (_err$body2 = _context4.t0.body) === null || _err$body2 === void 0 ? void 0 : _err$body2.code, ")."));
2246
+ "Meeting:index#fetchMeetingInfo --> Info Unable to fetch meeting info for ".concat(this.destination, " - captcha required (code=").concat(_context5.t0 === null || _context5.t0 === void 0 ? void 0 : (_err$body2 = _context5.t0.body) === null || _err$body2 === void 0 ? void 0 : _err$body2.code, ")."));
2146
2247
  this.meetingInfoFailureReason = this.requiredCaptcha ? _constants.MEETING_INFO_FAILURE_REASON.WRONG_CAPTCHA : _constants.MEETING_INFO_FAILURE_REASON.WRONG_PASSWORD;
2147
- this.meetingInfoFailureCode = _context4.t0.wbxAppApiCode;
2148
- if (_context4.t0.isPasswordRequired) {
2248
+ this.meetingInfoFailureCode = _context5.t0.wbxAppApiCode;
2249
+ if (_context5.t0.isPasswordRequired) {
2149
2250
  this.passwordStatus = _constants.PASSWORD_STATUS.REQUIRED;
2150
2251
  }
2151
- this.requiredCaptcha = _context4.t0.captchaInfo;
2252
+ this.requiredCaptcha = _context5.t0.captchaInfo;
2152
2253
  throw new _captchaError.default();
2153
- case 47:
2254
+ case 42:
2154
2255
  this.meetingInfoFailureReason = _constants.MEETING_INFO_FAILURE_REASON.OTHER;
2155
- throw _context4.t0;
2156
- case 49:
2256
+ throw _context5.t0;
2257
+ case 44:
2157
2258
  case "end":
2158
- return _context4.stop();
2259
+ return _context5.stop();
2159
2260
  }
2160
- }, _callee4, this, [[1, 16]]);
2261
+ }, _callee5, this, [[1, 11]]);
2161
2262
  }));
2162
- function fetchMeetingInfoInternal(_x2) {
2263
+ function fetchMeetingInfoInternal(_x5) {
2163
2264
  return _fetchMeetingInfoInternal.apply(this, arguments);
2164
2265
  }
2165
2266
  return fetchMeetingInfoInternal;
@@ -2174,18 +2275,18 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
2174
2275
  }, {
2175
2276
  key: "refreshPermissionToken",
2176
2277
  value: (function () {
2177
- var _refreshPermissionToken = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee5(reason) {
2278
+ var _refreshPermissionToken = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee6(reason) {
2178
2279
  var _this$meetingInfo;
2179
2280
  var isStartingSpaceInstantV2Meeting, destination, destinationType, permissionTokenExpiryInfo, timeLeft, expiryTime, currentTime;
2180
- return _regenerator.default.wrap(function _callee5$(_context5) {
2181
- while (1) switch (_context5.prev = _context5.next) {
2281
+ return _regenerator.default.wrap(function _callee6$(_context6) {
2282
+ while (1) switch (_context6.prev = _context6.next) {
2182
2283
  case 0:
2183
2284
  if ((_this$meetingInfo = this.meetingInfo) !== null && _this$meetingInfo !== void 0 && _this$meetingInfo.permissionToken) {
2184
- _context5.next = 3;
2285
+ _context6.next = 3;
2185
2286
  break;
2186
2287
  }
2187
2288
  _loggerProxy.default.logger.info("Meeting:index#refreshPermissionToken --> cannot refresh the permission token, because we don't have it (reason=".concat(reason, ")"));
2188
- return _context5.abrupt("return");
2289
+ return _context6.abrupt("return");
2189
2290
  case 3:
2190
2291
  isStartingSpaceInstantV2Meeting = this.destinationType === _constants._CONVERSATION_URL_ &&
2191
2292
  // @ts-ignore - config coming from registerPlugin
@@ -2207,8 +2308,8 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
2207
2308
  reason: reason,
2208
2309
  destinationType: destinationType
2209
2310
  });
2210
- _context5.prev = 12;
2211
- _context5.next = 15;
2311
+ _context6.prev = 12;
2312
+ _context6.next = 15;
2212
2313
  return this.fetchMeetingInfoInternal({
2213
2314
  destination: destination,
2214
2315
  destinationType: destinationType,
@@ -2218,25 +2319,25 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
2218
2319
  sendCAevents: true // because if we're refreshing the permissionToken, it means that user is intending to join that meeting, so we want CA events
2219
2320
  });
2220
2321
  case 15:
2221
- _context5.next = 22;
2322
+ _context6.next = 22;
2222
2323
  break;
2223
2324
  case 17:
2224
- _context5.prev = 17;
2225
- _context5.t0 = _context5["catch"](12);
2226
- _loggerProxy.default.logger.info('Meeting:index#refreshPermissionToken --> failed to refresh the permission token:', _context5.t0);
2325
+ _context6.prev = 17;
2326
+ _context6.t0 = _context6["catch"](12);
2327
+ _loggerProxy.default.logger.info('Meeting:index#refreshPermissionToken --> failed to refresh the permission token:', _context6.t0);
2227
2328
  _metrics.default.sendBehavioralMetric(_constants2.default.PERMISSION_TOKEN_REFRESH_ERROR, {
2228
2329
  correlationId: this.correlationId,
2229
- reason: _context5.t0.message,
2230
- stack: _context5.t0.stack
2330
+ reason: _context6.t0.message,
2331
+ stack: _context6.t0.stack
2231
2332
  });
2232
- throw _context5.t0;
2333
+ throw _context6.t0;
2233
2334
  case 22:
2234
2335
  case "end":
2235
- return _context5.stop();
2336
+ return _context6.stop();
2236
2337
  }
2237
- }, _callee5, this, [[12, 17]]);
2338
+ }, _callee6, this, [[12, 17]]);
2238
2339
  }));
2239
- function refreshPermissionToken(_x3) {
2340
+ function refreshPermissionToken(_x6) {
2240
2341
  return _refreshPermissionToken.apply(this, arguments);
2241
2342
  }
2242
2343
  return refreshPermissionToken;
@@ -2255,45 +2356,24 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
2255
2356
  }, {
2256
2357
  key: "fetchMeetingInfo",
2257
2358
  value: (function () {
2258
- var _fetchMeetingInfo = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee6(_ref8) {
2259
- var _ref8$password, password, _ref8$captchaCode, captchaCode, _ref8$extraParams, extraParams, _ref8$sendCAevents, sendCAevents;
2260
- return _regenerator.default.wrap(function _callee6$(_context6) {
2261
- while (1) switch (_context6.prev = _context6.next) {
2359
+ var _fetchMeetingInfo = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee7(options) {
2360
+ return _regenerator.default.wrap(function _callee7$(_context7) {
2361
+ while (1) switch (_context7.prev = _context7.next) {
2262
2362
  case 0:
2263
- _ref8$password = _ref8.password, password = _ref8$password === void 0 ? null : _ref8$password, _ref8$captchaCode = _ref8.captchaCode, captchaCode = _ref8$captchaCode === void 0 ? null : _ref8$captchaCode, _ref8$extraParams = _ref8.extraParams, extraParams = _ref8$extraParams === void 0 ? {} : _ref8$extraParams, _ref8$sendCAevents = _ref8.sendCAevents, sendCAevents = _ref8$sendCAevents === void 0 ? false : _ref8$sendCAevents;
2264
- // when fetch meeting info is called directly by the client, we want to clear out the random timer for sdk to do it
2265
- if (this.fetchMeetingInfoTimeoutId) {
2266
- clearTimeout(this.fetchMeetingInfoTimeoutId);
2267
- this.fetchMeetingInfoTimeoutId = undefined;
2268
- }
2269
- if (!(captchaCode && !this.requiredCaptcha)) {
2270
- _context6.next = 4;
2271
- break;
2272
- }
2273
- return _context6.abrupt("return", _promise.default.reject(new Error('fetchMeetingInfo() called with captchaCode when captcha was not required')));
2274
- case 4:
2275
- if (!(password && this.passwordStatus !== _constants.PASSWORD_STATUS.REQUIRED && this.passwordStatus !== _constants.PASSWORD_STATUS.UNKNOWN)) {
2276
- _context6.next = 6;
2277
- break;
2278
- }
2279
- return _context6.abrupt("return", _promise.default.reject(new Error('fetchMeetingInfo() called with password when password was not required')));
2280
- case 6:
2281
- this.meetingInfoExtraParams = (0, _lodash.cloneDeep)(extraParams);
2282
- return _context6.abrupt("return", this.fetchMeetingInfoInternal({
2363
+ _context7.next = 2;
2364
+ return this.prepForFetchMeetingInfo(options, 'fetchMeetingInfo');
2365
+ case 2:
2366
+ return _context7.abrupt("return", this.fetchMeetingInfoInternal(_objectSpread({
2283
2367
  destination: this.destination,
2284
- destinationType: this.destinationType,
2285
- password: password,
2286
- captchaCode: captchaCode,
2287
- extraParams: extraParams,
2288
- sendCAevents: sendCAevents
2289
- }));
2290
- case 8:
2368
+ destinationType: this.destinationType
2369
+ }, options)));
2370
+ case 3:
2291
2371
  case "end":
2292
- return _context6.stop();
2372
+ return _context7.stop();
2293
2373
  }
2294
- }, _callee6, this);
2374
+ }, _callee7, this);
2295
2375
  }));
2296
- function fetchMeetingInfo(_x4) {
2376
+ function fetchMeetingInfo(_x7) {
2297
2377
  return _fetchMeetingInfo.apply(this, arguments);
2298
2378
  }
2299
2379
  return fetchMeetingInfo;
@@ -2510,6 +2590,9 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
2510
2590
  }, {
2511
2591
  key: "setUpVoiceaListeners",
2512
2592
  value: function setUpVoiceaListeners() {
2593
+ // @ts-ignore
2594
+ this.webex.internal.voicea.listenToEvents();
2595
+
2513
2596
  // @ts-ignore
2514
2597
  this.webex.internal.voicea.on(_internalPluginVoicea.EVENT_TRIGGERS.VOICEA_ANNOUNCEMENT, this.voiceaListenerCallbacks[_internalPluginVoicea.EVENT_TRIGGERS.VOICEA_ANNOUNCEMENT]);
2515
2598
 
@@ -2524,6 +2607,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
2524
2607
 
2525
2608
  // @ts-ignore
2526
2609
  this.webex.internal.voicea.on(_internalPluginVoicea.EVENT_TRIGGERS.HIGHLIGHT_CREATED, this.voiceaListenerCallbacks[_internalPluginVoicea.EVENT_TRIGGERS.HIGHLIGHT_CREATED]);
2610
+ this.areVoiceaEventsSetup = true;
2527
2611
  }
2528
2612
 
2529
2613
  /**
@@ -2846,18 +2930,8 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
2846
2930
  function: 'setupLocusControlsListener'
2847
2931
  }, _constants.EVENT_TRIGGERS.MEETING_INTERPRETATION_UPDATE);
2848
2932
  });
2849
- this.locusInfo.on(_constants.LOCUSINFO.EVENTS.CONTROLS_JOIN_BREAKOUT_FROM_MAIN, function (_ref14) {
2850
- var mainLocusUrl = _ref14.mainLocusUrl;
2851
- _this13.meetingRequest.getLocusStatusByUrl(mainLocusUrl).catch(function (error) {
2852
- // clear main session cache when attendee join into breakout and forbidden to get locus from main locus url,
2853
- // which means main session is not active for the attendee
2854
- if ((error === null || error === void 0 ? void 0 : error.statusCode) === 403) {
2855
- _this13.locusInfo.clearMainSessionLocusCache();
2856
- }
2857
- });
2858
- });
2859
- this.locusInfo.on(_constants.LOCUSINFO.EVENTS.CONTROLS_ENTRY_EXIT_TONE_UPDATED, function (_ref15) {
2860
- var entryExitTone = _ref15.entryExitTone;
2933
+ this.locusInfo.on(_constants.LOCUSINFO.EVENTS.CONTROLS_ENTRY_EXIT_TONE_UPDATED, function (_ref14) {
2934
+ var entryExitTone = _ref14.entryExitTone;
2861
2935
  _triggerProxy.default.trigger(_this13, {
2862
2936
  file: 'meeting/index',
2863
2937
  function: 'setupLocusControlsListener'
@@ -2865,8 +2939,8 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
2865
2939
  entryExitTone: entryExitTone
2866
2940
  });
2867
2941
  });
2868
- this.locusInfo.on(_constants.LOCUSINFO.EVENTS.CONTROLS_MUTE_ON_ENTRY_CHANGED, function (_ref16) {
2869
- var state = _ref16.state;
2942
+ this.locusInfo.on(_constants.LOCUSINFO.EVENTS.CONTROLS_MUTE_ON_ENTRY_CHANGED, function (_ref15) {
2943
+ var state = _ref15.state;
2870
2944
  _triggerProxy.default.trigger(_this13, {
2871
2945
  file: 'meeting/index',
2872
2946
  function: 'setupLocusControlsListener'
@@ -2874,8 +2948,8 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
2874
2948
  state: state
2875
2949
  });
2876
2950
  });
2877
- this.locusInfo.on(_constants.LOCUSINFO.EVENTS.CONTROLS_SHARE_CONTROL_CHANGED, function (_ref17) {
2878
- var state = _ref17.state;
2951
+ this.locusInfo.on(_constants.LOCUSINFO.EVENTS.CONTROLS_SHARE_CONTROL_CHANGED, function (_ref16) {
2952
+ var state = _ref16.state;
2879
2953
  _triggerProxy.default.trigger(_this13, {
2880
2954
  file: 'meeting/index',
2881
2955
  function: 'setupLocusControlsListener'
@@ -2883,8 +2957,8 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
2883
2957
  state: state
2884
2958
  });
2885
2959
  });
2886
- this.locusInfo.on(_constants.LOCUSINFO.EVENTS.CONTROLS_DISALLOW_UNMUTE_CHANGED, function (_ref18) {
2887
- var state = _ref18.state;
2960
+ this.locusInfo.on(_constants.LOCUSINFO.EVENTS.CONTROLS_DISALLOW_UNMUTE_CHANGED, function (_ref17) {
2961
+ var state = _ref17.state;
2888
2962
  _triggerProxy.default.trigger(_this13, {
2889
2963
  file: 'meeting/index',
2890
2964
  function: 'setupLocusControlsListener'
@@ -2892,8 +2966,8 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
2892
2966
  state: state
2893
2967
  });
2894
2968
  });
2895
- this.locusInfo.on(_constants.LOCUSINFO.EVENTS.CONTROLS_REACTIONS_CHANGED, function (_ref19) {
2896
- var state = _ref19.state;
2969
+ this.locusInfo.on(_constants.LOCUSINFO.EVENTS.CONTROLS_REACTIONS_CHANGED, function (_ref18) {
2970
+ var state = _ref18.state;
2897
2971
  _triggerProxy.default.trigger(_this13, {
2898
2972
  file: 'meeting/index',
2899
2973
  function: 'setupLocusControlsListener'
@@ -2901,8 +2975,8 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
2901
2975
  state: state
2902
2976
  });
2903
2977
  });
2904
- this.locusInfo.on(_constants.LOCUSINFO.EVENTS.CONTROLS_VIEW_THE_PARTICIPANTS_LIST_CHANGED, function (_ref20) {
2905
- var state = _ref20.state;
2978
+ this.locusInfo.on(_constants.LOCUSINFO.EVENTS.CONTROLS_VIEW_THE_PARTICIPANTS_LIST_CHANGED, function (_ref19) {
2979
+ var state = _ref19.state;
2906
2980
  _triggerProxy.default.trigger(_this13, {
2907
2981
  file: 'meeting/index',
2908
2982
  function: 'setupLocusControlsListener'
@@ -2910,8 +2984,8 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
2910
2984
  state: state
2911
2985
  });
2912
2986
  });
2913
- this.locusInfo.on(_constants.LOCUSINFO.EVENTS.CONTROLS_RAISE_HAND_CHANGED, function (_ref21) {
2914
- var state = _ref21.state;
2987
+ this.locusInfo.on(_constants.LOCUSINFO.EVENTS.CONTROLS_RAISE_HAND_CHANGED, function (_ref20) {
2988
+ var state = _ref20.state;
2915
2989
  _triggerProxy.default.trigger(_this13, {
2916
2990
  file: 'meeting/index',
2917
2991
  function: 'setupLocusControlsListener'
@@ -2919,8 +2993,8 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
2919
2993
  state: state
2920
2994
  });
2921
2995
  });
2922
- this.locusInfo.on(_constants.LOCUSINFO.EVENTS.CONTROLS_VIDEO_CHANGED, function (_ref22) {
2923
- var state = _ref22.state;
2996
+ this.locusInfo.on(_constants.LOCUSINFO.EVENTS.CONTROLS_VIDEO_CHANGED, function (_ref21) {
2997
+ var state = _ref21.state;
2924
2998
  _triggerProxy.default.trigger(_this13, {
2925
2999
  file: 'meeting/index',
2926
3000
  function: 'setupLocusControlsListener'
@@ -2966,21 +3040,21 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
2966
3040
  var _this14 = this;
2967
3041
  // Will get triggered on local and remote share
2968
3042
  this.locusInfo.on(_constants.EVENTS.LOCUS_INFO_UPDATE_MEDIA_SHARES, /*#__PURE__*/function () {
2969
- var _ref23 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee7(payload) {
3043
+ var _ref22 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee8(payload) {
2970
3044
  var _payload$previous, _payload$previous2;
2971
3045
  var _payload$current, contentShare, whiteboardShare, previousContentShare, previousWhiteboardShare, newShareStatus, oldShareStatus, sendStartedSharingRemote, _this14$mediaProperti;
2972
- return _regenerator.default.wrap(function _callee7$(_context7) {
2973
- while (1) switch (_context7.prev = _context7.next) {
3046
+ return _regenerator.default.wrap(function _callee8$(_context8) {
3047
+ while (1) switch (_context8.prev = _context8.next) {
2974
3048
  case 0:
2975
3049
  _payload$current = payload.current, contentShare = _payload$current.content, whiteboardShare = _payload$current.whiteboard;
2976
3050
  previousContentShare = (_payload$previous = payload.previous) === null || _payload$previous === void 0 ? void 0 : _payload$previous.content;
2977
3051
  previousWhiteboardShare = (_payload$previous2 = payload.previous) === null || _payload$previous2 === void 0 ? void 0 : _payload$previous2.whiteboard;
2978
3052
  _this14.triggerAnnotationInfoEvent(contentShare, previousContentShare);
2979
3053
  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))) {
2980
- _context7.next = 6;
3054
+ _context8.next = 6;
2981
3055
  break;
2982
3056
  }
2983
- return _context7.abrupt("return");
3057
+ return _context8.abrupt("return");
2984
3058
  case 6:
2985
3059
  newShareStatus = _this14.shareStatus; // REMOTE - check if remote started sharing
2986
3060
  if (_this14.selfId !== contentShare.beneficiaryId && contentShare.disposition === _constants.FLOOR_ACTION.GRANTED) {
@@ -3009,22 +3083,22 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
3009
3083
  newShareStatus = _constants.SHARE_STATUS.NO_SHARE;
3010
3084
  }
3011
3085
  if (!(newShareStatus !== _this14.shareStatus)) {
3012
- _context7.next = 45;
3086
+ _context8.next = 45;
3013
3087
  break;
3014
3088
  }
3015
3089
  oldShareStatus = _this14.shareStatus; // update our state before we send out any notifications
3016
3090
  _this14.shareStatus = newShareStatus;
3017
3091
 
3018
3092
  // send out "stop" notifications for the old state
3019
- _context7.t0 = oldShareStatus;
3020
- _context7.next = _context7.t0 === _constants.SHARE_STATUS.REMOTE_SHARE_ACTIVE ? 14 : _context7.t0 === _constants.SHARE_STATUS.LOCAL_SHARE_ACTIVE ? 16 : _context7.t0 === _constants.SHARE_STATUS.WHITEBOARD_SHARE_ACTIVE ? 18 : _context7.t0 === _constants.SHARE_STATUS.NO_SHARE ? 20 : 21;
3093
+ _context8.t0 = oldShareStatus;
3094
+ _context8.next = _context8.t0 === _constants.SHARE_STATUS.REMOTE_SHARE_ACTIVE ? 14 : _context8.t0 === _constants.SHARE_STATUS.LOCAL_SHARE_ACTIVE ? 16 : _context8.t0 === _constants.SHARE_STATUS.WHITEBOARD_SHARE_ACTIVE ? 18 : _context8.t0 === _constants.SHARE_STATUS.NO_SHARE ? 20 : 21;
3021
3095
  break;
3022
3096
  case 14:
3023
3097
  _triggerProxy.default.trigger(_this14, {
3024
3098
  file: 'meetings/index',
3025
3099
  function: 'remoteShare'
3026
3100
  }, _constants.EVENT_TRIGGERS.MEETING_STOPPED_SHARING_REMOTE);
3027
- return _context7.abrupt("break", 22);
3101
+ return _context8.abrupt("break", 22);
3028
3102
  case 16:
3029
3103
  _triggerProxy.default.trigger(_this14, {
3030
3104
  file: 'meeting/index',
@@ -3032,46 +3106,47 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
3032
3106
  }, _constants.EVENT_TRIGGERS.MEETING_STOPPED_SHARING_LOCAL, {
3033
3107
  reason: _constants.SHARE_STOPPED_REASON.SELF_STOPPED
3034
3108
  });
3035
- return _context7.abrupt("break", 22);
3109
+ return _context8.abrupt("break", 22);
3036
3110
  case 18:
3037
3111
  _triggerProxy.default.trigger(_this14, {
3038
3112
  file: 'meeting/index',
3039
3113
  function: 'stopWhiteboardShare'
3040
3114
  }, _constants.EVENT_TRIGGERS.MEETING_STOPPED_SHARING_WHITEBOARD);
3041
- return _context7.abrupt("break", 22);
3115
+ return _context8.abrupt("break", 22);
3042
3116
  case 20:
3043
- return _context7.abrupt("break", 22);
3117
+ return _context8.abrupt("break", 22);
3044
3118
  case 21:
3045
- return _context7.abrupt("break", 22);
3119
+ return _context8.abrupt("break", 22);
3046
3120
  case 22:
3047
- _context7.t1 = newShareStatus;
3048
- _context7.next = _context7.t1 === _constants.SHARE_STATUS.REMOTE_SHARE_ACTIVE ? 25 : _context7.t1 === _constants.SHARE_STATUS.LOCAL_SHARE_ACTIVE ? 34 : _context7.t1 === _constants.SHARE_STATUS.WHITEBOARD_SHARE_ACTIVE ? 37 : _context7.t1 === _constants.SHARE_STATUS.NO_SHARE ? 40 : 41;
3121
+ _context8.t1 = newShareStatus;
3122
+ _context8.next = _context8.t1 === _constants.SHARE_STATUS.REMOTE_SHARE_ACTIVE ? 25 : _context8.t1 === _constants.SHARE_STATUS.LOCAL_SHARE_ACTIVE ? 34 : _context8.t1 === _constants.SHARE_STATUS.WHITEBOARD_SHARE_ACTIVE ? 37 : _context8.t1 === _constants.SHARE_STATUS.NO_SHARE ? 40 : 41;
3049
3123
  break;
3050
3124
  case 25:
3051
3125
  sendStartedSharingRemote = function sendStartedSharingRemote() {
3126
+ _this14.remoteShareInstanceId = contentShare.shareInstanceId;
3052
3127
  _triggerProxy.default.trigger(_this14, {
3053
3128
  file: 'meetings/index',
3054
3129
  function: 'remoteShare'
3055
3130
  }, _constants.EVENT_TRIGGERS.MEETING_STARTED_SHARING_REMOTE, {
3056
3131
  memberId: contentShare.beneficiaryId,
3057
3132
  url: contentShare.url,
3058
- shareInstanceId: contentShare.shareInstanceId,
3133
+ shareInstanceId: _this14.remoteShareInstanceId,
3059
3134
  annotationInfo: contentShare.annotation
3060
3135
  });
3061
3136
  };
3062
- _context7.prev = 26;
3137
+ _context8.prev = 26;
3063
3138
  if (!((_this14$mediaProperti = _this14.mediaProperties.mediaDirection) !== null && _this14$mediaProperti !== void 0 && _this14$mediaProperti.sendShare && oldShareStatus === _constants.SHARE_STATUS.LOCAL_SHARE_ACTIVE)) {
3064
- _context7.next = 30;
3139
+ _context8.next = 30;
3065
3140
  break;
3066
3141
  }
3067
- _context7.next = 30;
3142
+ _context8.next = 30;
3068
3143
  return _this14.unpublishStreams([_this14.mediaProperties.shareVideoStream, _this14.mediaProperties.shareAudioStream]);
3069
3144
  case 30:
3070
- _context7.prev = 30;
3145
+ _context8.prev = 30;
3071
3146
  sendStartedSharingRemote();
3072
- return _context7.finish(30);
3147
+ return _context8.finish(30);
3073
3148
  case 33:
3074
- return _context7.abrupt("break", 42);
3149
+ return _context8.abrupt("break", 42);
3075
3150
  case 34:
3076
3151
  _triggerProxy.default.trigger(_this14, {
3077
3152
  file: 'meeting/index',
@@ -3081,13 +3156,14 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
3081
3156
  _this14.webex.internal.newMetrics.submitClientEvent({
3082
3157
  name: 'client.share.floor-granted.local',
3083
3158
  payload: {
3084
- mediaType: 'share'
3159
+ mediaType: 'share',
3160
+ shareInstanceId: _this14.localShareInstanceId
3085
3161
  },
3086
3162
  options: {
3087
3163
  meetingId: _this14.id
3088
3164
  }
3089
3165
  });
3090
- return _context7.abrupt("break", 42);
3166
+ return _context8.abrupt("break", 42);
3091
3167
  case 37:
3092
3168
  _triggerProxy.default.trigger(_this14, {
3093
3169
  file: 'meeting/index',
@@ -3106,26 +3182,27 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
3106
3182
  meetingId: _this14.id
3107
3183
  }
3108
3184
  });
3109
- return _context7.abrupt("break", 42);
3185
+ return _context8.abrupt("break", 42);
3110
3186
  case 40:
3111
- return _context7.abrupt("break", 42);
3187
+ return _context8.abrupt("break", 42);
3112
3188
  case 41:
3113
- return _context7.abrupt("break", 42);
3189
+ return _context8.abrupt("break", 42);
3114
3190
  case 42:
3115
3191
  _this14.members.locusMediaSharesUpdate(payload);
3116
- _context7.next = 46;
3192
+ _context8.next = 46;
3117
3193
  break;
3118
3194
  case 45:
3119
3195
  if (newShareStatus === _constants.SHARE_STATUS.REMOTE_SHARE_ACTIVE) {
3120
3196
  // if we got here, then some remote participant has stolen
3121
3197
  // the presentation from another remote participant
3198
+ _this14.remoteShareInstanceId = contentShare.shareInstanceId;
3122
3199
  _triggerProxy.default.trigger(_this14, {
3123
3200
  file: 'meetings/index',
3124
3201
  function: 'remoteShare'
3125
3202
  }, _constants.EVENT_TRIGGERS.MEETING_STARTED_SHARING_REMOTE, {
3126
3203
  memberId: contentShare.beneficiaryId,
3127
3204
  url: contentShare.url,
3128
- shareInstanceId: contentShare.shareInstanceId,
3205
+ shareInstanceId: _this14.remoteShareInstanceId,
3129
3206
  annotationInfo: contentShare.annotation
3130
3207
  });
3131
3208
  _this14.members.locusMediaSharesUpdate(payload);
@@ -3153,12 +3230,12 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
3153
3230
  }
3154
3231
  case 46:
3155
3232
  case "end":
3156
- return _context7.stop();
3233
+ return _context8.stop();
3157
3234
  }
3158
- }, _callee7, null, [[26,, 30, 33]]);
3235
+ }, _callee8, null, [[26,, 30, 33]]);
3159
3236
  }));
3160
- return function (_x5) {
3161
- return _ref23.apply(this, arguments);
3237
+ return function (_x8) {
3238
+ return _ref22.apply(this, arguments);
3162
3239
  };
3163
3240
  }());
3164
3241
  }
@@ -3376,9 +3453,9 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
3376
3453
  }
3377
3454
  });
3378
3455
  this.locusInfo.on(_constants.LOCUSINFO.EVENTS.SELF_ADMITTED_GUEST, /*#__PURE__*/function () {
3379
- var _ref24 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee8(payload) {
3380
- return _regenerator.default.wrap(function _callee8$(_context8) {
3381
- while (1) switch (_context8.prev = _context8.next) {
3456
+ var _ref23 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee9(payload) {
3457
+ return _regenerator.default.wrap(function _callee9$(_context9) {
3458
+ while (1) switch (_context9.prev = _context9.next) {
3382
3459
  case 0:
3383
3460
  _this19.stopKeepAlive();
3384
3461
  if (payload) {
@@ -3399,12 +3476,12 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
3399
3476
  }
3400
3477
  case 2:
3401
3478
  case "end":
3402
- return _context8.stop();
3479
+ return _context9.stop();
3403
3480
  }
3404
- }, _callee8);
3481
+ }, _callee9);
3405
3482
  }));
3406
- return function (_x6) {
3407
- return _ref24.apply(this, arguments);
3483
+ return function (_x9) {
3484
+ return _ref23.apply(this, arguments);
3408
3485
  };
3409
3486
  }());
3410
3487
 
@@ -3506,48 +3583,48 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
3506
3583
  }
3507
3584
  });
3508
3585
  this.locusInfo.on(_constants.EVENTS.DESTROY_MEETING, /*#__PURE__*/function () {
3509
- var _ref25 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee9(payload) {
3510
- return _regenerator.default.wrap(function _callee9$(_context9) {
3511
- while (1) switch (_context9.prev = _context9.next) {
3586
+ var _ref24 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee10(payload) {
3587
+ return _regenerator.default.wrap(function _callee10$(_context10) {
3588
+ while (1) switch (_context10.prev = _context10.next) {
3512
3589
  case 0:
3513
3590
  if (!_this20.wirelessShare) {
3514
- _context9.next = 7;
3591
+ _context10.next = 7;
3515
3592
  break;
3516
3593
  }
3517
3594
  if (!_this20.mediaProperties.shareVideoStream) {
3518
- _context9.next = 4;
3595
+ _context10.next = 4;
3519
3596
  break;
3520
3597
  }
3521
- _context9.next = 4;
3598
+ _context10.next = 4;
3522
3599
  return _this20.setLocalShareVideoStream(undefined);
3523
3600
  case 4:
3524
3601
  if (!_this20.mediaProperties.shareAudioStream) {
3525
- _context9.next = 7;
3602
+ _context10.next = 7;
3526
3603
  break;
3527
3604
  }
3528
- _context9.next = 7;
3605
+ _context10.next = 7;
3529
3606
  return _this20.setLocalShareAudioStream(undefined);
3530
3607
  case 7:
3531
3608
  if (!payload.shouldLeave) {
3532
- _context9.next = 19;
3609
+ _context10.next = 19;
3533
3610
  break;
3534
3611
  }
3535
- _context9.prev = 8;
3536
- _context9.next = 11;
3612
+ _context10.prev = 8;
3613
+ _context10.next = 11;
3537
3614
  return _this20.leave({
3538
3615
  reason: payload.reason
3539
3616
  });
3540
3617
  case 11:
3541
3618
  _loggerProxy.default.logger.warn('Meeting:index#setUpLocusInfoMeetingListener --> DESTROY_MEETING. The meeting has been left, but has not been destroyed, you should see a later event for leave.');
3542
- _context9.next = 17;
3619
+ _context10.next = 17;
3543
3620
  break;
3544
3621
  case 14:
3545
- _context9.prev = 14;
3546
- _context9.t0 = _context9["catch"](8);
3622
+ _context10.prev = 14;
3623
+ _context10.t0 = _context10["catch"](8);
3547
3624
  // @ts-ignore
3548
- _loggerProxy.default.logger.error("Meeting:index#setUpLocusInfoMeetingListener --> DESTROY_MEETING. Issue with leave for meeting, meeting still in collection: ".concat(_this20, ", error: ").concat(_context9.t0));
3625
+ _loggerProxy.default.logger.error("Meeting:index#setUpLocusInfoMeetingListener --> DESTROY_MEETING. Issue with leave for meeting, meeting still in collection: ".concat(_this20, ", error: ").concat(_context10.t0));
3549
3626
  case 17:
3550
- _context9.next = 22;
3627
+ _context10.next = 22;
3551
3628
  break;
3552
3629
  case 19:
3553
3630
  _loggerProxy.default.logger.info('Meeting:index#setUpLocusInfoMeetingListener --> MEETING_REMOVED_REASON', payload.reason);
@@ -3561,12 +3638,12 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
3561
3638
  });
3562
3639
  case 22:
3563
3640
  case "end":
3564
- return _context9.stop();
3641
+ return _context10.stop();
3565
3642
  }
3566
- }, _callee9, null, [[8, 14]]);
3643
+ }, _callee10, null, [[8, 14]]);
3567
3644
  }));
3568
- return function (_x7) {
3569
- return _ref25.apply(this, arguments);
3645
+ return function (_x10) {
3646
+ return _ref24.apply(this, arguments);
3570
3647
  };
3571
3648
  }());
3572
3649
  }
@@ -3715,12 +3792,19 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
3715
3792
  /**
3716
3793
  * Sets the meeting info on the class instance
3717
3794
  * @param {Object} meetingInfo
3718
- * @param {Object} meetingInfo.body
3719
- * @param {String} meetingInfo.body.conversationUrl
3720
- * @param {String} meetingInfo.body.locusUrl
3721
- * @param {String} meetingInfo.body.sipUri
3722
- * @param {Object} meetingInfo.body.owner
3795
+ * @param {String} meetingInfo.conversationUrl
3796
+ * @param {String} meetingInfo.locusUrl
3797
+ * @param {String} meetingInfo.sipUri
3798
+ * @param {String} [meetingInfo.sipUrl]
3799
+ * @param {String} [meetingInfo.sipMeetingUri]
3800
+ * @param {String} [meetingInfo.meetingNumber]
3801
+ * @param {String} [meetingInfo.meetingJoinUrl]
3802
+ * @param {String} [meetingInfo.hostId]
3803
+ * @param {String} [meetingInfo.permissionToken]
3804
+ * @param {String} [meetingInfo.channel]
3805
+ * @param {Object} meetingInfo.owner
3723
3806
  * @param {Object | String} destination locus object with meeting data or destination string (sip url, meeting link, etc)
3807
+ * @param {Object | String} errors Meeting info request error
3724
3808
  * @returns {undefined}
3725
3809
  * @private
3726
3810
  * @memberof Meeting
@@ -3729,7 +3813,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
3729
3813
  key: "parseMeetingInfo",
3730
3814
  value: function parseMeetingInfo(meetingInfo) {
3731
3815
  var destination = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
3732
- var webexMeetingInfo = meetingInfo === null || meetingInfo === void 0 ? void 0 : meetingInfo.body;
3816
+ var errors = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : undefined;
3733
3817
  // We try to use as much info from Locus meeting object, stored in destination
3734
3818
 
3735
3819
  var locusMeetingObject;
@@ -3738,28 +3822,28 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
3738
3822
  }
3739
3823
 
3740
3824
  // MeetingInfo will be undefined for 1:1 calls
3741
- if (locusMeetingObject || webexMeetingInfo && !(meetingInfo !== null && meetingInfo !== void 0 && meetingInfo.errors && (meetingInfo === null || meetingInfo === void 0 ? void 0 : meetingInfo.errors.length) > 0)) {
3825
+ if (locusMeetingObject || meetingInfo && !((errors === null || errors === void 0 ? void 0 : errors.length) > 0)) {
3742
3826
  var _locusMeetingObject, _locusMeetingObject2, _locusMeetingObject3, _locusMeetingObject4, _locusMeetingObject6, _locusMeetingObject7;
3743
- this.conversationUrl = ((_locusMeetingObject = locusMeetingObject) === null || _locusMeetingObject === void 0 ? void 0 : _locusMeetingObject.conversationUrl) || (webexMeetingInfo === null || webexMeetingInfo === void 0 ? void 0 : webexMeetingInfo.conversationUrl) || this.conversationUrl;
3744
- this.locusUrl = ((_locusMeetingObject2 = locusMeetingObject) === null || _locusMeetingObject2 === void 0 ? void 0 : _locusMeetingObject2.url) || (webexMeetingInfo === null || webexMeetingInfo === void 0 ? void 0 : webexMeetingInfo.locusUrl) || this.locusUrl;
3827
+ this.conversationUrl = ((_locusMeetingObject = locusMeetingObject) === null || _locusMeetingObject === void 0 ? void 0 : _locusMeetingObject.conversationUrl) || (meetingInfo === null || meetingInfo === void 0 ? void 0 : meetingInfo.conversationUrl) || this.conversationUrl;
3828
+ this.locusUrl = ((_locusMeetingObject2 = locusMeetingObject) === null || _locusMeetingObject2 === void 0 ? void 0 : _locusMeetingObject2.url) || (meetingInfo === null || meetingInfo === void 0 ? void 0 : meetingInfo.locusUrl) || this.locusUrl;
3745
3829
  // @ts-ignore - config coming from registerPlugin
3746
3830
  this.setSipUri(
3747
3831
  // @ts-ignore
3748
- this.config.experimental.enableUnifiedMeetings ? ((_locusMeetingObject3 = locusMeetingObject) === null || _locusMeetingObject3 === void 0 ? void 0 : _locusMeetingObject3.info.sipUri) || (webexMeetingInfo === null || webexMeetingInfo === void 0 ? void 0 : webexMeetingInfo.sipUrl) : ((_locusMeetingObject4 = locusMeetingObject) === null || _locusMeetingObject4 === void 0 ? void 0 : _locusMeetingObject4.info.sipUri) || (webexMeetingInfo === null || webexMeetingInfo === void 0 ? void 0 : webexMeetingInfo.sipMeetingUri) || this.sipUri);
3832
+ this.config.experimental.enableUnifiedMeetings ? ((_locusMeetingObject3 = locusMeetingObject) === null || _locusMeetingObject3 === void 0 ? void 0 : _locusMeetingObject3.info.sipUri) || (meetingInfo === null || meetingInfo === void 0 ? void 0 : meetingInfo.sipUrl) : ((_locusMeetingObject4 = locusMeetingObject) === null || _locusMeetingObject4 === void 0 ? void 0 : _locusMeetingObject4.info.sipUri) || (meetingInfo === null || meetingInfo === void 0 ? void 0 : meetingInfo.sipMeetingUri) || this.sipUri);
3749
3833
  // @ts-ignore - config coming from registerPlugin
3750
3834
  if (this.config.experimental.enableUnifiedMeetings) {
3751
3835
  var _locusMeetingObject5;
3752
- this.meetingNumber = ((_locusMeetingObject5 = locusMeetingObject) === null || _locusMeetingObject5 === void 0 ? void 0 : _locusMeetingObject5.info.webExMeetingId) || (webexMeetingInfo === null || webexMeetingInfo === void 0 ? void 0 : webexMeetingInfo.meetingNumber);
3753
- this.meetingJoinUrl = webexMeetingInfo === null || webexMeetingInfo === void 0 ? void 0 : webexMeetingInfo.meetingJoinUrl;
3836
+ this.meetingNumber = ((_locusMeetingObject5 = locusMeetingObject) === null || _locusMeetingObject5 === void 0 ? void 0 : _locusMeetingObject5.info.webExMeetingId) || (meetingInfo === null || meetingInfo === void 0 ? void 0 : meetingInfo.meetingNumber);
3837
+ this.meetingJoinUrl = meetingInfo === null || meetingInfo === void 0 ? void 0 : meetingInfo.meetingJoinUrl;
3754
3838
  }
3755
- this.owner = ((_locusMeetingObject6 = locusMeetingObject) === null || _locusMeetingObject6 === void 0 ? void 0 : _locusMeetingObject6.info.owner) || (webexMeetingInfo === null || webexMeetingInfo === void 0 ? void 0 : webexMeetingInfo.owner) || (webexMeetingInfo === null || webexMeetingInfo === void 0 ? void 0 : webexMeetingInfo.hostId) || this.owner;
3756
- this.permissionToken = webexMeetingInfo === null || webexMeetingInfo === void 0 ? void 0 : webexMeetingInfo.permissionToken;
3757
- this.setPermissionTokenPayload(webexMeetingInfo === null || webexMeetingInfo === void 0 ? void 0 : webexMeetingInfo.permissionToken);
3839
+ this.owner = ((_locusMeetingObject6 = locusMeetingObject) === null || _locusMeetingObject6 === void 0 ? void 0 : _locusMeetingObject6.info.owner) || (meetingInfo === null || meetingInfo === void 0 ? void 0 : meetingInfo.owner) || (meetingInfo === null || meetingInfo === void 0 ? void 0 : meetingInfo.hostId) || this.owner;
3840
+ this.permissionToken = meetingInfo === null || meetingInfo === void 0 ? void 0 : meetingInfo.permissionToken;
3841
+ this.setPermissionTokenPayload(meetingInfo === null || meetingInfo === void 0 ? void 0 : meetingInfo.permissionToken);
3758
3842
  this.setSelfUserPolicies();
3759
3843
  // Need to populate environment when sending CA event
3760
- this.environment = ((_locusMeetingObject7 = locusMeetingObject) === null || _locusMeetingObject7 === void 0 ? void 0 : _locusMeetingObject7.info.channel) || (webexMeetingInfo === null || webexMeetingInfo === void 0 ? void 0 : webexMeetingInfo.channel);
3844
+ this.environment = ((_locusMeetingObject7 = locusMeetingObject) === null || _locusMeetingObject7 === void 0 ? void 0 : _locusMeetingObject7.info.channel) || (meetingInfo === null || meetingInfo === void 0 ? void 0 : meetingInfo.channel);
3761
3845
  }
3762
- _util.default.parseInterpretationInfo(this, webexMeetingInfo);
3846
+ _util.default.parseInterpretationInfo(this, meetingInfo);
3763
3847
  }
3764
3848
 
3765
3849
  /**
@@ -4144,10 +4228,10 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
4144
4228
  }, {
4145
4229
  key: "setLocalAudioStream",
4146
4230
  value: (function () {
4147
- var _setLocalAudioStream = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee10(localStream) {
4231
+ var _setLocalAudioStream = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee11(localStream) {
4148
4232
  var oldStream;
4149
- return _regenerator.default.wrap(function _callee10$(_context10) {
4150
- while (1) switch (_context10.prev = _context10.next) {
4233
+ return _regenerator.default.wrap(function _callee11$(_context11) {
4234
+ while (1) switch (_context11.prev = _context11.next) {
4151
4235
  case 0:
4152
4236
  oldStream = this.mediaProperties.audioStream;
4153
4237
  oldStream === null || oldStream === void 0 ? void 0 : oldStream.off(_mediaHelpers.StreamEventNames.MuteStateChange, this.localAudioStreamMuteStateHandler);
@@ -4159,21 +4243,21 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
4159
4243
  localStream === null || localStream === void 0 ? void 0 : localStream.on(_mediaHelpers.StreamEventNames.MuteStateChange, this.localAudioStreamMuteStateHandler);
4160
4244
  localStream === null || localStream === void 0 ? void 0 : localStream.on(_mediaHelpers.LocalStreamEventNames.OutputTrackChange, this.localOutputTrackChangeHandler);
4161
4245
  if (!(!this.isMultistream || !localStream)) {
4162
- _context10.next = 10;
4246
+ _context11.next = 10;
4163
4247
  break;
4164
4248
  }
4165
- _context10.next = 10;
4249
+ _context11.next = 10;
4166
4250
  return this.unpublishStream(_internalMediaCore.MediaType.AudioMain, oldStream);
4167
4251
  case 10:
4168
- _context10.next = 12;
4252
+ _context11.next = 12;
4169
4253
  return this.publishStream(_internalMediaCore.MediaType.AudioMain, this.mediaProperties.audioStream);
4170
4254
  case 12:
4171
4255
  case "end":
4172
- return _context10.stop();
4256
+ return _context11.stop();
4173
4257
  }
4174
- }, _callee10, this);
4258
+ }, _callee11, this);
4175
4259
  }));
4176
- function setLocalAudioStream(_x8) {
4260
+ function setLocalAudioStream(_x11) {
4177
4261
  return _setLocalAudioStream.apply(this, arguments);
4178
4262
  }
4179
4263
  return setLocalAudioStream;
@@ -4189,10 +4273,10 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
4189
4273
  }, {
4190
4274
  key: "setLocalVideoStream",
4191
4275
  value: (function () {
4192
- var _setLocalVideoStream = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee11(localStream) {
4276
+ var _setLocalVideoStream = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee12(localStream) {
4193
4277
  var oldStream;
4194
- return _regenerator.default.wrap(function _callee11$(_context11) {
4195
- while (1) switch (_context11.prev = _context11.next) {
4278
+ return _regenerator.default.wrap(function _callee12$(_context12) {
4279
+ while (1) switch (_context12.prev = _context12.next) {
4196
4280
  case 0:
4197
4281
  oldStream = this.mediaProperties.videoStream;
4198
4282
  oldStream === null || oldStream === void 0 ? void 0 : oldStream.off(_mediaHelpers.StreamEventNames.MuteStateChange, this.localVideoStreamMuteStateHandler);
@@ -4204,21 +4288,21 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
4204
4288
  localStream === null || localStream === void 0 ? void 0 : localStream.on(_mediaHelpers.StreamEventNames.MuteStateChange, this.localVideoStreamMuteStateHandler);
4205
4289
  localStream === null || localStream === void 0 ? void 0 : localStream.on(_mediaHelpers.LocalStreamEventNames.OutputTrackChange, this.localOutputTrackChangeHandler);
4206
4290
  if (!(!this.isMultistream || !localStream)) {
4207
- _context11.next = 10;
4291
+ _context12.next = 10;
4208
4292
  break;
4209
4293
  }
4210
- _context11.next = 10;
4294
+ _context12.next = 10;
4211
4295
  return this.unpublishStream(_internalMediaCore.MediaType.VideoMain, oldStream);
4212
4296
  case 10:
4213
- _context11.next = 12;
4297
+ _context12.next = 12;
4214
4298
  return this.publishStream(_internalMediaCore.MediaType.VideoMain, this.mediaProperties.videoStream);
4215
4299
  case 12:
4216
4300
  case "end":
4217
- return _context11.stop();
4301
+ return _context12.stop();
4218
4302
  }
4219
- }, _callee11, this);
4303
+ }, _callee12, this);
4220
4304
  }));
4221
- function setLocalVideoStream(_x9) {
4305
+ function setLocalVideoStream(_x12) {
4222
4306
  return _setLocalVideoStream.apply(this, arguments);
4223
4307
  }
4224
4308
  return setLocalVideoStream;
@@ -4235,10 +4319,10 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
4235
4319
  }, {
4236
4320
  key: "setLocalShareVideoStream",
4237
4321
  value: (function () {
4238
- var _setLocalShareVideoStream = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee12(localDisplayStream) {
4322
+ var _setLocalShareVideoStream = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee13(localDisplayStream) {
4239
4323
  var oldStream;
4240
- return _regenerator.default.wrap(function _callee12$(_context12) {
4241
- while (1) switch (_context12.prev = _context12.next) {
4324
+ return _regenerator.default.wrap(function _callee13$(_context13) {
4325
+ while (1) switch (_context13.prev = _context13.next) {
4242
4326
  case 0:
4243
4327
  oldStream = this.mediaProperties.shareVideoStream;
4244
4328
  oldStream === null || oldStream === void 0 ? void 0 : oldStream.off(_mediaHelpers.StreamEventNames.MuteStateChange, this.handleShareVideoStreamMuteStateChange);
@@ -4250,21 +4334,21 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
4250
4334
  localDisplayStream === null || localDisplayStream === void 0 ? void 0 : localDisplayStream.on(_mediaHelpers.LocalStreamEventNames.OutputTrackChange, this.localOutputTrackChangeHandler);
4251
4335
  this.mediaProperties.mediaDirection.sendShare = this.mediaProperties.hasLocalShareStream();
4252
4336
  if (!(!this.isMultistream || !localDisplayStream)) {
4253
- _context12.next = 12;
4337
+ _context13.next = 12;
4254
4338
  break;
4255
4339
  }
4256
- _context12.next = 12;
4340
+ _context13.next = 12;
4257
4341
  return this.unpublishStream(_internalMediaCore.MediaType.VideoSlides, oldStream);
4258
4342
  case 12:
4259
- _context12.next = 14;
4343
+ _context13.next = 14;
4260
4344
  return this.publishStream(_internalMediaCore.MediaType.VideoSlides, this.mediaProperties.shareVideoStream);
4261
4345
  case 14:
4262
4346
  case "end":
4263
- return _context12.stop();
4347
+ return _context13.stop();
4264
4348
  }
4265
- }, _callee12, this);
4349
+ }, _callee13, this);
4266
4350
  }));
4267
- function setLocalShareVideoStream(_x10) {
4351
+ function setLocalShareVideoStream(_x13) {
4268
4352
  return _setLocalShareVideoStream.apply(this, arguments);
4269
4353
  }
4270
4354
  return setLocalShareVideoStream;
@@ -4280,10 +4364,10 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
4280
4364
  }, {
4281
4365
  key: "setLocalShareAudioStream",
4282
4366
  value: (function () {
4283
- var _setLocalShareAudioStream = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee13(localSystemAudioStream) {
4367
+ var _setLocalShareAudioStream = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee14(localSystemAudioStream) {
4284
4368
  var oldStream;
4285
- return _regenerator.default.wrap(function _callee13$(_context13) {
4286
- while (1) switch (_context13.prev = _context13.next) {
4369
+ return _regenerator.default.wrap(function _callee14$(_context14) {
4370
+ while (1) switch (_context14.prev = _context14.next) {
4287
4371
  case 0:
4288
4372
  oldStream = this.mediaProperties.shareAudioStream;
4289
4373
  oldStream === null || oldStream === void 0 ? void 0 : oldStream.off(_mediaHelpers.StreamEventNames.Ended, this.handleShareAudioStreamEnded);
@@ -4293,21 +4377,21 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
4293
4377
  localSystemAudioStream === null || localSystemAudioStream === void 0 ? void 0 : localSystemAudioStream.on(_mediaHelpers.LocalStreamEventNames.OutputTrackChange, this.localOutputTrackChangeHandler);
4294
4378
  this.mediaProperties.mediaDirection.sendShare = this.mediaProperties.hasLocalShareStream();
4295
4379
  if (!(!this.isMultistream || !localSystemAudioStream)) {
4296
- _context13.next = 10;
4380
+ _context14.next = 10;
4297
4381
  break;
4298
4382
  }
4299
- _context13.next = 10;
4383
+ _context14.next = 10;
4300
4384
  return this.unpublishStream(_internalMediaCore.MediaType.AudioSlides, oldStream);
4301
4385
  case 10:
4302
- _context13.next = 12;
4386
+ _context14.next = 12;
4303
4387
  return this.publishStream(_internalMediaCore.MediaType.AudioSlides, this.mediaProperties.shareAudioStream);
4304
4388
  case 12:
4305
4389
  case "end":
4306
- return _context13.stop();
4390
+ return _context14.stop();
4307
4391
  }
4308
- }, _callee13, this);
4392
+ }, _callee14, this);
4309
4393
  }));
4310
- function setLocalShareAudioStream(_x11) {
4394
+ function setLocalShareAudioStream(_x14) {
4311
4395
  return _setLocalShareAudioStream.apply(this, arguments);
4312
4396
  }
4313
4397
  return setLocalShareAudioStream;
@@ -4917,12 +5001,10 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
4917
5001
  _this30.webex.internal.voicea.off(_internalPluginVoicea.EVENT_TRIGGERS.CAPTION_LANGUAGE_UPDATE, voiceaListenerCaptionUpdate);
4918
5002
  var statusCode = payload.statusCode;
4919
5003
  if (statusCode === 200) {
4920
- var _this30$transcription;
4921
- var currentCaptionLanguage = (_this30$transcription = _this30.transcription.languageOptions.requestedCaptionLanguage) !== null && _this30$transcription !== void 0 ? _this30$transcription : _constants.LANGUAGE_ENGLISH;
4922
5004
  _this30.transcription.languageOptions = _objectSpread(_objectSpread({}, _this30.transcription.languageOptions), {}, {
4923
- currentCaptionLanguage: currentCaptionLanguage
5005
+ currentCaptionLanguage: language
4924
5006
  });
4925
- resolve(currentCaptionLanguage);
5007
+ resolve(language);
4926
5008
  } else {
4927
5009
  reject(payload);
4928
5010
  }
@@ -4986,47 +5068,49 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
4986
5068
  }, {
4987
5069
  key: "startTranscription",
4988
5070
  value: (function () {
4989
- var _startTranscription = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee14(options) {
4990
- return _regenerator.default.wrap(function _callee14$(_context14) {
4991
- while (1) switch (_context14.prev = _context14.next) {
5071
+ var _startTranscription = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee15(options) {
5072
+ return _regenerator.default.wrap(function _callee15$(_context15) {
5073
+ while (1) switch (_context15.prev = _context15.next) {
4992
5074
  case 0:
4993
5075
  if (!this.isJoined()) {
4994
- _context14.next = 14;
5076
+ _context15.next = 15;
4995
5077
  break;
4996
5078
  }
4997
5079
  _loggerProxy.default.logger.info('Meeting:index#startTranscription --> Attempting to enable transcription!');
4998
- _context14.prev = 2;
5080
+ _context15.prev = 2;
4999
5081
  if (!this.areVoiceaEventsSetup) {
5000
5082
  this.setUpVoiceaListeners();
5001
- this.areVoiceaEventsSetup = true;
5002
5083
  }
5003
- // @ts-ignore
5004
- _context14.next = 6;
5084
+ if (!(this.getCurUserType() === 'host')) {
5085
+ _context15.next = 7;
5086
+ break;
5087
+ }
5088
+ _context15.next = 7;
5005
5089
  return this.webex.internal.voicea.toggleTranscribing(true, options === null || options === void 0 ? void 0 : options.spokenLanguage);
5006
- case 6:
5007
- _context14.next = 12;
5090
+ case 7:
5091
+ _context15.next = 13;
5008
5092
  break;
5009
- case 8:
5010
- _context14.prev = 8;
5011
- _context14.t0 = _context14["catch"](2);
5012
- _loggerProxy.default.logger.error("Meeting:index#startTranscription --> ".concat(_context14.t0));
5093
+ case 9:
5094
+ _context15.prev = 9;
5095
+ _context15.t0 = _context15["catch"](2);
5096
+ _loggerProxy.default.logger.error("Meeting:index#startTranscription --> ".concat(_context15.t0));
5013
5097
  _metrics.default.sendBehavioralMetric(_constants2.default.RECEIVE_TRANSCRIPTION_FAILURE, {
5014
5098
  correlation_id: this.correlationId,
5015
- reason: _context14.t0.message,
5016
- stack: _context14.t0.stack
5099
+ reason: _context15.t0.message,
5100
+ stack: _context15.t0.stack
5017
5101
  });
5018
- case 12:
5019
- _context14.next = 15;
5102
+ case 13:
5103
+ _context15.next = 16;
5020
5104
  break;
5021
- case 14:
5022
- _loggerProxy.default.logger.error("Meeting:index#startTranscription --> meeting joined : ".concat(this.isJoined()));
5023
5105
  case 15:
5106
+ _loggerProxy.default.logger.error("Meeting:index#startTranscription --> meeting joined : ".concat(this.isJoined()));
5107
+ case 16:
5024
5108
  case "end":
5025
- return _context14.stop();
5109
+ return _context15.stop();
5026
5110
  }
5027
- }, _callee14, this, [[2, 8]]);
5111
+ }, _callee15, this, [[2, 9]]);
5028
5112
  }));
5029
- function startTranscription(_x12) {
5113
+ function startTranscription(_x15) {
5030
5114
  return _startTranscription.apply(this, arguments);
5031
5115
  }
5032
5116
  return startTranscription;
@@ -5090,7 +5174,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
5090
5174
  }, {
5091
5175
  key: "join",
5092
5176
  value: (function () {
5093
- var _join = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee15() {
5177
+ var _join = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee16() {
5094
5178
  var _this32 = this;
5095
5179
  var options,
5096
5180
  errorMessage,
@@ -5101,25 +5185,25 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
5101
5185
  _error,
5102
5186
  _errorMessage2,
5103
5187
  _error2,
5104
- _args15 = arguments;
5105
- return _regenerator.default.wrap(function _callee15$(_context15) {
5106
- while (1) switch (_context15.prev = _context15.next) {
5188
+ _args16 = arguments;
5189
+ return _regenerator.default.wrap(function _callee16$(_context16) {
5190
+ while (1) switch (_context16.prev = _context16.next) {
5107
5191
  case 0:
5108
- options = _args15.length > 0 && _args15[0] !== undefined ? _args15[0] : {};
5192
+ options = _args16.length > 0 && _args16[0] !== undefined ? _args16[0] : {};
5109
5193
  if (this.webex.meetings.registered) {
5110
- _context15.next = 6;
5194
+ _context16.next = 6;
5111
5195
  break;
5112
5196
  }
5113
5197
  errorMessage = 'Meeting:index#join --> Device not registered';
5114
5198
  error = new Error(errorMessage);
5115
5199
  _loggerProxy.default.logger.error(errorMessage);
5116
- return _context15.abrupt("return", _promise.default.reject(error));
5200
+ return _context16.abrupt("return", _promise.default.reject(error));
5117
5201
  case 6:
5118
5202
  if (!this.deferJoin) {
5119
- _context15.next = 8;
5203
+ _context16.next = 8;
5120
5204
  break;
5121
5205
  }
5122
- return _context15.abrupt("return", this.deferJoin);
5206
+ return _context16.abrupt("return", this.deferJoin);
5123
5207
  case 8:
5124
5208
  // Create a deferred promise for a consistent resolve value from utils.
5125
5209
  // This also prevents redundant API calls.
@@ -5168,15 +5252,15 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
5168
5252
  this.wirelessShare = true;
5169
5253
  }
5170
5254
  if (!options.meetingQuality) {
5171
- _context15.next = 36;
5255
+ _context16.next = 36;
5172
5256
  break;
5173
5257
  }
5174
5258
  if (!(typeof options.meetingQuality === 'string')) {
5175
- _context15.next = 27;
5259
+ _context16.next = 27;
5176
5260
  break;
5177
5261
  }
5178
5262
  if (_constants.QUALITY_LEVELS[options.meetingQuality]) {
5179
- _context15.next = 26;
5263
+ _context16.next = 26;
5180
5264
  break;
5181
5265
  }
5182
5266
  _errorMessage = "Meeting:index#join --> ".concat(options.meetingQuality, " not defined");
@@ -5184,16 +5268,16 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
5184
5268
  _loggerProxy.default.logger.error(_errorMessage);
5185
5269
  joinFailed(_error);
5186
5270
  this.deferJoin = undefined;
5187
- return _context15.abrupt("return", _promise.default.reject(_error));
5271
+ return _context16.abrupt("return", _promise.default.reject(_error));
5188
5272
  case 26:
5189
5273
  this.mediaProperties.setRemoteQualityLevel(options.meetingQuality);
5190
5274
  case 27:
5191
5275
  if (!((0, _typeof2.default)(options.meetingQuality) === 'object')) {
5192
- _context15.next = 36;
5276
+ _context16.next = 36;
5193
5277
  break;
5194
5278
  }
5195
5279
  if (_constants.QUALITY_LEVELS[options.meetingQuality.remote]) {
5196
- _context15.next = 35;
5280
+ _context16.next = 35;
5197
5281
  break;
5198
5282
  }
5199
5283
  _errorMessage2 = "Meeting:index#join --> ".concat(options.meetingQuality.remote, " not defined");
@@ -5201,42 +5285,42 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
5201
5285
  _error2 = new Error(_errorMessage2);
5202
5286
  joinFailed(_error2);
5203
5287
  this.deferJoin = undefined;
5204
- return _context15.abrupt("return", _promise.default.reject(new Error(_errorMessage2)));
5288
+ return _context16.abrupt("return", _promise.default.reject(new Error(_errorMessage2)));
5205
5289
  case 35:
5206
5290
  if (options.meetingQuality.remote) {
5207
5291
  this.mediaProperties.setRemoteQualityLevel(options.meetingQuality.remote);
5208
5292
  }
5209
5293
  case 36:
5210
5294
  this.isMultistream = !!options.enableMultistream;
5211
- _context15.prev = 37;
5212
- _context15.next = 40;
5295
+ _context16.prev = 37;
5296
+ _context16.next = 40;
5213
5297
  return this.checkAndRefreshPermissionToken(_constants.MEETING_PERMISSION_TOKEN_REFRESH_THRESHOLD_IN_SEC, _constants.MEETING_PERMISSION_TOKEN_REFRESH_REASON);
5214
5298
  case 40:
5215
- _context15.next = 51;
5299
+ _context16.next = 51;
5216
5300
  break;
5217
5301
  case 42:
5218
- _context15.prev = 42;
5219
- _context15.t0 = _context15["catch"](37);
5220
- _loggerProxy.default.logger.error('Meeting:index#join --> Failed to refresh permission token:', _context15.t0);
5221
- if (!(_context15.t0 instanceof _captchaError.default || _context15.t0 instanceof _passwordError.default || _context15.t0 instanceof _permission.default)) {
5222
- _context15.next = 51;
5302
+ _context16.prev = 42;
5303
+ _context16.t0 = _context16["catch"](37);
5304
+ _loggerProxy.default.logger.error('Meeting:index#join --> Failed to refresh permission token:', _context16.t0);
5305
+ if (!(_context16.t0 instanceof _captchaError.default || _context16.t0 instanceof _passwordError.default || _context16.t0 instanceof _permission.default)) {
5306
+ _context16.next = 51;
5223
5307
  break;
5224
5308
  }
5225
- this.meetingFiniteStateMachine.fail(_context15.t0);
5309
+ this.meetingFiniteStateMachine.fail(_context16.t0);
5226
5310
 
5227
5311
  // Upload logs on refreshpermissionToken refresh Failure
5228
5312
  _triggerProxy.default.trigger(this, {
5229
5313
  file: 'meeting/index',
5230
5314
  function: 'join'
5231
5315
  }, _constants.EVENTS.REQUEST_UPLOAD_LOGS, this);
5232
- joinFailed(_context15.t0);
5316
+ joinFailed(_context16.t0);
5233
5317
  this.deferJoin = undefined;
5234
5318
 
5235
5319
  // if refresh permission token requires captcha, password or permission, we are throwing the errors
5236
5320
  // and bubble it up to client
5237
- return _context15.abrupt("return", _promise.default.reject(_context15.t0));
5321
+ return _context16.abrupt("return", _promise.default.reject(_context16.t0));
5238
5322
  case 51:
5239
- return _context15.abrupt("return", _util.default.joinMeetingOptions(this, options).then(function (join) {
5323
+ return _context16.abrupt("return", _util.default.joinMeetingOptions(this, options).then(function (join) {
5240
5324
  _this32.meetingFiniteStateMachine.join();
5241
5325
  _loggerProxy.default.logger.log('Meeting:index#join --> Success');
5242
5326
  _metrics.default.sendBehavioralMetric(_constants2.default.JOIN_SUCCESS, {
@@ -5283,21 +5367,27 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
5283
5367
  // @ts-ignore - config coming from registerPlugin
5284
5368
  if (_this32.config.enableAutomaticLLM) {
5285
5369
  _this32.updateLLMConnection().catch(function (error) {
5286
- _loggerProxy.default.logger.error('Meeting:index#join --> Update LLM Connection Failed', error);
5370
+ _loggerProxy.default.logger.error('Meeting:index#join --> Transcription Socket Connection Failed', error);
5287
5371
  _metrics.default.sendBehavioralMetric(_constants2.default.LLM_CONNECTION_AFTER_JOIN_FAILURE, {
5288
5372
  correlation_id: _this32.correlationId,
5289
5373
  reason: error === null || error === void 0 ? void 0 : error.message,
5290
5374
  stack: error.stack
5291
5375
  });
5376
+ }).then(function () {
5377
+ _loggerProxy.default.logger.info('Meeting:index#join --> Transcription Socket Connection Success');
5378
+ _triggerProxy.default.trigger(_this32, {
5379
+ file: 'meeting/index',
5380
+ function: 'join'
5381
+ }, _constants.EVENT_TRIGGERS.MEETING_TRANSCRIPTION_CONNECTED, undefined);
5292
5382
  });
5293
5383
  }
5294
5384
  return join;
5295
5385
  }));
5296
5386
  case 52:
5297
5387
  case "end":
5298
- return _context15.stop();
5388
+ return _context16.stop();
5299
5389
  }
5300
- }, _callee15, this, [[37, 42]]);
5390
+ }, _callee16, this, [[37, 42]]);
5301
5391
  }));
5302
5392
  function join() {
5303
5393
  return _join.apply(this, arguments);
@@ -5314,38 +5404,38 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
5314
5404
  }, {
5315
5405
  key: "updateLLMConnection",
5316
5406
  value: (function () {
5317
- var _updateLLMConnection = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee16() {
5407
+ var _updateLLMConnection = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee17() {
5318
5408
  var _this33 = this;
5319
5409
  var _this$locusInfo6, url, _this$locusInfo6$info, _this$locusInfo6$info2, datachannelUrl, isJoined;
5320
- return _regenerator.default.wrap(function _callee16$(_context16) {
5321
- while (1) switch (_context16.prev = _context16.next) {
5410
+ return _regenerator.default.wrap(function _callee17$(_context17) {
5411
+ while (1) switch (_context17.prev = _context17.next) {
5322
5412
  case 0:
5323
5413
  // @ts-ignore - Fix type
5324
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;
5325
5415
  isJoined = this.isJoined(); // @ts-ignore - Fix type
5326
5416
  if (!this.webex.internal.llm.isConnected()) {
5327
- _context16.next = 8;
5417
+ _context17.next = 8;
5328
5418
  break;
5329
5419
  }
5330
5420
  if (!(url === this.webex.internal.llm.getLocusUrl() && isJoined)) {
5331
- _context16.next = 5;
5421
+ _context17.next = 5;
5332
5422
  break;
5333
5423
  }
5334
- return _context16.abrupt("return", undefined);
5424
+ return _context17.abrupt("return", undefined);
5335
5425
  case 5:
5336
- _context16.next = 7;
5426
+ _context17.next = 7;
5337
5427
  return this.webex.internal.llm.disconnectLLM();
5338
5428
  case 7:
5339
5429
  // @ts-ignore - Fix type
5340
5430
  this.webex.internal.llm.off('event:relay.event', this.processRelayEvent);
5341
5431
  case 8:
5342
5432
  if (isJoined) {
5343
- _context16.next = 10;
5433
+ _context17.next = 10;
5344
5434
  break;
5345
5435
  }
5346
- return _context16.abrupt("return", undefined);
5436
+ return _context17.abrupt("return", undefined);
5347
5437
  case 10:
5348
- return _context16.abrupt("return", this.webex.internal.llm.registerAndConnect(url, datachannelUrl).then(function (registerAndConnectResult) {
5438
+ return _context17.abrupt("return", this.webex.internal.llm.registerAndConnect(url, datachannelUrl).then(function (registerAndConnectResult) {
5349
5439
  // @ts-ignore - Fix type
5350
5440
  _this33.webex.internal.llm.off('event:relay.event', _this33.processRelayEvent);
5351
5441
  // @ts-ignore - Fix type
@@ -5355,9 +5445,9 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
5355
5445
  }));
5356
5446
  case 11:
5357
5447
  case "end":
5358
- return _context16.stop();
5448
+ return _context17.stop();
5359
5449
  }
5360
- }, _callee16, this);
5450
+ }, _callee17, this);
5361
5451
  }));
5362
5452
  function updateLLMConnection() {
5363
5453
  return _updateLLMConnection.apply(this, arguments);
@@ -5529,17 +5619,17 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
5529
5619
  meetingId: this.id
5530
5620
  }
5531
5621
  });
5532
- this.locusInfo.once(_constants.LOCUSINFO.EVENTS.SELF_OBSERVING, /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee17() {
5622
+ this.locusInfo.once(_constants.LOCUSINFO.EVENTS.SELF_OBSERVING, /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee18() {
5533
5623
  var mediaSettings;
5534
- return _regenerator.default.wrap(function _callee17$(_context17) {
5535
- while (1) switch (_context17.prev = _context17.next) {
5624
+ return _regenerator.default.wrap(function _callee18$(_context18) {
5625
+ while (1) switch (_context18.prev = _context18.next) {
5536
5626
  case 0:
5537
- _context17.prev = 0;
5627
+ _context18.prev = 0;
5538
5628
  if (!(_this36.screenShareFloorState === ScreenShareFloorStatus.GRANTED)) {
5539
- _context17.next = 4;
5629
+ _context18.next = 4;
5540
5630
  break;
5541
5631
  }
5542
- _context17.next = 4;
5632
+ _context18.next = 4;
5543
5633
  return _this36.releaseScreenShareFloor();
5544
5634
  case 4:
5545
5635
  mediaSettings = {
@@ -5559,28 +5649,28 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
5559
5649
  // 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
5560
5650
  // once the DX answers we establish connection back the media server with only receiveShare enabled
5561
5651
  // @ts-ignore - reconnectMedia does not accept any argument
5562
- _context17.next = 10;
5652
+ _context18.next = 10;
5563
5653
  return _this36.reconnectionManager.reconnectMedia(mediaSettings).then(function () {
5564
5654
  _metrics.default.sendBehavioralMetric(_constants2.default.MOVE_TO_SUCCESS);
5565
5655
  });
5566
5656
  case 10:
5567
- _context17.next = 16;
5657
+ _context18.next = 16;
5568
5658
  break;
5569
5659
  case 12:
5570
- _context17.prev = 12;
5571
- _context17.t0 = _context17["catch"](0);
5572
- _loggerProxy.default.logger.error('Meeting:index#moveTo --> Failed to moveTo resourceId', _context17.t0);
5660
+ _context18.prev = 12;
5661
+ _context18.t0 = _context18["catch"](0);
5662
+ _loggerProxy.default.logger.error('Meeting:index#moveTo --> Failed to moveTo resourceId', _context18.t0);
5573
5663
  _metrics.default.sendBehavioralMetric(_constants2.default.MOVE_TO_FAILURE, {
5574
5664
  correlation_id: _this36.correlationId,
5575
5665
  locus_id: _this36.locusUrl.split('/').pop(),
5576
- reason: _context17.t0.message,
5577
- stack: _context17.t0.stack
5666
+ reason: _context18.t0.message,
5667
+ stack: _context18.t0.stack
5578
5668
  });
5579
5669
  case 16:
5580
5670
  case "end":
5581
- return _context17.stop();
5671
+ return _context18.stop();
5582
5672
  }
5583
- }, _callee17, null, [[0, 12]]);
5673
+ }, _callee18, null, [[0, 12]]);
5584
5674
  })));
5585
5675
  _loggerProxy.default.logger.info('Meeting:index#moveTo --> Initated moved to using resourceId', resourceId);
5586
5676
  return _util.default.joinMeetingOptions(this, {
@@ -5663,10 +5753,10 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
5663
5753
  }, {
5664
5754
  key: "createMediaConnection",
5665
5755
  value: (function () {
5666
- var _createMediaConnection = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee18(turnServerInfo, bundlePolicy) {
5756
+ var _createMediaConnection = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee19(turnServerInfo, bundlePolicy) {
5667
5757
  var mc, audioEnabled, videoEnabled, shareEnabled;
5668
- return _regenerator.default.wrap(function _callee18$(_context18) {
5669
- while (1) switch (_context18.prev = _context18.next) {
5758
+ return _regenerator.default.wrap(function _callee19$(_context19) {
5759
+ while (1) switch (_context19.prev = _context19.next) {
5670
5760
  case 0:
5671
5761
  mc = _media.default.createMediaConnection(this.isMultistream, this.getMediaConnectionDebugId(),
5672
5762
  // @ts-ignore
@@ -5692,41 +5782,41 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
5692
5782
 
5693
5783
  // publish the streams
5694
5784
  if (!this.mediaProperties.audioStream) {
5695
- _context18.next = 7;
5785
+ _context19.next = 7;
5696
5786
  break;
5697
5787
  }
5698
- _context18.next = 7;
5788
+ _context19.next = 7;
5699
5789
  return this.publishStream(_internalMediaCore.MediaType.AudioMain, this.mediaProperties.audioStream);
5700
5790
  case 7:
5701
5791
  if (!this.mediaProperties.videoStream) {
5702
- _context18.next = 10;
5792
+ _context19.next = 10;
5703
5793
  break;
5704
5794
  }
5705
- _context18.next = 10;
5795
+ _context19.next = 10;
5706
5796
  return this.publishStream(_internalMediaCore.MediaType.VideoMain, this.mediaProperties.videoStream);
5707
5797
  case 10:
5708
5798
  if (!this.mediaProperties.shareVideoStream) {
5709
- _context18.next = 13;
5799
+ _context19.next = 13;
5710
5800
  break;
5711
5801
  }
5712
- _context18.next = 13;
5802
+ _context19.next = 13;
5713
5803
  return this.publishStream(_internalMediaCore.MediaType.VideoSlides, this.mediaProperties.shareVideoStream);
5714
5804
  case 13:
5715
5805
  if (!(this.isMultistream && this.mediaProperties.shareAudioStream)) {
5716
- _context18.next = 16;
5806
+ _context19.next = 16;
5717
5807
  break;
5718
5808
  }
5719
- _context18.next = 16;
5809
+ _context19.next = 16;
5720
5810
  return this.publishStream(_internalMediaCore.MediaType.AudioSlides, this.mediaProperties.shareAudioStream);
5721
5811
  case 16:
5722
- return _context18.abrupt("return", mc);
5812
+ return _context19.abrupt("return", mc);
5723
5813
  case 17:
5724
5814
  case "end":
5725
- return _context18.stop();
5815
+ return _context19.stop();
5726
5816
  }
5727
- }, _callee18, this);
5817
+ }, _callee19, this);
5728
5818
  }));
5729
- function createMediaConnection(_x13, _x14) {
5819
+ function createMediaConnection(_x16, _x17) {
5730
5820
  return _createMediaConnection.apply(this, arguments);
5731
5821
  }
5732
5822
  return createMediaConnection;
@@ -5764,11 +5854,11 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
5764
5854
  }, {
5765
5855
  key: "setUpLocalStreamReferences",
5766
5856
  value: (function () {
5767
- var _setUpLocalStreamReferences = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee19(localStreams) {
5857
+ var _setUpLocalStreamReferences = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee20(localStreams) {
5768
5858
  var _localStreams$screenS, _localStreams$screenS2;
5769
5859
  var setUpStreamPromises;
5770
- return _regenerator.default.wrap(function _callee19$(_context19) {
5771
- while (1) switch (_context19.prev = _context19.next) {
5860
+ return _regenerator.default.wrap(function _callee20$(_context20) {
5861
+ while (1) switch (_context20.prev = _context20.next) {
5772
5862
  case 0:
5773
5863
  setUpStreamPromises = [];
5774
5864
  if (localStreams !== null && localStreams !== void 0 && localStreams.microphone) {
@@ -5783,24 +5873,24 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
5783
5873
  if (localStreams !== null && localStreams !== void 0 && (_localStreams$screenS2 = localStreams.screenShare) !== null && _localStreams$screenS2 !== void 0 && _localStreams$screenS2.audio) {
5784
5874
  setUpStreamPromises.push(this.setLocalShareAudioStream(localStreams.screenShare.audio));
5785
5875
  }
5786
- _context19.prev = 5;
5787
- _context19.next = 8;
5876
+ _context20.prev = 5;
5877
+ _context20.next = 8;
5788
5878
  return _promise.default.all(setUpStreamPromises);
5789
5879
  case 8:
5790
- _context19.next = 14;
5880
+ _context20.next = 14;
5791
5881
  break;
5792
5882
  case 10:
5793
- _context19.prev = 10;
5794
- _context19.t0 = _context19["catch"](5);
5795
- _loggerProxy.default.logger.error("Meeting:index#addMedia():setUpLocalStreamReferences --> Error , ", _context19.t0);
5796
- throw _context19.t0;
5883
+ _context20.prev = 10;
5884
+ _context20.t0 = _context20["catch"](5);
5885
+ _loggerProxy.default.logger.error("Meeting:index#addMedia():setUpLocalStreamReferences --> Error , ", _context20.t0);
5886
+ throw _context20.t0;
5797
5887
  case 14:
5798
5888
  case "end":
5799
- return _context19.stop();
5889
+ return _context20.stop();
5800
5890
  }
5801
- }, _callee19, this, [[5, 10]]);
5891
+ }, _callee20, this, [[5, 10]]);
5802
5892
  }));
5803
- function setUpLocalStreamReferences(_x15) {
5893
+ function setUpLocalStreamReferences(_x18) {
5804
5894
  return _setUpLocalStreamReferences.apply(this, arguments);
5805
5895
  }
5806
5896
  return setUpLocalStreamReferences;
@@ -5815,20 +5905,20 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
5815
5905
  }, {
5816
5906
  key: "waitForMediaConnectionConnected",
5817
5907
  value: (function () {
5818
- var _waitForMediaConnectionConnected = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee20() {
5908
+ var _waitForMediaConnectionConnected = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee21() {
5819
5909
  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;
5820
- return _regenerator.default.wrap(function _callee20$(_context20) {
5821
- while (1) switch (_context20.prev = _context20.next) {
5910
+ return _regenerator.default.wrap(function _callee21$(_context21) {
5911
+ while (1) switch (_context21.prev = _context21.next) {
5822
5912
  case 0:
5823
- _context20.prev = 0;
5824
- _context20.next = 3;
5913
+ _context21.prev = 0;
5914
+ _context21.next = 3;
5825
5915
  return this.mediaProperties.waitForMediaConnectionConnected();
5826
5916
  case 3:
5827
- _context20.next = 9;
5917
+ _context21.next = 9;
5828
5918
  break;
5829
5919
  case 5:
5830
- _context20.prev = 5;
5831
- _context20.t0 = _context20["catch"](0);
5920
+ _context21.prev = 5;
5921
+ _context21.t0 = _context21["catch"](0);
5832
5922
  if (!this.hasMediaConnectionConnectedAtLeastOnce) {
5833
5923
  // Only send CA event for join flow if we haven't successfully connected media yet
5834
5924
  // @ts-ignore
@@ -5856,9 +5946,9 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
5856
5946
  throw new Error("Timed out waiting for media connection to be connected, correlationId=".concat(this.correlationId));
5857
5947
  case 9:
5858
5948
  case "end":
5859
- return _context20.stop();
5949
+ return _context21.stop();
5860
5950
  }
5861
- }, _callee20, this, [[0, 5]]);
5951
+ }, _callee21, this, [[0, 5]]);
5862
5952
  }));
5863
5953
  function waitForMediaConnectionConnected() {
5864
5954
  return _waitForMediaConnectionConnected.apply(this, arguments);
@@ -5908,18 +5998,18 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
5908
5998
  * @returns {Promise<void>}
5909
5999
  */
5910
6000
  function () {
5911
- var _waitForRemoteSDPAnswer = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee21() {
6001
+ var _waitForRemoteSDPAnswer = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee22() {
5912
6002
  var LOG_HEADER, deferSDPAnswer;
5913
- return _regenerator.default.wrap(function _callee21$(_context21) {
5914
- while (1) switch (_context21.prev = _context21.next) {
6003
+ return _regenerator.default.wrap(function _callee22$(_context22) {
6004
+ while (1) switch (_context22.prev = _context22.next) {
5915
6005
  case 0:
5916
6006
  LOG_HEADER = 'Meeting:index#addMedia():waitForRemoteSDPAnswer -->';
5917
6007
  if (this.deferSDPAnswer) {
5918
- _context21.next = 4;
6008
+ _context22.next = 4;
5919
6009
  break;
5920
6010
  }
5921
6011
  _loggerProxy.default.logger.warn("".concat(LOG_HEADER, " offer not created yet"));
5922
- return _context21.abrupt("return", _promise.default.reject(new Error('waitForRemoteSDPAnswer() called before local sdp offer created')));
6012
+ return _context22.abrupt("return", _promise.default.reject(new Error('waitForRemoteSDPAnswer() called before local sdp offer created')));
5923
6013
  case 4:
5924
6014
  deferSDPAnswer = this.deferSDPAnswer;
5925
6015
  this.sdpResponseTimer = setTimeout(function () {
@@ -5927,12 +6017,12 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
5927
6017
  deferSDPAnswer.reject(new Error('Timed out waiting for REMOTE SDP ANSWER'));
5928
6018
  }, _constants.ROAP_OFFER_ANSWER_EXCHANGE_TIMEOUT);
5929
6019
  _loggerProxy.default.logger.info("".concat(LOG_HEADER, " waiting for REMOTE SDP ANSWER..."));
5930
- return _context21.abrupt("return", deferSDPAnswer.promise);
6020
+ return _context22.abrupt("return", deferSDPAnswer.promise);
5931
6021
  case 8:
5932
6022
  case "end":
5933
- return _context21.stop();
6023
+ return _context22.stop();
5934
6024
  }
5935
- }, _callee21, this);
6025
+ }, _callee22, this);
5936
6026
  }));
5937
6027
  function waitForRemoteSDPAnswer() {
5938
6028
  return _waitForRemoteSDPAnswer.apply(this, arguments);
@@ -5951,30 +6041,30 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
5951
6041
  }, {
5952
6042
  key: "retryEstablishMediaConnectionWithForcedTurnDiscovery",
5953
6043
  value: (function () {
5954
- var _retryEstablishMediaConnectionWithForcedTurnDiscovery = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee22(remoteMediaManagerConfig, bundlePolicy) {
6044
+ var _retryEstablishMediaConnectionWithForcedTurnDiscovery = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee23(remoteMediaManagerConfig, bundlePolicy) {
5955
6045
  var LOG_HEADER;
5956
- return _regenerator.default.wrap(function _callee22$(_context22) {
5957
- while (1) switch (_context22.prev = _context22.next) {
6046
+ return _regenerator.default.wrap(function _callee23$(_context23) {
6047
+ while (1) switch (_context23.prev = _context23.next) {
5958
6048
  case 0:
5959
6049
  LOG_HEADER = 'Meeting:index#addMedia():retryEstablishMediaConnectionWithForcedTurnDiscovery -->';
5960
- _context22.prev = 1;
5961
- _context22.next = 4;
6050
+ _context23.prev = 1;
6051
+ _context23.next = 4;
5962
6052
  return this.establishMediaConnection(remoteMediaManagerConfig, bundlePolicy, true);
5963
6053
  case 4:
5964
- _context22.next = 10;
6054
+ _context23.next = 10;
5965
6055
  break;
5966
6056
  case 6:
5967
- _context22.prev = 6;
5968
- _context22.t0 = _context22["catch"](1);
5969
- _loggerProxy.default.logger.error("".concat(LOG_HEADER, " retry with TURN-TLS failed, media connection unable to connect, "), _context22.t0);
5970
- throw _context22.t0;
6057
+ _context23.prev = 6;
6058
+ _context23.t0 = _context23["catch"](1);
6059
+ _loggerProxy.default.logger.error("".concat(LOG_HEADER, " retry with TURN-TLS failed, media connection unable to connect, "), _context23.t0);
6060
+ throw _context23.t0;
5971
6061
  case 10:
5972
6062
  case "end":
5973
- return _context22.stop();
6063
+ return _context23.stop();
5974
6064
  }
5975
- }, _callee22, this, [[1, 6]]);
6065
+ }, _callee23, this, [[1, 6]]);
5976
6066
  }));
5977
- function retryEstablishMediaConnectionWithForcedTurnDiscovery(_x16, _x17) {
6067
+ function retryEstablishMediaConnectionWithForcedTurnDiscovery(_x19, _x20) {
5978
6068
  return _retryEstablishMediaConnectionWithForcedTurnDiscovery.apply(this, arguments);
5979
6069
  }
5980
6070
  return retryEstablishMediaConnectionWithForcedTurnDiscovery;
@@ -5992,14 +6082,14 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
5992
6082
  }, {
5993
6083
  key: "retryWithForcedTurnDiscovery",
5994
6084
  value: (function () {
5995
- var _retryWithForcedTurnDiscovery = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee23(remoteMediaManagerConfig, bundlePolicy) {
6085
+ var _retryWithForcedTurnDiscovery = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee24(remoteMediaManagerConfig, bundlePolicy) {
5996
6086
  var LOG_HEADER;
5997
- return _regenerator.default.wrap(function _callee23$(_context23) {
5998
- while (1) switch (_context23.prev = _context23.next) {
6087
+ return _regenerator.default.wrap(function _callee24$(_context24) {
6088
+ while (1) switch (_context24.prev = _context24.next) {
5999
6089
  case 0:
6000
6090
  this.retriedWithTurnServer = true;
6001
6091
  LOG_HEADER = 'Meeting:index#addMedia():retryWithForcedTurnDiscovery -->';
6002
- _context23.next = 4;
6092
+ _context24.next = 4;
6003
6093
  return this.cleanUpBeforeRetryWithTurnServer();
6004
6094
  case 4:
6005
6095
  _metrics.default.sendBehavioralMetric(_constants2.default.ADD_MEDIA_RETRY, {
@@ -6009,24 +6099,24 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
6009
6099
  reason: 'forcingTurnTls'
6010
6100
  });
6011
6101
  if (!(this.state === _constants.MEETING_STATE.STATES.LEFT)) {
6012
- _context23.next = 9;
6102
+ _context24.next = 9;
6013
6103
  break;
6014
6104
  }
6015
6105
  _loggerProxy.default.logger.info("".concat(LOG_HEADER, " meeting state was LEFT after first attempt to establish media connection. Attempting to rejoin. "));
6016
- _context23.next = 9;
6106
+ _context24.next = 9;
6017
6107
  return this.join({
6018
6108
  rejoin: true
6019
6109
  });
6020
6110
  case 9:
6021
- _context23.next = 11;
6111
+ _context24.next = 11;
6022
6112
  return this.retryEstablishMediaConnectionWithForcedTurnDiscovery(remoteMediaManagerConfig, bundlePolicy);
6023
6113
  case 11:
6024
6114
  case "end":
6025
- return _context23.stop();
6115
+ return _context24.stop();
6026
6116
  }
6027
- }, _callee23, this);
6117
+ }, _callee24, this);
6028
6118
  }));
6029
- function retryWithForcedTurnDiscovery(_x18, _x19) {
6119
+ function retryWithForcedTurnDiscovery(_x21, _x22) {
6030
6120
  return _retryWithForcedTurnDiscovery.apply(this, arguments);
6031
6121
  }
6032
6122
  return retryWithForcedTurnDiscovery;
@@ -6046,32 +6136,32 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
6046
6136
  }, {
6047
6137
  key: "handleWaitForMediaConnectionConnectedError",
6048
6138
  value: (function () {
6049
- var _handleWaitForMediaConnectionConnectedError = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee24(error, remoteMediaManagerConfig, bundlePolicy) {
6139
+ var _handleWaitForMediaConnectionConnectedError = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee25(error, remoteMediaManagerConfig, bundlePolicy) {
6050
6140
  var LOG_HEADER;
6051
- return _regenerator.default.wrap(function _callee24$(_context24) {
6052
- while (1) switch (_context24.prev = _context24.next) {
6141
+ return _regenerator.default.wrap(function _callee25$(_context25) {
6142
+ while (1) switch (_context25.prev = _context25.next) {
6053
6143
  case 0:
6054
6144
  LOG_HEADER = 'Meeting:index#addMedia():handleWaitForMediaConnectionConnectedError -->'; // @ts-ignore - config coming from registerPlugin
6055
6145
  if (this.turnServerUsed) {
6056
- _context24.next = 7;
6146
+ _context25.next = 7;
6057
6147
  break;
6058
6148
  }
6059
6149
  _loggerProxy.default.logger.info("".concat(LOG_HEADER, " error waiting for media to connect on UDP, TCP, retrying using TURN-TLS, "), error);
6060
- _context24.next = 5;
6150
+ _context25.next = 5;
6061
6151
  return this.retryWithForcedTurnDiscovery(remoteMediaManagerConfig, bundlePolicy);
6062
6152
  case 5:
6063
- _context24.next = 9;
6153
+ _context25.next = 9;
6064
6154
  break;
6065
6155
  case 7:
6066
6156
  _loggerProxy.default.logger.error("".concat(LOG_HEADER, " error waiting for media to connect using UDP, TCP and TURN-TLS"), error);
6067
6157
  throw new _webexErrors.AddMediaFailed();
6068
6158
  case 9:
6069
6159
  case "end":
6070
- return _context24.stop();
6160
+ return _context25.stop();
6071
6161
  }
6072
- }, _callee24, this);
6162
+ }, _callee25, this);
6073
6163
  }));
6074
- function handleWaitForMediaConnectionConnectedError(_x20, _x21, _x22) {
6164
+ function handleWaitForMediaConnectionConnectedError(_x23, _x24, _x25) {
6075
6165
  return _handleWaitForMediaConnectionConnectedError.apply(this, arguments);
6076
6166
  }
6077
6167
  return handleWaitForMediaConnectionConnectedError;
@@ -6089,23 +6179,23 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
6089
6179
  }, {
6090
6180
  key: "establishMediaConnection",
6091
6181
  value: (function () {
6092
- var _establishMediaConnection = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee25(remoteMediaManagerConfig, bundlePolicy, isForced) {
6182
+ var _establishMediaConnection = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee26(remoteMediaManagerConfig, bundlePolicy, isForced) {
6093
6183
  var LOG_HEADER, cdl, isRetry, turnDiscoveryObject, turnServerInfo, mc;
6094
- return _regenerator.default.wrap(function _callee25$(_context25) {
6095
- while (1) switch (_context25.prev = _context25.next) {
6184
+ return _regenerator.default.wrap(function _callee26$(_context26) {
6185
+ while (1) switch (_context26.prev = _context26.next) {
6096
6186
  case 0:
6097
6187
  LOG_HEADER = 'Meeting:index#addMedia():establishMediaConnection -->'; // @ts-ignore
6098
6188
  cdl = this.webex.internal.newMetrics.callDiagnosticLatencies;
6099
6189
  isRetry = this.retriedWithTurnServer;
6100
- _context25.prev = 3;
6190
+ _context26.prev = 3;
6101
6191
  // @ts-ignore
6102
6192
  this.webex.internal.newMetrics.submitInternalEvent({
6103
6193
  name: 'internal.client.add-media.turn-discovery.start'
6104
6194
  });
6105
- _context25.next = 7;
6195
+ _context26.next = 7;
6106
6196
  return this.roap.doTurnDiscovery(this, isRetry, isForced);
6107
6197
  case 7:
6108
- turnDiscoveryObject = _context25.sent;
6198
+ turnDiscoveryObject = _context26.sent;
6109
6199
  this.turnDiscoverySkippedReason = turnDiscoveryObject === null || turnDiscoveryObject === void 0 ? void 0 : turnDiscoveryObject.turnDiscoverySkippedReason;
6110
6200
  this.turnServerUsed = !this.turnDiscoverySkippedReason;
6111
6201
 
@@ -6122,55 +6212,55 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
6122
6212
  retriedWithTurnServer: this.retriedWithTurnServer
6123
6213
  });
6124
6214
  }
6125
- _context25.next = 15;
6215
+ _context26.next = 15;
6126
6216
  return this.createMediaConnection(turnServerInfo, bundlePolicy);
6127
6217
  case 15:
6128
- mc = _context25.sent;
6218
+ mc = _context26.sent;
6129
6219
  _loggerProxy.default.logger.info("".concat(LOG_HEADER, " media connection created"));
6130
6220
  if (!this.isMultistream) {
6131
- _context25.next = 24;
6221
+ _context26.next = 24;
6132
6222
  break;
6133
6223
  }
6134
6224
  this.remoteMediaManager = new _remoteMediaManager.RemoteMediaManager(this.receiveSlotManager, this.mediaRequestManagers, remoteMediaManagerConfig);
6135
6225
  this.forwardEvent(this.remoteMediaManager, _remoteMediaManager.Event.AudioCreated, _constants.EVENT_TRIGGERS.REMOTE_MEDIA_AUDIO_CREATED);
6136
6226
  this.forwardEvent(this.remoteMediaManager, _remoteMediaManager.Event.ScreenShareAudioCreated, _constants.EVENT_TRIGGERS.REMOTE_MEDIA_SCREEN_SHARE_AUDIO_CREATED);
6137
6227
  this.forwardEvent(this.remoteMediaManager, _remoteMediaManager.Event.VideoLayoutChanged, _constants.EVENT_TRIGGERS.REMOTE_MEDIA_VIDEO_LAYOUT_CHANGED);
6138
- _context25.next = 24;
6228
+ _context26.next = 24;
6139
6229
  return this.remoteMediaManager.start();
6140
6230
  case 24:
6141
- _context25.next = 26;
6231
+ _context26.next = 26;
6142
6232
  return mc.initiateOffer();
6143
6233
  case 26:
6144
- _context25.next = 28;
6234
+ _context26.next = 28;
6145
6235
  return this.waitForRemoteSDPAnswer();
6146
6236
  case 28:
6147
6237
  this.handleMediaLogging(this.mediaProperties);
6148
- _context25.next = 35;
6238
+ _context26.next = 35;
6149
6239
  break;
6150
6240
  case 31:
6151
- _context25.prev = 31;
6152
- _context25.t0 = _context25["catch"](3);
6153
- _loggerProxy.default.logger.error("".concat(LOG_HEADER, " error establishing media connection, "), _context25.t0);
6154
- throw _context25.t0;
6241
+ _context26.prev = 31;
6242
+ _context26.t0 = _context26["catch"](3);
6243
+ _loggerProxy.default.logger.error("".concat(LOG_HEADER, " error establishing media connection, "), _context26.t0);
6244
+ throw _context26.t0;
6155
6245
  case 35:
6156
- _context25.prev = 35;
6157
- _context25.next = 38;
6246
+ _context26.prev = 35;
6247
+ _context26.next = 38;
6158
6248
  return this.waitForMediaConnectionConnected();
6159
6249
  case 38:
6160
- _context25.next = 44;
6250
+ _context26.next = 44;
6161
6251
  break;
6162
6252
  case 40:
6163
- _context25.prev = 40;
6164
- _context25.t1 = _context25["catch"](35);
6165
- _context25.next = 44;
6166
- return this.handleWaitForMediaConnectionConnectedError(_context25.t1, remoteMediaManagerConfig, bundlePolicy);
6253
+ _context26.prev = 40;
6254
+ _context26.t1 = _context26["catch"](35);
6255
+ _context26.next = 44;
6256
+ return this.handleWaitForMediaConnectionConnectedError(_context26.t1, remoteMediaManagerConfig, bundlePolicy);
6167
6257
  case 44:
6168
6258
  case "end":
6169
- return _context25.stop();
6259
+ return _context26.stop();
6170
6260
  }
6171
- }, _callee25, this, [[3, 31], [35, 40]]);
6261
+ }, _callee26, this, [[3, 31], [35, 40]]);
6172
6262
  }));
6173
- function establishMediaConnection(_x23, _x24, _x25) {
6263
+ function establishMediaConnection(_x26, _x27, _x28) {
6174
6264
  return _establishMediaConnection.apply(this, arguments);
6175
6265
  }
6176
6266
  return establishMediaConnection;
@@ -6185,22 +6275,22 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
6185
6275
  }, {
6186
6276
  key: "cleanUpOnAddMediaFailure",
6187
6277
  value: (function () {
6188
- var _cleanUpOnAddMediaFailure = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee26() {
6189
- return _regenerator.default.wrap(function _callee26$(_context26) {
6190
- while (1) switch (_context26.prev = _context26.next) {
6278
+ var _cleanUpOnAddMediaFailure = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee27() {
6279
+ return _regenerator.default.wrap(function _callee27$(_context27) {
6280
+ while (1) switch (_context27.prev = _context27.next) {
6191
6281
  case 0:
6192
6282
  if (!this.statsAnalyzer) {
6193
- _context26.next = 3;
6283
+ _context27.next = 3;
6194
6284
  break;
6195
6285
  }
6196
- _context26.next = 3;
6286
+ _context27.next = 3;
6197
6287
  return this.statsAnalyzer.stopAnalyzer();
6198
6288
  case 3:
6199
6289
  this.statsAnalyzer = null;
6200
6290
 
6201
6291
  // when media fails, we want to upload a webrtc dump to see whats going on
6202
6292
  // this function is async, but returns once the stats have been gathered
6203
- _context26.next = 6;
6293
+ _context27.next = 6;
6204
6294
  return this.forceSendStatsReport({
6205
6295
  callFrom: 'addMedia'
6206
6296
  });
@@ -6211,9 +6301,9 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
6211
6301
  }
6212
6302
  case 7:
6213
6303
  case "end":
6214
- return _context26.stop();
6304
+ return _context27.stop();
6215
6305
  }
6216
- }, _callee26, this);
6306
+ }, _callee27, this);
6217
6307
  }));
6218
6308
  function cleanUpOnAddMediaFailure() {
6219
6309
  return _cleanUpOnAddMediaFailure.apply(this, arguments);
@@ -6231,11 +6321,11 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
6231
6321
  }, {
6232
6322
  key: "cleanUpBeforeRetryWithTurnServer",
6233
6323
  value: (function () {
6234
- var _cleanUpBeforeRetryWithTurnServer = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee27() {
6235
- return _regenerator.default.wrap(function _callee27$(_context27) {
6236
- while (1) switch (_context27.prev = _context27.next) {
6324
+ var _cleanUpBeforeRetryWithTurnServer = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee28() {
6325
+ return _regenerator.default.wrap(function _callee28$(_context28) {
6326
+ while (1) switch (_context28.prev = _context28.next) {
6237
6327
  case 0:
6238
- _context27.next = 2;
6328
+ _context28.next = 2;
6239
6329
  return this.forceSendStatsReport({
6240
6330
  callFrom: 'cleanUpBeforeRetryWithTurnServer'
6241
6331
  });
@@ -6255,9 +6345,9 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
6255
6345
  }
6256
6346
  case 3:
6257
6347
  case "end":
6258
- return _context27.stop();
6348
+ return _context28.stop();
6259
6349
  }
6260
- }, _callee27, this);
6350
+ }, _callee28, this);
6261
6351
  }));
6262
6352
  function cleanUpBeforeRetryWithTurnServer() {
6263
6353
  return _cleanUpBeforeRetryWithTurnServer.apply(this, arguments);
@@ -6276,7 +6366,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
6276
6366
  }, {
6277
6367
  key: "addMedia",
6278
6368
  value: (function () {
6279
- var _addMedia = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee28() {
6369
+ var _addMedia = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee29() {
6280
6370
  var _this$webex$meetings$2, _this$webex$meetings$3;
6281
6371
  var options,
6282
6372
  LOG_HEADER,
@@ -6317,23 +6407,23 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
6317
6407
  _this$mediaProperties39,
6318
6408
  _this$mediaProperties40,
6319
6409
  reachabilityMetrics,
6320
- _args28 = arguments;
6321
- return _regenerator.default.wrap(function _callee28$(_context28) {
6322
- while (1) switch (_context28.prev = _context28.next) {
6410
+ _args29 = arguments;
6411
+ return _regenerator.default.wrap(function _callee29$(_context29) {
6412
+ while (1) switch (_context29.prev = _context29.next) {
6323
6413
  case 0:
6324
- options = _args28.length > 0 && _args28[0] !== undefined ? _args28[0] : {};
6414
+ options = _args29.length > 0 && _args29[0] !== undefined ? _args29[0] : {};
6325
6415
  this.retriedWithTurnServer = false;
6326
6416
  this.hasMediaConnectionConnectedAtLeastOnce = false;
6327
6417
  LOG_HEADER = 'Meeting:index#addMedia -->';
6328
6418
  _loggerProxy.default.logger.info("".concat(LOG_HEADER, " called with: ").concat((0, _stringify.default)(options)));
6329
6419
  if (!(options.allowMediaInLobby !== true && this.meetingState !== _constants.FULL_STATE.ACTIVE)) {
6330
- _context28.next = 7;
6420
+ _context29.next = 7;
6331
6421
  break;
6332
6422
  }
6333
6423
  throw new _webexErrors.MeetingNotActiveError();
6334
6424
  case 7:
6335
6425
  if (!_util.default.isUserInLeftState(this.locusInfo)) {
6336
- _context28.next = 9;
6426
+ _context29.next = 9;
6337
6427
  break;
6338
6428
  }
6339
6429
  throw new _webexErrors.UserNotJoinedError();
@@ -6344,7 +6434,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
6344
6434
  // If the user is unjoined or guest waiting in lobby dont allow the user to addMedia
6345
6435
  // @ts-ignore - isUserUnadmitted coming from SelfUtil
6346
6436
  if (!(this.isUserUnadmitted && !this.wirelessShare && !allowMediaInLobby)) {
6347
- _context28.next = 13;
6437
+ _context29.next = 13;
6348
6438
  break;
6349
6439
  }
6350
6440
  throw new _webexErrors.UserInLobbyError();
@@ -6403,33 +6493,33 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
6403
6493
  });
6404
6494
  this.audio = (0, _muteState.createMuteState)(_constants.AUDIO, this, audioEnabled);
6405
6495
  this.video = (0, _muteState.createMuteState)(_constants.VIDEO, this, videoEnabled);
6406
- _context28.prev = 18;
6407
- _context28.next = 21;
6496
+ _context29.prev = 18;
6497
+ _context29.next = 21;
6408
6498
  return this.setUpLocalStreamReferences(localStreams);
6409
6499
  case 21:
6410
6500
  this.setMercuryListener();
6411
6501
  this.createStatsAnalyzer();
6412
- _context28.next = 25;
6502
+ _context29.next = 25;
6413
6503
  return this.establishMediaConnection(remoteMediaManagerConfig, bundlePolicy, false);
6414
6504
  case 25:
6415
- _context28.next = 27;
6505
+ _context29.next = 27;
6416
6506
  return Meeting.handleDeviceLogging();
6417
6507
  case 27:
6418
6508
  if (!this.mediaProperties.hasLocalShareStream()) {
6419
- _context28.next = 30;
6509
+ _context29.next = 30;
6420
6510
  break;
6421
6511
  }
6422
- _context28.next = 30;
6512
+ _context29.next = 30;
6423
6513
  return this.enqueueScreenShareFloorRequest();
6424
6514
  case 30:
6425
- _context28.next = 32;
6515
+ _context29.next = 32;
6426
6516
  return this.mediaProperties.getCurrentConnectionType();
6427
6517
  case 32:
6428
- connectionType = _context28.sent;
6429
- _context28.next = 35;
6518
+ connectionType = _context29.sent;
6519
+ _context29.next = 35;
6430
6520
  return this.webex.meetings.reachability.getReachabilityMetrics();
6431
6521
  case 35:
6432
- reachabilityStats = _context28.sent;
6522
+ reachabilityStats = _context29.sent;
6433
6523
  _metrics.default.sendBehavioralMetric(_constants2.default.ADD_MEDIA_SUCCESS, _objectSpread({
6434
6524
  correlation_id: this.correlationId,
6435
6525
  locus_id: this.locusUrl.split('/').pop(),
@@ -6448,24 +6538,24 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
6448
6538
 
6449
6539
  // We can log ReceiveSlot SSRCs only after the SDP exchange, so doing it here:
6450
6540
  (_this$remoteMediaMana = this.remoteMediaManager) === null || _this$remoteMediaMana === void 0 ? void 0 : _this$remoteMediaMana.logAllReceiveSlots();
6451
- _context28.next = 54;
6541
+ _context29.next = 54;
6452
6542
  break;
6453
6543
  case 42:
6454
- _context28.prev = 42;
6455
- _context28.t0 = _context28["catch"](18);
6456
- _loggerProxy.default.logger.error("".concat(LOG_HEADER, " failed to establish media connection: "), _context28.t0);
6544
+ _context29.prev = 42;
6545
+ _context29.t0 = _context29["catch"](18);
6546
+ _loggerProxy.default.logger.error("".concat(LOG_HEADER, " failed to establish media connection: "), _context29.t0);
6457
6547
 
6458
6548
  // @ts-ignore
6459
- _context28.next = 47;
6549
+ _context29.next = 47;
6460
6550
  return this.webex.meetings.reachability.getReachabilityMetrics();
6461
6551
  case 47:
6462
- reachabilityMetrics = _context28.sent;
6552
+ reachabilityMetrics = _context29.sent;
6463
6553
  _metrics.default.sendBehavioralMetric(_constants2.default.ADD_MEDIA_FAILURE, _objectSpread({
6464
6554
  correlation_id: this.correlationId,
6465
6555
  locus_id: this.locusUrl.split('/').pop(),
6466
- reason: _context28.t0.message,
6467
- stack: _context28.t0.stack,
6468
- code: _context28.t0.code,
6556
+ reason: _context29.t0.message,
6557
+ stack: _context29.t0.stack,
6558
+ code: _context29.t0.code,
6469
6559
  turnDiscoverySkippedReason: this.turnDiscoverySkippedReason,
6470
6560
  turnServerUsed: this.turnServerUsed,
6471
6561
  retriedWithTurnServer: this.retriedWithTurnServer,
@@ -6474,7 +6564,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
6474
6564
  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',
6475
6565
  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'
6476
6566
  }, reachabilityMetrics));
6477
- _context28.next = 51;
6567
+ _context29.next = 51;
6478
6568
  return this.cleanUpOnAddMediaFailure();
6479
6569
  case 51:
6480
6570
  // Upload logs on error while adding media
@@ -6482,17 +6572,17 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
6482
6572
  file: 'meeting/index',
6483
6573
  function: 'addMedia'
6484
6574
  }, _constants.EVENTS.REQUEST_UPLOAD_LOGS, this);
6485
- if (_context28.t0 instanceof _internalMediaCore.Errors.SdpError) {
6575
+ if (_context29.t0 instanceof _internalMediaCore.Errors.SdpError) {
6486
6576
  this.leave({
6487
6577
  reason: _constants.MEETING_REMOVED_REASON.MEETING_CONNECTION_FAILED
6488
6578
  });
6489
6579
  }
6490
- throw _context28.t0;
6580
+ throw _context29.t0;
6491
6581
  case 54:
6492
6582
  case "end":
6493
- return _context28.stop();
6583
+ return _context29.stop();
6494
6584
  }
6495
- }, _callee28, this, [[18, 42]]);
6585
+ }, _callee29, this, [[18, 42]]);
6496
6586
  }));
6497
6587
  function addMedia() {
6498
6588
  return _addMedia.apply(this, arguments);
@@ -6560,35 +6650,35 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
6560
6650
  * @memberof Meeting
6561
6651
  */
6562
6652
  function () {
6563
- var _updateMedia = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee29(options) {
6653
+ var _updateMedia = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee30(options) {
6564
6654
  var audioEnabled, videoEnabled, shareAudioEnabled, shareVideoEnabled;
6565
- return _regenerator.default.wrap(function _callee29$(_context29) {
6566
- while (1) switch (_context29.prev = _context29.next) {
6655
+ return _regenerator.default.wrap(function _callee30$(_context30) {
6656
+ while (1) switch (_context30.prev = _context30.next) {
6567
6657
  case 0:
6568
6658
  this.checkMediaConnection();
6569
6659
  audioEnabled = options.audioEnabled, videoEnabled = options.videoEnabled, shareAudioEnabled = options.shareAudioEnabled, shareVideoEnabled = options.shareVideoEnabled;
6570
6660
  _loggerProxy.default.logger.log("Meeting:index#updateMedia --> called with options=".concat((0, _stringify.default)(options)));
6571
6661
  if (this.canUpdateMedia()) {
6572
- _context29.next = 5;
6662
+ _context30.next = 5;
6573
6663
  break;
6574
6664
  }
6575
- return _context29.abrupt("return", this.enqueueMediaUpdate(MEDIA_UPDATE_TYPE.UPDATE_MEDIA, options));
6665
+ return _context30.abrupt("return", this.enqueueMediaUpdate(MEDIA_UPDATE_TYPE.UPDATE_MEDIA, options));
6576
6666
  case 5:
6577
6667
  if (!this.isMultistream) {
6578
- _context29.next = 10;
6668
+ _context30.next = 10;
6579
6669
  break;
6580
6670
  }
6581
6671
  if (!(shareAudioEnabled !== undefined || shareVideoEnabled !== undefined)) {
6582
- _context29.next = 8;
6672
+ _context30.next = 8;
6583
6673
  break;
6584
6674
  }
6585
6675
  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');
6586
6676
  case 8:
6587
- _context29.next = 12;
6677
+ _context30.next = 12;
6588
6678
  break;
6589
6679
  case 10:
6590
6680
  if (!(shareAudioEnabled !== undefined)) {
6591
- _context29.next = 12;
6681
+ _context30.next = 12;
6592
6682
  break;
6593
6683
  }
6594
6684
  throw new Error('toggling shareAudioEnabled in a transcoded meeting is not supported as of now');
@@ -6613,20 +6703,20 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
6613
6703
  this.mediaProperties.mediaDirection.receiveShare = !!(shareAudioEnabled || shareVideoEnabled);
6614
6704
  }
6615
6705
  if (this.isMultistream) {
6616
- _context29.next = 18;
6706
+ _context30.next = 18;
6617
6707
  break;
6618
6708
  }
6619
- _context29.next = 18;
6709
+ _context30.next = 18;
6620
6710
  return this.updateTranscodedMediaConnection();
6621
6711
  case 18:
6622
- return _context29.abrupt("return", undefined);
6712
+ return _context30.abrupt("return", undefined);
6623
6713
  case 19:
6624
6714
  case "end":
6625
- return _context29.stop();
6715
+ return _context30.stop();
6626
6716
  }
6627
- }, _callee29, this);
6717
+ }, _callee30, this);
6628
6718
  }));
6629
- function updateMedia(_x26) {
6719
+ function updateMedia(_x29) {
6630
6720
  return _updateMedia.apply(this, arguments);
6631
6721
  }
6632
6722
  return updateMedia;
@@ -6950,9 +7040,10 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
6950
7040
  if (content && this.shareStatus !== _constants.SHARE_STATUS.LOCAL_SHARE_ACTIVE) {
6951
7041
  // @ts-ignore
6952
7042
  this.webex.internal.newMetrics.submitClientEvent({
6953
- name: 'client.share.initiated',
7043
+ name: 'client.share.floor-grant.request',
6954
7044
  payload: {
6955
- mediaType: 'share'
7045
+ mediaType: 'share',
7046
+ shareInstanceId: this.localShareInstanceId
6956
7047
  },
6957
7048
  options: {
6958
7049
  meetingId: this.id
@@ -6979,6 +7070,19 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
6979
7070
  reason: error.message,
6980
7071
  stack: error.stack
6981
7072
  });
7073
+
7074
+ // @ts-ignore
7075
+ _this46.webex.internal.newMetrics.submitClientEvent({
7076
+ name: 'client.share.floor-granted.local',
7077
+ payload: {
7078
+ mediaType: 'share',
7079
+ errors: _util.default.getChangeMeetingFloorErrorPayload(error.message),
7080
+ shareInstanceId: _this46.localShareInstanceId
7081
+ },
7082
+ options: {
7083
+ meetingId: _this46.id
7084
+ }
7085
+ });
6982
7086
  _this46.screenShareFloorState = ScreenShareFloorStatus.RELEASED;
6983
7087
  return _promise.default.reject(error);
6984
7088
  });
@@ -7033,7 +7137,8 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7033
7137
  this.webex.internal.newMetrics.submitClientEvent({
7034
7138
  name: 'client.share.stopped',
7035
7139
  payload: {
7036
- mediaType: 'share'
7140
+ mediaType: 'share',
7141
+ shareInstanceId: this.localShareInstanceId
7037
7142
  },
7038
7143
  options: {
7039
7144
  meetingId: this.id
@@ -7383,6 +7488,9 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7383
7488
  if (roles.includes(_constants.SELF_ROLES.COHOST)) {
7384
7489
  return 'cohost';
7385
7490
  }
7491
+ if (roles.includes(_constants.SELF_ROLES.PRESENTER)) {
7492
+ return 'presenter';
7493
+ }
7386
7494
  if (roles.includes(_constants.SELF_ROLES.ATTENDEE)) {
7387
7495
  return 'attendee';
7388
7496
  }
@@ -7524,39 +7632,39 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7524
7632
  }, {
7525
7633
  key: "enableMusicMode",
7526
7634
  value: (function () {
7527
- var _enableMusicMode = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee30(shouldEnableMusicMode) {
7528
- return _regenerator.default.wrap(function _callee30$(_context30) {
7529
- while (1) switch (_context30.prev = _context30.next) {
7635
+ var _enableMusicMode = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee31(shouldEnableMusicMode) {
7636
+ return _regenerator.default.wrap(function _callee31$(_context31) {
7637
+ while (1) switch (_context31.prev = _context31.next) {
7530
7638
  case 0:
7531
7639
  this.checkMediaConnection();
7532
7640
  if (this.isMultistream) {
7533
- _context30.next = 3;
7641
+ _context31.next = 3;
7534
7642
  break;
7535
7643
  }
7536
7644
  throw new Error('enableMusicMode() only supported with multistream');
7537
7645
  case 3:
7538
7646
  if (!shouldEnableMusicMode) {
7539
- _context30.next = 8;
7647
+ _context31.next = 8;
7540
7648
  break;
7541
7649
  }
7542
- _context30.next = 6;
7650
+ _context31.next = 6;
7543
7651
  return this.sendSlotManager.setCodecParameters(_internalMediaCore.MediaType.AudioMain, {
7544
7652
  maxaveragebitrate: '64000',
7545
7653
  maxplaybackrate: '48000'
7546
7654
  });
7547
7655
  case 6:
7548
- _context30.next = 10;
7656
+ _context31.next = 10;
7549
7657
  break;
7550
7658
  case 8:
7551
- _context30.next = 10;
7659
+ _context31.next = 10;
7552
7660
  return this.sendSlotManager.deleteCodecParameters(_internalMediaCore.MediaType.AudioMain, ['maxaveragebitrate', 'maxplaybackrate']);
7553
7661
  case 10:
7554
7662
  case "end":
7555
- return _context30.stop();
7663
+ return _context31.stop();
7556
7664
  }
7557
- }, _callee30, this);
7665
+ }, _callee31, this);
7558
7666
  }));
7559
- function enableMusicMode(_x27) {
7667
+ function enableMusicMode(_x30) {
7560
7668
  return _enableMusicMode.apply(this, arguments);
7561
7669
  }
7562
7670
  return enableMusicMode;
@@ -7621,25 +7729,25 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7621
7729
  }, {
7622
7730
  key: "publishStream",
7623
7731
  value: (function () {
7624
- var _publishStream = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee31(mediaType, stream) {
7625
- return _regenerator.default.wrap(function _callee31$(_context31) {
7626
- while (1) switch (_context31.prev = _context31.next) {
7732
+ var _publishStream = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee32(mediaType, stream) {
7733
+ return _regenerator.default.wrap(function _callee32$(_context32) {
7734
+ while (1) switch (_context32.prev = _context32.next) {
7627
7735
  case 0:
7628
7736
  if (stream) {
7629
- _context31.next = 2;
7737
+ _context32.next = 2;
7630
7738
  break;
7631
7739
  }
7632
- return _context31.abrupt("return");
7740
+ return _context32.abrupt("return");
7633
7741
  case 2:
7634
7742
  if (!this.mediaProperties.webrtcMediaConnection) {
7635
- _context31.next = 7;
7743
+ _context32.next = 7;
7636
7744
  break;
7637
7745
  }
7638
7746
  if (!(this.isMultistream && this.mediaProperties.webrtcMediaConnection)) {
7639
- _context31.next = 6;
7747
+ _context32.next = 6;
7640
7748
  break;
7641
7749
  }
7642
- _context31.next = 6;
7750
+ _context32.next = 6;
7643
7751
  return this.sendSlotManager.publishStream(mediaType, stream);
7644
7752
  case 6:
7645
7753
  this.emitPublishStateChangeEvent({
@@ -7650,11 +7758,11 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7650
7758
  });
7651
7759
  case 7:
7652
7760
  case "end":
7653
- return _context31.stop();
7761
+ return _context32.stop();
7654
7762
  }
7655
- }, _callee31, this);
7763
+ }, _callee32, this);
7656
7764
  }));
7657
- function publishStream(_x28, _x29) {
7765
+ function publishStream(_x31, _x32) {
7658
7766
  return _publishStream.apply(this, arguments);
7659
7767
  }
7660
7768
  return publishStream;
@@ -7670,21 +7778,21 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7670
7778
  }, {
7671
7779
  key: "unpublishStream",
7672
7780
  value: (function () {
7673
- var _unpublishStream = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee32(mediaType, stream) {
7674
- return _regenerator.default.wrap(function _callee32$(_context32) {
7675
- while (1) switch (_context32.prev = _context32.next) {
7781
+ var _unpublishStream = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee33(mediaType, stream) {
7782
+ return _regenerator.default.wrap(function _callee33$(_context33) {
7783
+ while (1) switch (_context33.prev = _context33.next) {
7676
7784
  case 0:
7677
7785
  if (stream) {
7678
- _context32.next = 2;
7786
+ _context33.next = 2;
7679
7787
  break;
7680
7788
  }
7681
- return _context32.abrupt("return");
7789
+ return _context33.abrupt("return");
7682
7790
  case 2:
7683
7791
  if (!(this.isMultistream && this.mediaProperties.webrtcMediaConnection)) {
7684
- _context32.next = 5;
7792
+ _context33.next = 5;
7685
7793
  break;
7686
7794
  }
7687
- _context32.next = 5;
7795
+ _context33.next = 5;
7688
7796
  return this.sendSlotManager.unpublishStream(mediaType);
7689
7797
  case 5:
7690
7798
  this.emitPublishStateChangeEvent({
@@ -7695,11 +7803,11 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7695
7803
  });
7696
7804
  case 6:
7697
7805
  case "end":
7698
- return _context32.stop();
7806
+ return _context33.stop();
7699
7807
  }
7700
- }, _callee32, this);
7808
+ }, _callee33, this);
7701
7809
  }));
7702
- function unpublishStream(_x30, _x31) {
7810
+ function unpublishStream(_x33, _x34) {
7703
7811
  return _unpublishStream.apply(this, arguments);
7704
7812
  }
7705
7813
  return unpublishStream;
@@ -7714,72 +7822,88 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7714
7822
  }, {
7715
7823
  key: "publishStreams",
7716
7824
  value: (function () {
7717
- var _publishStreams = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee33(streams) {
7825
+ var _publishStreams = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee34(streams) {
7718
7826
  var _streams$screenShare, _streams$screenShare2, _streams$screenShare3, _streams$screenShare4;
7719
7827
  var floorRequestNeeded, _streams$screenShare5;
7720
- return _regenerator.default.wrap(function _callee33$(_context33) {
7721
- while (1) switch (_context33.prev = _context33.next) {
7828
+ return _regenerator.default.wrap(function _callee34$(_context34) {
7829
+ while (1) switch (_context34.prev = _context34.next) {
7722
7830
  case 0:
7723
7831
  this.checkMediaConnection();
7724
7832
  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))) {
7725
- _context33.next = 3;
7833
+ _context34.next = 3;
7726
7834
  break;
7727
7835
  }
7728
- return _context33.abrupt("return");
7836
+ return _context34.abrupt("return");
7729
7837
  case 3:
7730
7838
  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
7731
7839
  if (!(this.isMultistream && (_streams$screenShare3 = streams.screenShare) !== null && _streams$screenShare3 !== void 0 && _streams$screenShare3.audio)) {
7732
- _context33.next = 8;
7840
+ _context34.next = 8;
7733
7841
  break;
7734
7842
  }
7735
- _context33.next = 7;
7843
+ _context34.next = 7;
7736
7844
  return this.setLocalShareAudioStream(streams.screenShare.audio);
7737
7845
  case 7:
7738
7846
  floorRequestNeeded = this.screenShareFloorState === ScreenShareFloorStatus.RELEASED;
7739
7847
  case 8:
7740
7848
  if (!((_streams$screenShare4 = streams.screenShare) !== null && _streams$screenShare4 !== void 0 && _streams$screenShare4.video)) {
7741
- _context33.next = 12;
7849
+ _context34.next = 12;
7742
7850
  break;
7743
7851
  }
7744
- _context33.next = 11;
7852
+ _context34.next = 11;
7745
7853
  return this.setLocalShareVideoStream((_streams$screenShare5 = streams.screenShare) === null || _streams$screenShare5 === void 0 ? void 0 : _streams$screenShare5.video);
7746
7854
  case 11:
7747
7855
  floorRequestNeeded = this.screenShareFloorState === ScreenShareFloorStatus.RELEASED;
7748
7856
  case 12:
7749
7857
  if (!streams.microphone) {
7750
- _context33.next = 15;
7858
+ _context34.next = 15;
7751
7859
  break;
7752
7860
  }
7753
- _context33.next = 15;
7861
+ _context34.next = 15;
7754
7862
  return this.setLocalAudioStream(streams.microphone);
7755
7863
  case 15:
7756
7864
  if (!streams.camera) {
7757
- _context33.next = 18;
7865
+ _context34.next = 18;
7758
7866
  break;
7759
7867
  }
7760
- _context33.next = 18;
7868
+ _context34.next = 18;
7761
7869
  return this.setLocalVideoStream(streams.camera);
7762
7870
  case 18:
7763
7871
  if (this.isMultistream) {
7764
- _context33.next = 21;
7872
+ _context34.next = 21;
7765
7873
  break;
7766
7874
  }
7767
- _context33.next = 21;
7875
+ _context34.next = 21;
7768
7876
  return this.updateTranscodedMediaConnection();
7769
7877
  case 21:
7770
7878
  if (!floorRequestNeeded) {
7771
- _context33.next = 24;
7879
+ _context34.next = 26;
7772
7880
  break;
7773
7881
  }
7774
- _context33.next = 24;
7882
+ this.localShareInstanceId = _uuid.default.v4();
7883
+
7884
+ // @ts-ignore
7885
+ this.webex.internal.newMetrics.submitClientEvent({
7886
+ name: 'client.share.initiated',
7887
+ payload: {
7888
+ mediaType: 'share',
7889
+ shareInstanceId: this.localShareInstanceId
7890
+ },
7891
+ options: {
7892
+ meetingId: this.id
7893
+ }
7894
+ });
7895
+ // we're sending the http request to Locus to request the screen share floor
7896
+ // only after the SDP update, because that's how it's always been done for transcoded meetings
7897
+ // and also if sharing from the start, we need confluence to have been created
7898
+ _context34.next = 26;
7775
7899
  return this.enqueueScreenShareFloorRequest();
7776
- case 24:
7900
+ case 26:
7777
7901
  case "end":
7778
- return _context33.stop();
7902
+ return _context34.stop();
7779
7903
  }
7780
- }, _callee33, this);
7904
+ }, _callee34, this);
7781
7905
  }));
7782
- function publishStreams(_x32) {
7906
+ function publishStreams(_x35) {
7783
7907
  return _publishStreams.apply(this, arguments);
7784
7908
  }
7785
7909
  return publishStreams;
@@ -7794,10 +7918,10 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7794
7918
  }, {
7795
7919
  key: "unpublishStreams",
7796
7920
  value: (function () {
7797
- var _unpublishStreams = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee34(streams) {
7921
+ var _unpublishStreams = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee35(streams) {
7798
7922
  var promises, _iterator, _step, stream;
7799
- return _regenerator.default.wrap(function _callee34$(_context34) {
7800
- while (1) switch (_context34.prev = _context34.next) {
7923
+ return _regenerator.default.wrap(function _callee35$(_context35) {
7924
+ while (1) switch (_context35.prev = _context35.next) {
7801
7925
  case 0:
7802
7926
  this.checkMediaConnection();
7803
7927
  promises = [];
@@ -7828,7 +7952,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7828
7952
  if (!this.isMultistream) {
7829
7953
  promises.push(this.updateTranscodedMediaConnection());
7830
7954
  }
7831
- _context34.next = 7;
7955
+ _context35.next = 7;
7832
7956
  return _promise.default.all(promises);
7833
7957
  case 7:
7834
7958
  // we're allowing for the SDK to support just audio share as well
@@ -7843,11 +7967,11 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7843
7967
  }
7844
7968
  case 8:
7845
7969
  case "end":
7846
- return _context34.stop();
7970
+ return _context35.stop();
7847
7971
  }
7848
- }, _callee34, this);
7972
+ }, _callee35, this);
7849
7973
  }));
7850
- function unpublishStreams(_x33) {
7974
+ function unpublishStreams(_x36) {
7851
7975
  return _unpublishStreams.apply(this, arguments);
7852
7976
  }
7853
7977
  return unpublishStreams;
@@ -7907,27 +8031,27 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7907
8031
  }], [{
7908
8032
  key: "handleDeviceLogging",
7909
8033
  value: (function () {
7910
- var _handleDeviceLogging = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee35() {
8034
+ var _handleDeviceLogging = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee36() {
7911
8035
  var devices;
7912
- return _regenerator.default.wrap(function _callee35$(_context35) {
7913
- while (1) switch (_context35.prev = _context35.next) {
8036
+ return _regenerator.default.wrap(function _callee36$(_context36) {
8037
+ while (1) switch (_context36.prev = _context36.next) {
7914
8038
  case 0:
7915
- _context35.prev = 0;
7916
- _context35.next = 3;
8039
+ _context36.prev = 0;
8040
+ _context36.next = 3;
7917
8041
  return (0, _mediaHelpers.getDevices)();
7918
8042
  case 3:
7919
- devices = _context35.sent;
8043
+ devices = _context36.sent;
7920
8044
  _util.default.handleDeviceLogging(devices);
7921
- _context35.next = 9;
8045
+ _context36.next = 9;
7922
8046
  break;
7923
8047
  case 7:
7924
- _context35.prev = 7;
7925
- _context35.t0 = _context35["catch"](0);
8048
+ _context36.prev = 7;
8049
+ _context36.t0 = _context36["catch"](0);
7926
8050
  case 9:
7927
8051
  case "end":
7928
- return _context35.stop();
8052
+ return _context36.stop();
7929
8053
  }
7930
- }, _callee35, null, [[0, 7]]);
8054
+ }, _callee36, null, [[0, 7]]);
7931
8055
  }));
7932
8056
  function handleDeviceLogging() {
7933
8057
  return _handleDeviceLogging.apply(this, arguments);