@webex/plugin-meetings 2.29.0 → 2.29.2

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.
@@ -705,6 +705,54 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
705
705
  _this.transcription = undefined;
706
706
  }
707
707
  });
708
+ (0, _defineProperty3.default)((0, _assertThisInitialized2.default)(_this), "startKeepAlive", function () {
709
+ var _this$joinedWith, _this$joinedWith2;
710
+
711
+ if (_this.keepAliveTimerId) {
712
+ _loggerProxy.default.logger.warn('Meeting:index#startKeepAlive --> keepAlive not started: keepAliveTimerId already exists');
713
+
714
+ return;
715
+ }
716
+
717
+ if (!((_this$joinedWith = _this.joinedWith) !== null && _this$joinedWith !== void 0 && _this$joinedWith.keepAliveUrl)) {
718
+ _loggerProxy.default.logger.warn('Meeting:index#startKeepAlive --> keepAlive not started: no keepAliveUrl');
719
+
720
+ return;
721
+ }
722
+
723
+ if (!((_this$joinedWith2 = _this.joinedWith) !== null && _this$joinedWith2 !== void 0 && _this$joinedWith2.keepAliveSecs)) {
724
+ _loggerProxy.default.logger.warn('Meeting:index#startKeepAlive --> keepAlive not started: no keepAliveSecs');
725
+
726
+ return;
727
+ }
728
+
729
+ if (_this.joinedWith.keepAliveSecs <= 1) {
730
+ _loggerProxy.default.logger.warn('Meeting:index#startKeepAlive --> keepAlive not started: keepAliveSecs <= 1');
731
+
732
+ return;
733
+ }
734
+
735
+ var keepAliveUrl = _this.joinedWith.keepAliveUrl;
736
+ var keepAliveInterval = (_this.joinedWith.keepAliveSecs - 1) * 750; // taken from UCF
737
+
738
+ _this.keepAliveTimerId = setInterval(function () {
739
+ _this.meetingRequest.keepAlive({
740
+ keepAliveUrl: keepAliveUrl
741
+ }).catch(function (error) {
742
+ _loggerProxy.default.logger.warn("Meeting:index#startKeepAlive --> Stopping sending keepAlives to ".concat(keepAliveUrl, " after error ").concat(error));
743
+
744
+ _this.stopKeepAlive();
745
+ });
746
+ }, keepAliveInterval);
747
+ });
748
+ (0, _defineProperty3.default)((0, _assertThisInitialized2.default)(_this), "stopKeepAlive", function () {
749
+ if (!_this.keepAliveTimerId) {
750
+ return;
751
+ }
752
+
753
+ clearInterval(_this.keepAliveTimerId);
754
+ _this.keepAliveTimerId = null;
755
+ });
708
756
  _this.attrs = attrs;
709
757
  /**
710
758
  * @instance
@@ -1239,6 +1287,15 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
1239
1287
  */
1240
1288
 
1241
1289
  _this.meetingInfoFailureReason = undefined;
1290
+ /**
1291
+ * Repeating timer used to send keepAlives when in lobby
1292
+ * @instance
1293
+ * @type {String}
1294
+ * @private
1295
+ * @memberof Meeting
1296
+ */
1297
+
1298
+ _this.keepAliveTimerId = null;
1242
1299
 
1243
1300
  _this.setUpLocusInfoListeners();
1244
1301
 
@@ -2350,6 +2407,8 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
2350
2407
  });
2351
2408
  this.locusInfo.on(_constants.LOCUSINFO.EVENTS.SELF_UNADMITTED_GUEST, function (payload) {
2352
2409
  if (payload) {
2410
+ _this16.startKeepAlive();
2411
+
2353
2412
  _triggerProxy.default.trigger(_this16, {
2354
2413
  file: 'meeting/index',
2355
2414
  function: 'setUpLocusInfoSelfListener'
@@ -2364,6 +2423,8 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
2364
2423
  }
2365
2424
  });
2366
2425
  this.locusInfo.on(_constants.LOCUSINFO.EVENTS.SELF_ADMITTED_GUEST, function (payload) {
2426
+ _this16.stopKeepAlive();
2427
+
2367
2428
  if (payload) {
2368
2429
  _triggerProxy.default.trigger(_this16, {
2369
2430
  file: 'meeting/index',
@@ -6323,6 +6384,13 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
6323
6384
  failure: "".concat(LOG_HEADER, " disable bnr failure, ")
6324
6385
  });
6325
6386
  }
6387
+ /**
6388
+ * starts keepAlives being sent
6389
+ * @returns {void}
6390
+ * @private
6391
+ * @memberof Meeting
6392
+ */
6393
+
6326
6394
  }]);
6327
6395
  return Meeting;
6328
6396
  }(_webexCore.StatelessWebexPlugin);