@webex/plugin-meetings 2.14.2 → 2.14.3

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.
@@ -3281,9 +3281,9 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
3281
3281
  return _media.default.stopTracks(videoTrack);
3282
3282
  }).then(function () {
3283
3283
  var audioStopped = audioTrack && audioTrack.readyState === _constants.ENDED;
3284
- var videoStopped = videoTrack && videoTrack.readyState === _constants.ENDED;
3284
+ var videoStopped = videoTrack && videoTrack.readyState === _constants.ENDED; // triggers event for audio and video stop , sometime either audio or video one of them exists
3285
3285
 
3286
- if (audioStopped && videoStopped) {
3286
+ if (audioStopped || videoStopped) {
3287
3287
  _triggerProxy.default.trigger(_this23, {
3288
3288
  file: 'meeting/index',
3289
3289
  function: 'closeLocalStream'
@@ -3291,7 +3291,7 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
3291
3291
  type: _constants.EVENT_TYPES.LOCAL
3292
3292
  });
3293
3293
  } else if (audioTrack || videoTrack) {
3294
- _loggerProxy.default.logger.warn('Meeting:index#closeLocalStream --> Error: MediaStreamTrack.readyState is incorrect.');
3294
+ _loggerProxy.default.logger.warn('Meeting:index#closeLocalStream --> Warning: track might already been ended or unavaliable.');
3295
3295
  }
3296
3296
  });
3297
3297
  }
@@ -4306,7 +4306,7 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
4306
4306
  mediaCapabilities: {
4307
4307
  rx: {
4308
4308
  audio: false,
4309
- share: false,
4309
+ share: true,
4310
4310
  share_audio: false,
4311
4311
  video: false,
4312
4312
  whiteboard: false
@@ -4327,27 +4327,98 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
4327
4327
  meeting: this
4328
4328
  });
4329
4329
 
4330
+ this.locusInfo.once(_constants.LOCUSINFO.EVENTS.SELF_OBSERVING, /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4() {
4331
+ var mediaSettings;
4332
+ return _regenerator.default.wrap(function _callee4$(_context4) {
4333
+ while (1) {
4334
+ switch (_context4.prev = _context4.next) {
4335
+ case 0:
4336
+ _context4.prev = 0;
4337
+
4338
+ if (!_this37.isSharing) {
4339
+ _context4.next = 4;
4340
+ break;
4341
+ }
4342
+
4343
+ _context4.next = 4;
4344
+ return _this37.stopFloorRequest();
4345
+
4346
+ case 4:
4347
+ mediaSettings = {
4348
+ mediaDirection: {
4349
+ sendVideo: false,
4350
+ receiveVideo: false,
4351
+ sendAudio: false,
4352
+ receiveAudio: false,
4353
+ sendShare: false,
4354
+ receiveShare: true
4355
+ }
4356
+ }; // clean up the local tracks
4357
+
4358
+ _this37.mediaProperties.setMediaDirection(mediaSettings.mediaDirection); // close the existing local tracks
4359
+
4360
+
4361
+ _context4.next = 8;
4362
+ return _this37.closeLocalStream();
4363
+
4364
+ case 8:
4365
+ _context4.next = 10;
4366
+ return _this37.closeLocalShare();
4367
+
4368
+ case 10:
4369
+ _this37.mediaProperties.unsetMediaTracks(); // 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
4370
+ // once the DX answers we establish connection back the media server with only receiveShare enabled
4371
+
4372
+
4373
+ _context4.next = 13;
4374
+ return _this37.reconnectionManager.reconnectMedia(mediaSettings).then(function () {
4375
+ _metrics.default.sendBehavioralMetric(_constants2.default.MOVE_TO_SUCCESS);
4376
+ });
4377
+
4378
+ case 13:
4379
+ _context4.next = 19;
4380
+ break;
4381
+
4382
+ case 15:
4383
+ _context4.prev = 15;
4384
+ _context4.t0 = _context4["catch"](0);
4385
+
4386
+ _loggerProxy.default.logger.error('Meeting:index#moveTo --> Failed to moveTo resourceId', _context4.t0);
4387
+
4388
+ _metrics.default.sendBehavioralMetric(_constants2.default.MOVE_TO_FAILURE, {
4389
+ correlation_id: _this37.correlationId,
4390
+ locus_id: _this37.locusUrl.split('/').pop(),
4391
+ reason: _context4.t0.message,
4392
+ stack: _context4.t0.stack
4393
+ });
4394
+
4395
+ case 19:
4396
+ case "end":
4397
+ return _context4.stop();
4398
+ }
4399
+ }
4400
+ }, _callee4, null, [[0, 15]]);
4401
+ })));
4402
+
4403
+ _loggerProxy.default.logger.info('Meeting:index#moveTo --> Initated moved to using resourceId', resourceId);
4404
+
4330
4405
  return _util.default.joinMeetingOptions(this, {
4331
4406
  resourceId: resourceId,
4332
4407
  moveToResource: true
4333
4408
  }).then(function () {
4334
4409
  _this37.meetingFiniteStateMachine.join();
4335
-
4336
- return _this37.updateMedia({
4337
- mediaSettings: {
4338
- sendVideo: false,
4339
- receiveVideo: false,
4340
- sendAudio: false,
4341
- receiveAudio: false,
4342
- sendShare: false,
4343
- receiveShare: false
4344
- }
4345
- }).then(function () {
4346
- return _promise.default.resolve(_this37);
4347
- });
4348
4410
  }).catch(function (error) {
4349
4411
  _this37.meetingFiniteStateMachine.fail(error);
4350
4412
 
4413
+ _metrics.default.sendBehavioralMetric(_constants2.default.MOVE_TO_FAILURE, {
4414
+ correlation_id: _this37.correlationId,
4415
+ locus_id: _this37.locusUrl.split('/').pop(),
4416
+ reason: error.message,
4417
+ stack: error.stack
4418
+ });
4419
+
4420
+ _loggerProxy.default.logger.error('Meeting:index#moveTo --> Failed to moveTo resourceId', error);
4421
+
4351
4422
  return _promise.default.reject(error);
4352
4423
  });
