@webex/plugin-meetings 2.35.4 → 2.36.0

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.
@@ -132,6 +132,8 @@ var _browserDetection = _interopRequireDefault(require("../common/browser-detect
132
132
 
133
133
  var _collection = _interopRequireDefault(require("../roap/collection"));
134
134
 
135
+ var _reactions = require("../reactions/reactions");
136
+
135
137
  var _inMeetingActions = _interopRequireDefault(require("./in-meeting-actions"));
136
138
 
137
139
  function ownKeys(object, enumerableOnly) { var keys = _Object$keys2(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
@@ -1957,7 +1959,7 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
1957
1959
 
1958
1960
 
1959
1961
  if (_this7.floorGrantPending && payload.newSelf.state === _constants.MEETING_STATE.STATES.JOINED) {
1960
- _this7.share().then(function () {
1962
+ _this7.requestScreenShareFloor().then(function () {
1961
1963
  _this7.floorGrantPending = false;
1962
1964
  });
1963
1965
  }
@@ -2241,7 +2243,7 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
2241
2243
  case _constants.SHARE_STATUS.LOCAL_SHARE_ACTIVE:
2242
2244
  _triggerProxy.default.trigger(_this12, {
2243
2245
  file: 'meeting/index',
2244
- function: 'stopFloorRequest'
2246
+ function: 'localShare'
2245
2247
  }, _constants.EVENT_TRIGGERS.MEETING_STOPPED_SHARING_LOCAL, {
2246
2248
  reason: _constants.SHARE_STOPPED_REASON.SELF_STOPPED
2247
2249
  });
@@ -4499,7 +4501,7 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
4499
4501
  }
4500
4502
 
4501
4503
  _context4.next = 4;
4502
- return _this36.stopFloorRequest();
4504
+ return _this36.releaseScreenShareFloor();
4503
4505
 
4504
4506
  case 4:
4505
4507
  mediaSettings = {
@@ -4812,7 +4814,7 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
4812
4814
 
4813
4815
  if (mediaSettings && mediaSettings.sendShare && localShare) {
4814
4816
  if (_this38.state === _constants.MEETING_STATE.STATES.JOINED) {
4815
- return _this38.share();
4817
+ return _this38.requestScreenShareFloor();
4816
4818
  } // When the self state changes to JOINED then request the floor
4817
4819
 
4818
4820
 
@@ -4991,7 +4993,7 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
4991
4993
  // we actually get a OFFER from the server and a GLAR condition happens
4992
4994
  if (startShare) {
4993
4995
  // We are assuming that the clients are connected when doing an update
4994
- return _this40.share();
4996
+ return _this40.requestScreenShareFloor();
4995
4997
  }
4996
4998
 
4997
4999
  return _promise.default.resolve();
@@ -5193,7 +5195,7 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
5193
5195
 
5194
5196
  if (!sendShare && previousShareStatus) {
5195
5197
  // When user stops sharing
5196
- return this.stopFloorRequest().then(function () {
5198
+ return this.releaseScreenShareFloor().then(function () {
5197
5199
  return _promise.default.resolve(false);
5198
5200
  });
5199
5201
  }
@@ -5255,7 +5257,7 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
5255
5257
  id: _this43.id
5256
5258
  }).then(function () {
5257
5259
  if (startShare) {
5258
- return _this43.share();
5260
+ return _this43.requestScreenShareFloor();
5259
5261
  }
5260
5262
 
5261
5263
  return _promise.default.resolve();
@@ -5562,15 +5564,15 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
5562
5564
  return _promise.default.reject(new _parameter.default('Cannot stop share without whiteboard.'));
5563
5565
  }
5564
5566
  /**
5565
- * Start sharing content with server
5567
+ * Sends a request to Locus to obtain the screen share floor
5566
5568
  * @returns {Promise} see #meetingRequest.changeMeetingFloor
5567
5569
  * @private
5568
5570
  * @memberof Meeting
5569
5571
  */
5570
5572
 
5571
5573
  }, {
5572
- key: "share",
5573
- value: function share() {
5574
+ key: "requestScreenShareFloor",
5575
+ value: function requestScreenShareFloor() {
5574
5576
  var _this49 = this;
5575
5577
 
5576
5578
  var content = this.locusInfo.mediaShares.find(function (element) {
@@ -5627,15 +5629,15 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
5627
5629
  }, options));
5628
5630
  }
5629
5631
  /**
5630
- * sends stops floor request
5632
+ * Sends a request to Locus to release the screen share floor.
5631
5633
  * @returns {Promise} see #meetingRequest.changeMeetingFloor
5632
5634
  * @private
5633
5635
  * @memberof Meeting
5634
5636
  */
5635
5637
 
5636
5638
  }, {
5637
- key: "stopFloorRequest",
5638
- value: function stopFloorRequest() {
5639
+ key: "releaseScreenShareFloor",
5640
+ value: function releaseScreenShareFloor() {
5639
5641
  var _this50 = this;
5640
5642
 
5641
5643
  var content = this.locusInfo.mediaShares.find(function (element) {
@@ -5663,7 +5665,7 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
5663
5665
  uri: content.url,
5664
5666
  resourceUrl: this.resourceUrl
5665
5667
  }).catch(function (error) {
5666
- _loggerProxy.default.logger.error('Meeting:index#stopFloorRequest --> Error ', error);
5668
+ _loggerProxy.default.logger.error('Meeting:index#releaseScreenShareFloor --> Error ', error);
5667
5669
 
5668
5670
  _metrics.default.sendBehavioralMetric(_constants2.default.STOP_FLOOR_REQUEST_FAILURE, {
5669
5671
  correlation_id: _this50.correlationId,
@@ -6584,6 +6586,45 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
6584
6586
  * @memberof Meeting
6585
6587
  */
6586
6588
 
6589
+ }, {
6590
+ key: "sendReaction",
6591
+ value:
6592
+ /**
6593
+ * Send a reaction inside the meeting.
6594
+ *
6595
+ * @param {ReactionType} reactionType - type of reaction to be sent. Example: "thumbs_up"
6596
+ * @param {SkinToneType} skinToneType - skin tone for the reaction. Example: "medium_dark"
6597
+ * @returns {Promise}
6598
+ * @public
6599
+ * @memberof Meeting
6600
+ */
6601
+ function sendReaction(reactionType, skinToneType) {
6602
+ var _this$locusInfo, _this$locusInfo$contr2, _this$locusInfo$contr3;
6603
+
6604
+ var reactionChannelUrl = (_this$locusInfo = this.locusInfo) === null || _this$locusInfo === void 0 ? void 0 : (_this$locusInfo$contr2 = _this$locusInfo.controls) === null || _this$locusInfo$contr2 === void 0 ? void 0 : (_this$locusInfo$contr3 = _this$locusInfo$contr2.reactions) === null || _this$locusInfo$contr3 === void 0 ? void 0 : _this$locusInfo$contr3.reactionChannelUrl;
6605
+ var participantId = this.members.selfId;
6606
+ var reactionData = _reactions.Reactions[reactionType];
6607
+
6608
+ if (!reactionData) {
6609
+ return _promise.default.reject(new Error("".concat(reactionType, " is not a valid reaction.")));
6610
+ }
6611
+
6612
+ var skinToneData = _reactions.SkinTones[skinToneType] || _reactions.SkinTones.normal;
6613
+
6614
+ var reaction = _objectSpread(_objectSpread({}, reactionData), {}, {
6615
+ tone: skinToneData
6616
+ });
6617
+
6618
+ if (reactionChannelUrl) {
6619
+ return this.meetingRequest.sendReaction({
6620
+ reactionChannelUrl: reactionChannelUrl,
6621
+ reaction: reaction,
6622
+ participantId: participantId
6623
+ });
6624
+ }
6625
+
6626
+ return _promise.default.reject(new Error('Error sending reaction, service url not found.'));
6627
+ }
6587
6628
  }]);
6588
6629
  return Meeting;
6589
6630
  }(_webexCore.StatelessWebexPlugin);