@webex/plugin-meetings 3.0.0-beta.326 → 3.0.0-beta.328

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.
@@ -209,7 +209,7 @@ var Breakout = _webexCore.WebexPlugin.extend({
209
209
  sessionId: this.sessionId
210
210
  });
211
211
  },
212
- version: "3.0.0-beta.326"
212
+ version: "3.0.0-beta.328"
213
213
  });
214
214
  var _default = Breakout;
215
215
  exports.default = _default;
@@ -1041,7 +1041,7 @@ var Breakouts = _webexCore.WebexPlugin.extend({
1041
1041
  this.trigger(_constants.BREAKOUTS.EVENTS.ASK_RETURN_TO_MAIN);
1042
1042
  }
1043
1043
  },
1044
- version: "3.0.0-beta.326"
1044
+ version: "3.0.0-beta.328"
1045
1045
  });
1046
1046
  var _default = Breakouts;
1047
1047
  exports.default = _default;
@@ -359,7 +359,7 @@ var SimultaneousInterpretation = _webexCore.WebexPlugin.extend({
359
359
  throw error;
360
360
  });
361
361
  },
362
- version: "3.0.0-beta.326"
362
+ version: "3.0.0-beta.328"
363
363
  });
364
364
  var _default = SimultaneousInterpretation;
365
365
  exports.default = _default;
@@ -18,7 +18,7 @@ var SILanguage = _webexCore.WebexPlugin.extend({
18
18
  languageCode: 'number',
19
19
  languageName: 'string'
20
20
  },
21
- version: "3.0.0-beta.326"
21
+ version: "3.0.0-beta.328"
22
22
  });
23
23
  var _default = SILanguage;
24
24
  exports.default = _default;
@@ -379,7 +379,7 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
379
379
  * @memberof Meeting
380
380
  */
381
381
  function Meeting(attrs, _options) {
382
- var _this$locusInfo, _this$locusInfo$links, _this$locusInfo$links2, _this$locusInfo$links3, _this$locusInfo2, _this$locusInfo2$full, _this$locusInfo3, _this$locusInfo4;
382
+ var _attrs$callStateForMe, _this$locusInfo, _this$locusInfo$links, _this$locusInfo$links2, _this$locusInfo$links3, _this$locusInfo2, _this$locusInfo2$full, _this$locusInfo3, _this$locusInfo4;
383
383
  var _this;
384
384
  (0, _classCallCheck2.default)(this, Meeting);
385
385
  _this = _super.call(this, {}, _options);
@@ -397,7 +397,7 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
397
397
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "annotation", void 0);
398
398
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "webinar", void 0);
399
399
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "conversationUrl", void 0);
400
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "correlationId", void 0);
400
+ (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "callStateForMetrics", void 0);
401
401
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "destination", void 0);
402
402
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "destinationType", void 0);
403
403
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "deviceUrl", void 0);
@@ -1055,6 +1055,13 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
1055
1055
  }
1056
1056
  }, _callee2, null, [[4, 9]]);
1057
1057
  })));