4353
4424
  }
@@ -4364,77 +4435,41 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
4364
4435
  value: function moveFrom(resourceId) {
4365
4436
  var _this38 = this;
4366
4437
 
4438
+ // On moveFrom ask the developer to re capture it moveFrom then updateMedia
4367
4439
  if (!resourceId) {
4368
4440
  throw new _parameter.default('Cannot move call without a resourceId.');
4369
4441
  }
4370
4442
 
4371
4443
  var oldCorrelationId = this.correlationId;
4372
- this.id = _uuid.default.v4();
4373
- this.webex.meetings.meetingCollection.set(this);
4374
-
4375
- _metrics.default.postEvent({
4376
- event: _config.eventType.MEDIA_CAPABILITIES,
4377
- meeting: this,
4378
- data: {
4379
- mediaCapabilities: {
4380
- rx: {
4381
- audio: true,
4382
- share: true,
4383
- share_audio: true,
4384
- video: true,
4385
- whiteboard: true
4386
- },
4387
- tx: {
4388
- audio: true,
4389
- share: true,
4390
- share_audio: true,
4391
- video: true,
4392
- whiteboard: true
4393
- }
4394
- }
4395
- }
4396
- });
4397
4444
 
4398
4445
  _metrics.default.postEvent({
4399
4446
  event: _config.eventType.MOVE_MEDIA,
4400
4447
  meeting: this
4401
4448
  });
4402
4449
 
4403
- return _util.default.joinMeetingOptions(this).then(function (join) {
4404
- return _this38.getMediaStreams({
4405
- sendAudio: true,
4406
- sendVideo: true,
4407
- sendShare: false
4408
- }).then(function (_ref11) {
4409
- var _ref12 = (0, _slicedToArray2.default)(_ref11, 2),
4410
- localStream = _ref12[0],
4411
- localShare = _ref12[1];
4412
-
4413
- return _this38.updateMedia({
4414
- mediaSettings: {
4415
- sendAudio: true,
4416
- receiveAudio: true,
4417
- sendVideo: true,
4418
- receiveVideo: true,
4419
- sendShare: false,
4420
- receiveShare: false
4421
- },
4422
- localStream: localStream,
4423
- localShare: localShare
4424
- }).then(function () {
4425
- return _promise.default.resolve(join);
4426
- });
4450
+ return _util.default.joinMeetingOptions(this).then(function () {
4451
+ return _util.default.leaveMeeting(_this38, {
4452
+ resourceId: resourceId,
4453
+ correlationId: oldCorrelationId,
4454
+ moveMeeting: true
4427
4455
  }).then(function () {
4428
- return _util.default.leaveMeeting(_this38, {
4429
- resourceId: resourceId,
4430
- correlationId: oldCorrelationId,
4431
- moveMeeting: true
4432
- });
4456
+ _this38.resourceId = '';
4457
+
4458
+ _metrics.default.sendBehavioralMetric(_constants2.default.MOVE_FROM_SUCCESS);
4433
4459
  });
4434
- }).then(function () {
4435
- _this38.webex.meetings.meetingCollection.delete(_this38.id);
4460
+ }).catch(function (error) {
4461
+ _this38.meetingFiniteStateMachine.fail(error);
4436
4462
 
4437
- return _promise.default.resolve();
4463
+ _metrics.default.sendBehavioralMetric(_constants2.default.MOVE_FROM_FAILURE, {
4464
+ correlation_id: _this38.correlationId,
4465
+ locus_id: _this38.locusUrl.split('/').pop(),
4466
+ reason: error.message,
4467
+ stack: error.stack
4468
+ });
4469
+
4470
+ _loggerProxy.default.logger.error('Meeting:index#moveTo --> Failed to moveTo resourceId', error);
4471
+
4472
+ return _promise.default.reject(error);
4438
4473
  });
4439
4474
  }
4440
4475
  /**
@@ -4840,20 +4875,20 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
4840
4875
  }, {
4841
4876
  key: "updateAudio",
4842
4877
  value: function () {
4843
- var _updateAudio = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4(options) {
4878
+ var _updateAudio = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee5(options) {
4844
4879
  var _this42 = this;
4845
4880
 
4846
4881
  var sendAudio, receiveAudio, stream, bnrEnabled, audioTransceiver, track;
4847
- return _regenerator.default.wrap(function _callee4$(_context4) {
4882
+ return _regenerator.default.wrap(function _callee5$(_context5) {
4848
4883
  while (1) {
4849
- switch (_context4.prev = _context4.next) {
4884
+ switch (_context5.prev = _context5.next) {
4850
4885
  case 0:
4851
4886
  if (this.canUpdateMedia()) {
4852
- _context4.next = 2;
4887
+ _context5.next = 2;
4853
4888
  break;
4854
4889
  }
4855
4890
 
4856
- return _context4.abrupt("return", this.enqueueMediaUpdate(MEDIA_UPDATE_TYPE.AUDIO, options));
4891
+ return _context5.abrupt("return", this.enqueueMediaUpdate(MEDIA_UPDATE_TYPE.AUDIO, options));
4857
4892
 
4858
4893
  case 2:
4859
4894
  sendAudio = options.sendAudio, receiveAudio = options.receiveAudio, stream = options.stream, bnrEnabled = options.bnrEnabled;
@@ -4861,30 +4896,30 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
4861
4896
  track = _util.default.getTrack(stream).audioTrack;
4862
4897
 
4863
4898
  if (!(typeof sendAudio !== 'boolean' || typeof receiveAudio !== 'boolean')) {
4864
- _context4.next = 7;
4899
+ _context5.next = 7;
4865
4900
  break;
4866
4901
  }
4867
4902
 
4868
- return _context4.abrupt("return", _promise.default.reject(new _parameter.default('Pass sendAudio and receiveAudio parameter')));
4903
+ return _context5.abrupt("return", _promise.default.reject(new _parameter.default('Pass sendAudio and receiveAudio parameter')));
4869
4904
 
4870
4905
  case 7:
4871
4906
  if (!(sendAudio && !this.isAudioMuted() && (bnrEnabled === _constants.BNR_STATUS.ENABLED || bnrEnabled === _constants.BNR_STATUS.SHOULD_ENABLE))) {
4872
- _context4.next = 13;
4907
+ _context5.next = 13;
4873
4908
  break;
4874
4909
  }
4875
4910
 
4876
4911
  _loggerProxy.default.logger.info('Meeting:index#updateAudio. Calling WebRTC enable bnr method');
4877
4912
 
4878
- _context4.next = 11;
4913
+ _context5.next = 11;
4879
4914
  return this.internal_enableBNR(track);
4880
4915
 
4881
4916
  case 11:
4882
- track = _context4.sent;
4917
+ track = _context5.sent;
4883
4918
 
4884
4919
  _loggerProxy.default.logger.info('Meeting:index#updateAudio. WebRTC enable bnr request completed');
4885
4920
 
4886
4921
  case 13:
4887
- return _context4.abrupt("return", _util.default.validateOptions({
4922
+ return _context5.abrupt("return", _util.default.validateOptions({
4888
4923
  sendAudio: sendAudio,
4889
4924
  localStream: stream
4890
4925
  }).then(function () {
@@ -4924,10 +4959,10 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
4924
4959
 
4925
4960
  case 14:
4926
4961
  case "end":
4927
- return _context4.stop();
4962
+ return _context5.stop();
4928
4963
  }
4929
4964
  }
4930
- }, _callee4, this);
4965
+ }, _callee5, this);
4931
4966
  }));
4932
4967
 
4933
4968
  function updateAudio(_x3) {
@@ -5736,9 +5771,9 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
5736
5771
  sendVideo: this.mediaProperties.mediaDirection.sendVideo,
5737
5772
  sendShare: this.mediaProperties.mediaDirection.sendShare
5738
5773
  };
5739
- return this.getMediaStreams(mediaDirection, _constants.VIDEO_RESOLUTIONS[level]).then(function (_ref13) {
5740
- var _ref14 = (0, _slicedToArray2.default)(_ref13, 1),
5741
- localStream = _ref14[0];
5774
+ return this.getMediaStreams(mediaDirection, _constants.VIDEO_RESOLUTIONS[level]).then(function (_ref12) {
5775
+ var _ref13 = (0, _slicedToArray2.default)(_ref12, 1),
5776
+ localStream = _ref13[0];
5742
5777
 
5743
5778
  return _this53.updateVideo({
5744
5779
  sendVideo: true,
@@ -5954,9 +5989,9 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
5954
5989
 
5955
5990
  }, {
5956
5991
  key: "handleMediaLogging",
5957
- value: function handleMediaLogging(_ref15) {
5958
- var audioTrack = _ref15.audioTrack,
5959
- videoTrack = _ref15.videoTrack;
5992
+ value: function handleMediaLogging(_ref14) {
5993
+ var audioTrack = _ref14.audioTrack,
5994
+ videoTrack = _ref14.videoTrack;
5960
5995
 
5961
5996
  _util.default.handleVideoLogging(videoTrack);
5962
5997
 
@@ -6253,40 +6288,40 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
6253
6288
  }, {
6254
6289
  key: "internal_enableBNR",
6255
6290
  value: function () {
6256
- var _internal_enableBNR = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee5(audioTrack) {
6291
+ var _internal_enableBNR = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee6(audioTrack) {
6257
6292
  var bnrAudioTrack;
6258
- return _regenerator.default.wrap(function _callee5$(_context5) {
6293
+ return _regenerator.default.wrap(function _callee6$(_context6) {
6259
6294
  while (1) {
6260
- switch (_context5.prev = _context5.next) {
6295
+ switch (_context6.prev = _context6.next) {
6261
6296
  case 0:
6262
- _context5.prev = 0;
6297
+ _context6.prev = 0;
6263
6298
 
6264
6299
  _loggerProxy.default.logger.info('Meeting:index#internal_enableBNR. Internal enable BNR called');
6265
6300
 
6266
- _context5.next = 4;
6301
+ _context6.next = 4;
6267
6302
  return _internalMediaCore.Media.Effects.BNR.enableBNR(audioTrack);
6268
6303
 
6269
6304
  case 4:
6270
- bnrAudioTrack = _context5.sent;
6305
+ bnrAudioTrack = _context6.sent;
6271
6306
 
6272
6307
  _loggerProxy.default.logger.info('Meeting:index#internal_enableBNR. BNR enabled track obtained from WebRTC & returned as stream');
6273
6308
 
6274
- return _context5.abrupt("return", bnrAudioTrack);
6309
+ return _context6.abrupt("return", bnrAudioTrack);
6275
6310
 
6276
6311
  case 9:
6277
- _context5.prev = 9;
6278
- _context5.t0 = _context5["catch"](0);
6312
+ _context6.prev = 9;
6313
+ _context6.t0 = _context6["catch"](0);
6279
6314
 
6280
- _loggerProxy.default.logger.error('Meeting:index#internal_enableBNR.', _context5.t0);
6315
+ _loggerProxy.default.logger.error('Meeting:index#internal_enableBNR.', _context6.t0);
6281
6316
 
6282
- throw _context5.t0;
6317
+ throw _context6.t0;
6283
6318
 
6284
6319
  case 13:
6285
6320
  case "end":
6286
- return _context5.stop();
6321
+ return _context6.stop();
6287
6322
  }
6288
6323
  }
6289
- }, _callee5, null, [[0, 9]]);
6324
+ }, _callee6, null, [[0, 9]]);
6290
6325
  }));
6291
6326
 
6292
6327
  function internal_enableBNR(_x4) {