1058
+ (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "handleShareVideoStreamMuteStateChange", function (muted) {
1059
+ _loggerProxy.default.logger.log("Meeting:index#handleShareVideoStreamMuteStateChange --> Share video stream mute state changed to muted ".concat(muted));
1060
+ _metrics.default.sendBehavioralMetric(_constants2.default.MEETING_SHARE_VIDEO_MUTE_STATE_CHANGE, {
1061
+ correlationId: _this.correlationId,
1062
+ muted: muted
1063
+ });
1064
+ });
1058
1065
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "handleShareVideoStreamEnded", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3() {
1059
1066
  return _regenerator.default.wrap(function _callee3$(_context3) {
1060
1067
  while (1) switch (_context3.prev = _context3.next) {
@@ -1166,18 +1173,20 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
1166
1173
  */
1167
1174
  _this.id = _uuid.default.v4();
1168
1175
  /**
1169
- * Correlation ID used for network tracking of meeting
1176
+ * Call state used for metrics
1170
1177
  * @instance
1171
- * @type {String}
1178
+ * @type {CallStateForMetrics}
1172
1179
  * @readonly
1173
1180
  * @public
1174
1181
  * @memberof Meeting
1175
1182
  */
1176
- if (attrs.correlationId) {
1177
- _loggerProxy.default.logger.log("Meetings:index#constructor --> Initializing the meeting object with correlation id from app ".concat(_this.correlationId));
1178
- _this.correlationId = attrs.correlationId;
1183
+ _this.callStateForMetrics = attrs.callStateForMetrics || {};
1184
+ var _correlationId = attrs.correlationId || ((_attrs$callStateForMe = attrs.callStateForMetrics) === null || _attrs$callStateForMe === void 0 ? void 0 : _attrs$callStateForMe.correlationId);
1185
+ if (_correlationId) {
1186
+ _loggerProxy.default.logger.log("Meetings:index#constructor --> Initializing the meeting object with correlation id from app ".concat(_correlationId));
1187
+ _this.callStateForMetrics.correlationId = _correlationId;
1179
1188
  } else {
1180
- _this.correlationId = _this.id;
1189
+ _this.callStateForMetrics.correlationId = _this.id;
1181
1190
  }
1182
1191
  /**
1183
1192
  * @instance
@@ -1895,6 +1904,24 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
1895
1904
  return this.type === 'CALL';
1896
1905
  }
1897
1906
 
1907
+ /**
1908
+ * Getter - Returns callStateForMetrics.correlationId
1909
+ * @returns {string}
1910
+ */
1911
+ }, {
1912
+ key: "correlationId",
1913
+ get: function get() {
1914
+ return this.callStateForMetrics.correlationId;
1915
+ }
1916
+
1917
+ /**
1918
+ * Setter - sets callStateForMetrics.correlationId
1919
+ * @param {string} correlationId
1920
+ */,
1921
+ set: function set(correlationId) {
1922
+ this.callStateForMetrics.correlationId = correlationId;
1923
+ }
1924
+
1898
1925
  /**
1899
1926
  * Internal method for fetching meeting info
1900
1927
  *
@@ -2017,7 +2044,7 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
2017
2044
  value: function () {
2018
2045
  var _refreshPermissionToken = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee5(reason) {
2019
2046
  var _this$meetingInfo;
2020
- var isStartingSpaceInstantV2Meeting, destination, destinationType, timeLeft;
2047
+ var isStartingSpaceInstantV2Meeting, destination, destinationType, _this$getPermissionTo, timeLeft, expiryTime, currentTime;
2021
2048
  return _regenerator.default.wrap(function _callee5$(_context5) {
2022
2049
  while (1) switch (_context5.prev = _context5.next) {
2023
2050
  case 0:
@@ -2035,11 +2062,13 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
2035
2062
  this.webex.meetings.preferredWebexSite;
2036
2063
  destination = isStartingSpaceInstantV2Meeting ? this.meetingInfo.meetingJoinUrl : this.destination;
2037
2064
  destinationType = isStartingSpaceInstantV2Meeting ? _constants._MEETING_LINK_ : this.destinationType;
2038
- timeLeft = this.getPermissionTokenTimeLeftInSec();
2039
- _loggerProxy.default.logger.info("Meeting:index#refreshPermissionToken --> refreshing permission token, destinationType=".concat(destinationType, ", timeLeft=").concat(timeLeft, ", reason=").concat(reason));
2065
+ _this$getPermissionTo = this.getPermissionTokenExpiryInfo(), timeLeft = _this$getPermissionTo.timeLeft, expiryTime = _this$getPermissionTo.expiryTime, currentTime = _this$getPermissionTo.currentTime;
2066
+ _loggerProxy.default.logger.info("Meeting:index#refreshPermissionToken --> refreshing permission token, destinationType=".concat(destinationType, ", timeLeft=").concat(timeLeft, ", permissionTokenExpiry=").concat(expiryTime, ", currentTimestamp=").concat(currentTime, ",reason=").concat(reason));
2040
2067
  _metrics.default.sendBehavioralMetric(_constants2.default.PERMISSION_TOKEN_REFRESH, {
2041
2068
  correlationId: this.correlationId,
2042
2069
  timeLeft: timeLeft,
2070
+ expiryTime: expiryTime,
2071
+ currentTime: currentTime,
2043
2072
  reason: reason,
2044
2073
  destinationType: destinationType
2045
2074
  });
@@ -4025,22 +4054,24 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
4025
4054
  while (1) switch (_context11.prev = _context11.next) {
4026
4055
  case 0:
4027
4056
  oldStream = this.mediaProperties.shareVideoStream;
4057
+ oldStream === null || oldStream === void 0 ? void 0 : oldStream.off(_mediaHelpers.StreamEventNames.MuteStateChange, this.handleShareVideoStreamMuteStateChange);
4028
4058
  oldStream === null || oldStream === void 0 ? void 0 : oldStream.off(_mediaHelpers.StreamEventNames.Ended, this.handleShareVideoStreamEnded);
4029
4059
  oldStream === null || oldStream === void 0 ? void 0 : oldStream.off(_mediaHelpers.LocalStreamEventNames.OutputTrackChange, this.localOutputTrackChangeHandler);
4030
4060
  this.mediaProperties.setLocalShareVideoStream(localDisplayStream);
4061
+ localDisplayStream === null || localDisplayStream === void 0 ? void 0 : localDisplayStream.on(_mediaHelpers.StreamEventNames.MuteStateChange, this.handleShareVideoStreamMuteStateChange);
4031
4062
  localDisplayStream === null || localDisplayStream === void 0 ? void 0 : localDisplayStream.on(_mediaHelpers.StreamEventNames.Ended, this.handleShareVideoStreamEnded);
4032
4063
  localDisplayStream === null || localDisplayStream === void 0 ? void 0 : localDisplayStream.on(_mediaHelpers.LocalStreamEventNames.OutputTrackChange, this.localOutputTrackChangeHandler);
4033
4064
  this.mediaProperties.mediaDirection.sendShare = this.mediaProperties.hasLocalShareStream();
4034
4065
  if (!(!this.isMultistream || !localDisplayStream)) {
4035
- _context11.next = 10;
4066
+ _context11.next = 12;
4036
4067
  break;
4037
4068
  }
4038
- _context11.next = 10;
4039
- return this.unpublishStream(_internalMediaCore.MediaType.VideoSlides, oldStream);
4040
- case 10:
4041
4069
  _context11.next = 12;
4042
- return this.publishStream(_internalMediaCore.MediaType.VideoSlides, this.mediaProperties.shareVideoStream);
4070
+ return this.unpublishStream(_internalMediaCore.MediaType.VideoSlides, oldStream);
4043
4071
  case 12:
4072
+ _context11.next = 14;
4073
+ return this.publishStream(_internalMediaCore.MediaType.VideoSlides, this.mediaProperties.shareVideoStream);
4074
+ case 14:
4044
4075
  case "end":
4045
4076
  return _context11.stop();
4046
4077
  }
@@ -4135,9 +4166,10 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
4135
4166
  audioStream === null || audioStream === void 0 ? void 0 : audioStream.off(_mediaHelpers.LocalStreamEventNames.OutputTrackChange, this.localOutputTrackChangeHandler);
4136
4167
  videoStream === null || videoStream === void 0 ? void 0 : videoStream.off(_mediaHelpers.StreamEventNames.MuteStateChange, this.localVideoStreamMuteStateHandler);
4137
4168
  videoStream === null || videoStream === void 0 ? void 0 : videoStream.off(_mediaHelpers.LocalStreamEventNames.OutputTrackChange, this.localOutputTrackChangeHandler);
4138
- shareAudioStream === null || shareAudioStream === void 0 ? void 0 : shareAudioStream.off(_mediaHelpers.StreamEventNames.MuteStateChange, this.handleShareAudioStreamEnded);
4169
+ shareAudioStream === null || shareAudioStream === void 0 ? void 0 : shareAudioStream.off(_mediaHelpers.StreamEventNames.Ended, this.handleShareAudioStreamEnded);
4139
4170
  shareAudioStream === null || shareAudioStream === void 0 ? void 0 : shareAudioStream.off(_mediaHelpers.LocalStreamEventNames.OutputTrackChange, this.localOutputTrackChangeHandler);
4140
- shareVideoStream === null || shareVideoStream === void 0 ? void 0 : shareVideoStream.off(_mediaHelpers.StreamEventNames.MuteStateChange, this.handleShareVideoStreamEnded);
4171
+ shareVideoStream === null || shareVideoStream === void 0 ? void 0 : shareVideoStream.off(_mediaHelpers.StreamEventNames.MuteStateChange, this.handleShareVideoStreamMuteStateChange);
4172
+ shareVideoStream === null || shareVideoStream === void 0 ? void 0 : shareVideoStream.off(_mediaHelpers.StreamEventNames.Ended, this.handleShareVideoStreamEnded);
4141
4173
  shareVideoStream === null || shareVideoStream === void 0 ? void 0 : shareVideoStream.off(_mediaHelpers.LocalStreamEventNames.OutputTrackChange, this.localOutputTrackChangeHandler);
4142
4174
  this.mediaProperties.setLocalAudioStream(undefined);
4143
4175
  this.mediaProperties.setLocalVideoStream(undefined);
@@ -4279,8 +4311,8 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
4279
4311
  }
4280
4312
 
4281
4313
  /**
4282
- * Convenience method to set the correlation id for the Meeting
4283
- * @param {String} id correlation id to set on the class
4314
+ * Convenience method to set the correlation id for the callStateForMetrics
4315
+ * @param {String} id correlation id to set on the callStateForMetrics
4284
4316
  * @returns {undefined}
4285
4317
  * @public
4286
4318
  * @memberof Meeting
@@ -4288,7 +4320,20 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
4288
4320
  }, {
4289
4321
  key: "setCorrelationId",
4290
4322
  value: function setCorrelationId(id) {
4291
- this.correlationId = id;
4323
+ this.callStateForMetrics.correlationId = id;
4324
+ }
4325
+
4326
+ /**
4327
+ * Update the callStateForMetrics
4328
+ * @param {CallStateForMetrics} callStateForMetrics updated values for callStateForMetrics
4329
+ * @returns {undefined}
4330
+ * @public
4331
+ * @memberof Meeting
4332
+ */
4333
+ }, {
4334
+ key: "updateCallStateForMetrics",
4335
+ value: function updateCallStateForMetrics(callStateForMetrics) {
4336
+ this.callStateForMetrics = _objectSpread(_objectSpread({}, this.callStateForMetrics), callStateForMetrics);
4292
4337
  }
4293
4338
 
4294
4339
  /**
@@ -4860,7 +4905,7 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
4860
4905
  this.webex.internal.newMetrics.submitClientEvent({
4861
4906
  name: 'client.call.initiated',
4862
4907
  payload: {
4863
- trigger: 'user-interaction',
4908
+ trigger: this.callStateForMetrics.joinTrigger || 'user-interaction',
4864
4909
  isRoapCallEnabled: true,
4865
4910
  pstnAudioType: options === null || options === void 0 ? void 0 : options.pstnAudioType
4866
4911
  },
@@ -6706,6 +6751,10 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
6706
6751
  resourceUrl: this.resourceUrl
6707
6752
  }).then(function () {
6708
6753
  _this46.screenShareFloorState = ScreenShareFloorStatus.GRANTED;
6754
+ _metrics.default.sendBehavioralMetric(_constants2.default.MEETING_SHARE_SUCCESS, {
6755
+ correlation_id: _this46.correlationId,
6756
+ locus_id: _this46.locusUrl.split('/').pop()
6757
+ });
6709
6758
  return _promise.default.resolve();
6710
6759
  }).catch(function (error) {
6711
6760
  _loggerProxy.default.logger.error('Meeting:index#share --> Error ', error);
@@ -7595,14 +7644,14 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
7595
7644
  return unpublishStreams;
7596
7645
  }()
7597
7646
  /**
7598
- * Gets the time left in seconds till the permission token expires
7647
+ * Gets permission token expiry information including timeLeft, expiryTime, currentTime
7599
7648
  * (from the time the function has been fired)
7600
7649
  *
7601
- * @returns {number} time left in seconds
7650
+ * @returns {object} containing timeLeft, expiryTime, currentTime
7602
7651
  */
7603
7652
  }, {
7604
- key: "getPermissionTokenTimeLeftInSec",
7605
- value: function getPermissionTokenTimeLeftInSec() {
7653
+ key: "getPermissionTokenExpiryInfo",
7654
+ value: function getPermissionTokenExpiryInfo() {
7606
7655
  if (!this.permissionTokenPayload) {
7607
7656
  return undefined;
7608
7657
  }
@@ -7614,7 +7663,12 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
7614
7663
 
7615
7664
  // substract current time from the permissionTokenExp
7616
7665
  // (permissionTokenExp is a epoch timestamp, not a time to live duration)
7617
- return (permissionTokenExpValue - now) / 1000;
7666
+ var timeLeft = (permissionTokenExpValue - now) / 1000;
7667
+ return {
7668
+ timeLeft: timeLeft,
7669
+ expiryTime: permissionTokenExpValue,
7670
+ currentTime: now
7671
+ };
7618
7672
  }
7619
7673
 
7620
7674
  /**
@@ -7628,8 +7682,9 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
7628
7682
  }, {
7629
7683
  key: "checkAndRefreshPermissionToken",
7630
7684
  value: function checkAndRefreshPermissionToken(threshold, reason) {
7631
- var permissionTokenTimeLeft = this.getPermissionTokenTimeLeftInSec();
7632
- if (permissionTokenTimeLeft !== undefined && permissionTokenTimeLeft <= threshold) {
7685
+ var _this$getPermissionTo2 = this.getPermissionTokenExpiryInfo(),
7686
+ timeLeft = _this$getPermissionTo2.timeLeft;
7687
+ if (timeLeft !== undefined && timeLeft <= threshold) {
7633
7688
  return this.refreshPermissionToken(reason);
7634
7689
  }
7635
7690
  return _promise.default.resolve();