@webex/plugin-meetings 2.14.1 → 2.14.4

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.
@@ -1940,6 +1940,22 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
1940
1940
  meetingContainerUrl: meetingContainerUrl
1941
1941
  });
1942
1942
  });
1943
+ this.locusInfo.on(_constants.LOCUSINFO.EVENTS.CONTROLS_MEETING_TRANSCRIBE_UPDATED, function (_ref7) {
1944
+ var caption = _ref7.caption,
1945
+ transcribing = _ref7.transcribing;
1946
+
1947
+ if (transcribing && _this11.transcription && _this11.config.receiveTranscription) {
1948
+ _this11.receiveTranscription();
1949
+ } else if (!transcribing && _this11.transcription) {
1950
+ _triggerProxy.default.trigger(_this11, {
1951
+ file: 'meeting/index',
1952
+ function: 'setupLocusControlsListener'
1953
+ }, _constants.EVENT_TRIGGERS.MEETING_STOPPED_RECEIVING_TRANSCRIPTION, {
1954
+ caption: caption,
1955
+ transcribing: transcribing
1956
+ });
1957
+ }
1958
+ });
1943
1959
  }
1944
1960
  /**
1945
1961
  * Set up the locus info media shares listener
@@ -3265,9 +3281,9 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
3265
3281
  return _media.default.stopTracks(videoTrack);
3266
3282
  }).then(function () {
3267
3283
  var audioStopped = audioTrack && audioTrack.readyState === _constants.ENDED;
3268
- 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
3269
3285
 
3270
- if (audioStopped && videoStopped) {
3286
+ if (audioStopped || videoStopped) {
3271
3287
  _triggerProxy.default.trigger(_this23, {
3272
3288
  file: 'meeting/index',
3273
3289
  function: 'closeLocalStream'
@@ -3275,7 +3291,7 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
3275
3291
  type: _constants.EVENT_TYPES.LOCAL
3276
3292
  });
3277
3293
  } else if (audioTrack || videoTrack) {
3278
- _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.');
3279
3295
  }
3280
3296
  });
3281
3297
  }
@@ -3666,10 +3682,10 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
3666
3682
  joinOptions = options.joinOptions,
3667
3683
  audioVideoOptions = options.audioVideoOptions;
3668
3684
  return this.join(joinOptions).then(function (joinResponse) {
3669
- return _this30.getMediaStreams(mediaSettings, audioVideoOptions).then(function (_ref7) {
3670
- var _ref8 = (0, _slicedToArray2.default)(_ref7, 2),
3671
- localStream = _ref8[0],
3672
- localShare = _ref8[1];
3685
+ return _this30.getMediaStreams(mediaSettings, audioVideoOptions).then(function (_ref8) {
3686
+ var _ref9 = (0, _slicedToArray2.default)(_ref8, 2),
3687
+ localStream = _ref9[0],
3688
+ localShare = _ref9[1];
3673
3689
 
3674
3690
  return _this30.addMedia({
3675
3691
  mediaSettings: mediaSettings,
@@ -3785,9 +3801,9 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
3785
3801
  }, {
3786
3802
  key: "isTranscriptionSupported",
3787
3803
  value: function isTranscriptionSupported() {
3788
- var _this$policy;
3804
+ var _this$locusInfo$contr;
3789
3805
 
3790
- if ((_this$policy = this.policy) !== null && _this$policy !== void 0 && _this$policy.WEBEX_ASSISTANT_STATUS_ACTIVE) {
3806
+ if ((_this$locusInfo$contr = this.locusInfo.controls.transcribe) !== null && _this$locusInfo$contr !== void 0 && _this$locusInfo$contr.transcribing) {
3791
3807
  return true;
3792
3808
  }
3793
3809
 
@@ -3952,7 +3968,16 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
3952
3968
 
3953
3969
  var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
3954
3970
 
3955
- // If a join request is being processed, refer to the deferred promise.
3971
+ if (!this.webex.meetings.registered) {
3972
+ var errorMessage = 'Meeting:index#join --> Device not registered';
3973
+ var error = new Error(errorMessage);
3974
+
3975
+ _loggerProxy.default.logger.error(errorMessage);
3976
+
3977
+ return _promise.default.reject(error);
3978
+ } // If a join request is being processed, refer to the deferred promise.
3979
+
3980
+
3956
3981
  if (this.deferJoin) {
3957
3982
  return this.deferJoin;
3958
3983
  } // Scope-up the resolve/reject methods for handling within join().
@@ -4009,14 +4034,15 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
4009
4034
  if (options.meetingQuality) {
4010
4035
  if (typeof options.meetingQuality === 'string') {
4011
4036
  if (!_constants.QUALITY_LEVELS[options.meetingQuality]) {
4012
- var errorMessage = "Meeting:index#join --> ".concat(options.meetingQuality, " not defined");
4013
- var error = new Error(errorMessage);
4037
+ var _errorMessage = "Meeting:index#join --> ".concat(options.meetingQuality, " not defined");
4038
+
4039
+ var _error = new Error(_errorMessage);
4014
4040
 
4015
- _loggerProxy.default.logger.error(errorMessage);
4041
+ _loggerProxy.default.logger.error(_errorMessage);
4016
4042
 
4017
- joinFailed(error);
4043
+ joinFailed(_error);
4018
4044
  this.deferJoin = undefined;
4019
- return _promise.default.reject(error);
4045
+ return _promise.default.reject(_error);
4020
4046
  }
4021
4047
 
4022
4048
  this.mediaProperties.setLocalQualityLevel(options.meetingQuality);
@@ -4025,15 +4051,15 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
4025
4051
 
4026
4052
  if ((0, _typeof2.default)(options.meetingQuality) === 'object') {
4027
4053
  if (!_constants.QUALITY_LEVELS[options.meetingQuality.local] && !_constants.QUALITY_LEVELS[options.meetingQuality.remote]) {
4028
- var _errorMessage = "Meeting:index#join --> ".concat(options.meetingQuality.local || options.meetingQuality.remote, " not defined");
4054
+ var _errorMessage2 = "Meeting:index#join --> ".concat(options.meetingQuality.local || options.meetingQuality.remote, " not defined");
4029
4055
 
4030
- _loggerProxy.default.logger.error(_errorMessage);
4056
+ _loggerProxy.default.logger.error(_errorMessage2);
4031
4057
 
4032
- var _error = new Error(_errorMessage);
4058
+ var _error2 = new Error(_errorMessage2);
4033
4059
 
4034
- joinFailed(_error);
4060
+ joinFailed(_error2);
4035
4061
  this.deferJoin = undefined;
4036
- return _promise.default.reject(new Error(_errorMessage));
4062
+ return _promise.default.reject(new Error(_errorMessage2));
4037
4063
  }
4038
4064
 
4039
4065
  if (options.meetingQuality.local) {
@@ -4062,7 +4088,7 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
4062
4088
 
4063
4089
  return join;
4064
4090
  }).then( /*#__PURE__*/function () {
4065
- var _ref9 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3(join) {
4091
+ var _ref10 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3(join) {
4066
4092
  return _regenerator.default.wrap(function _callee3$(_context3) {
4067
4093
  while (1) {
4068
4094
  switch (_context3.prev = _context3.next) {
@@ -4107,7 +4133,7 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
4107
4133
  }));
4108
4134
 
4109
4135
  return function (_x2) {
4110
- return _ref9.apply(this, arguments);
4136
+ return _ref10.apply(this, arguments);
4111
4137
  };
4112
4138
  }()).catch(function (error) {
4113
4139
  var _error$error;
@@ -4290,7 +4316,7 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
4290
4316
  mediaCapabilities: {
4291
4317
  rx: {
4292
4318
  audio: false,
4293
- share: false,
4319
+ share: true,
4294
4320
  share_audio: false,
4295
4321
  video: false,
4296
4322
  whiteboard: false
@@ -4311,27 +4337,98 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
4311
4337
  meeting: this
4312
4338
  });
4313
4339
 
4340
+ this.locusInfo.once(_constants.LOCUSINFO.EVENTS.SELF_OBSERVING, /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4() {
4341
+ var mediaSettings;
4342
+ return _regenerator.default.wrap(function _callee4$(_context4) {
4343
+ while (1) {
4344
+ switch (_context4.prev = _context4.next) {
4345
+ case 0:
4346
+ _context4.prev = 0;
4347
+
4348
+ if (!_this37.isSharing) {
4349
+ _context4.next = 4;
4350
+ break;
4351
+ }
4352
+
4353
+ _context4.next = 4;
4354
+ return _this37.stopFloorRequest();
4355
+
4356
+ case 4:
4357
+ mediaSettings = {
4358
+ mediaDirection: {
4359
+ sendVideo: false,
4360
+ receiveVideo: false,
4361
+ sendAudio: false,
4362
+ receiveAudio: false,
4363
+ sendShare: false,
4364
+ receiveShare: true
4365
+ }
4366
+ }; // clean up the local tracks
4367
+
4368
+ _this37.mediaProperties.setMediaDirection(mediaSettings.mediaDirection); // close the existing local tracks
4369
+
4370
+
4371
+ _context4.next = 8;
4372
+ return _this37.closeLocalStream();
4373
+
4374
+ case 8:
4375
+ _context4.next = 10;
4376
+ return _this37.closeLocalShare();
4377
+
4378
+ case 10:
4379
+ _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
4380
+ // once the DX answers we establish connection back the media server with only receiveShare enabled
4381
+
4382
+
4383
+ _context4.next = 13;
4384
+ return _this37.reconnectionManager.reconnectMedia(mediaSettings).then(function () {
4385
+ _metrics.default.sendBehavioralMetric(_constants2.default.MOVE_TO_SUCCESS);
4386
+ });
4387
+
4388
+ case 13:
4389
+ _context4.next = 19;
4390
+ break;
4391
+
4392
+ case 15:
4393
+ _context4.prev = 15;
4394
+ _context4.t0 = _context4["catch"](0);
4395
+
4396
+ _loggerProxy.default.logger.error('Meeting:index#moveTo --> Failed to moveTo resourceId', _context4.t0);
4397
+
4398
+ _metrics.default.sendBehavioralMetric(_constants2.default.MOVE_TO_FAILURE, {
4399
+ correlation_id: _this37.correlationId,
4400
+ locus_id: _this37.locusUrl.split('/').pop(),
4401
+ reason: _context4.t0.message,
4402
+ stack: _context4.t0.stack
4403
+ });
4404
+
4405
+ case 19:
4406
+ case "end":
4407
+ return _context4.stop();
4408
+ }
4409
+ }
4410
+ }, _callee4, null, [[0, 15]]);
4411
+ })));
4412
+
4413
+ _loggerProxy.default.logger.info('Meeting:index#moveTo --> Initated moved to using resourceId', resourceId);
4414
+
4314
4415
  return _util.default.joinMeetingOptions(this, {
4315
4416
  resourceId: resourceId,
4316
4417
  moveToResource: true
4317
4418
  }).then(function () {
4318
4419
  _this37.meetingFiniteStateMachine.join();
4319
-
4320
- return _this37.updateMedia({
4321
- mediaSettings: {
4322
- sendVideo: false,
4323
- receiveVideo: false,
4324
- sendAudio: false,
4325
- receiveAudio: false,
4326
- sendShare: false,
4327
- receiveShare: false
4328
- }
4329
- }).then(function () {
4330
- return _promise.default.resolve(_this37);
4331
- });
4332
4420
  }).catch(function (error) {
4333
4421
  _this37.meetingFiniteStateMachine.fail(error);
4334
4422
 
4423
+ _metrics.default.sendBehavioralMetric(_constants2.default.MOVE_TO_FAILURE, {
4424
+ correlation_id: _this37.correlationId,
4425
+ locus_id: _this37.locusUrl.split('/').pop(),
4426
+ reason: error.message,
4427
+ stack: error.stack
4428
+ });
4429
+
4430
+ _loggerProxy.default.logger.error('Meeting:index#moveTo --> Failed to moveTo resourceId', error);
4431
+
4335
4432
  return _promise.default.reject(error);
4336
4433
  });
4337
4434
  }
@@ -4348,77 +4445,41 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
4348
4445
  value: function moveFrom(resourceId) {
4349
4446
  var _this38 = this;
4350
4447
 
4448
+ // On moveFrom ask the developer to re capture it moveFrom then updateMedia
4351
4449
  if (!resourceId) {
4352
4450
  throw new _parameter.default('Cannot move call without a resourceId.');
4353
4451
  }
4354
4452
 
4355
4453
  var oldCorrelationId = this.correlationId;
4356
- this.id = _uuid.default.v4();
4357
- this.webex.meetings.meetingCollection.set(this);
4358
-
4359
- _metrics.default.postEvent({
4360
- event: _config.eventType.MEDIA_CAPABILITIES,
4361
- meeting: this,
4362
- data: {
4363
- mediaCapabilities: {
4364
- rx: {
4365
- audio: true,
4366
- share: true,
4367
- share_audio: true,
4368
- video: true,
4369
- whiteboard: true
4370
- },
4371
- tx: {
4372
- audio: true,
4373
- share: true,
4374
- share_audio: true,
4375
- video: true,
4376
- whiteboard: true
4377
- }
4378
- }
4379
- }
4380
- });
4381
4454
 
4382
4455
  _metrics.default.postEvent({
4383
4456
  event: _config.eventType.MOVE_MEDIA,
4384
4457
  meeting: this
4385
4458
  });
4386
4459
 
4387
- return _util.default.joinMeetingOptions(this).then(function (join) {
4388
- return _this38.getMediaStreams({
4389
- sendAudio: true,
4390
- sendVideo: true,
4391
- sendShare: false
4392
- }).then(function (_ref10) {
4393
- var _ref11 = (0, _slicedToArray2.default)(_ref10, 2),
4394
- localStream = _ref11[0],
4395
- localShare = _ref11[1];
4396
-
4397
- return _this38.updateMedia({
4398
- mediaSettings: {
4399
- sendAudio: true,
4400
- receiveAudio: true,
4401
- sendVideo: true,
4402
- receiveVideo: true,
4403
- sendShare: false,
4404
- receiveShare: false
4405
- },
4406
- localStream: localStream,
4407
- localShare: localShare
4408
- }).then(function () {
4409
- return _promise.default.resolve(join);
4410
- });
4460
+ return _util.default.joinMeetingOptions(this).then(function () {
4461
+ return _util.default.leaveMeeting(_this38, {
4462
+ resourceId: resourceId,
4463
+ correlationId: oldCorrelationId,
4464
+ moveMeeting: true
4411
4465
  }).then(function () {
4412
- return _util.default.leaveMeeting(_this38, {
4413
- resourceId: resourceId,
4414
- correlationId: oldCorrelationId,
4415
- moveMeeting: true
4416
- });
4466
+ _this38.resourceId = '';
4467
+
4468
+ _metrics.default.sendBehavioralMetric(_constants2.default.MOVE_FROM_SUCCESS);
4417
4469
  });
4418
- }).then(function () {
4419
- _this38.webex.meetings.meetingCollection.delete(_this38.id);
4470
+ }).catch(function (error) {
4471
+ _this38.meetingFiniteStateMachine.fail(error);
4420
4472
 
4421
- return _promise.default.resolve();
4473
+ _metrics.default.sendBehavioralMetric(_constants2.default.MOVE_FROM_FAILURE, {
4474
+ correlation_id: _this38.correlationId,
4475
+ locus_id: _this38.locusUrl.split('/').pop(),
4476
+ reason: error.message,
4477
+ stack: error.stack
4478
+ });
4479
+
4480
+ _loggerProxy.default.logger.error('Meeting:index#moveTo --> Failed to moveTo resourceId', error);
4481
+
4482
+ return _promise.default.reject(error);
4422
4483
  });
4423
4484
  }
4424
4485
  /**
@@ -4824,20 +4885,20 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
4824
4885
  }, {
4825
4886
  key: "updateAudio",
4826
4887
  value: function () {
4827
- var _updateAudio = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4(options) {
4888
+ var _updateAudio = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee5(options) {
4828
4889
  var _this42 = this;
4829
4890
 
4830
4891
  var sendAudio, receiveAudio, stream, bnrEnabled, audioTransceiver, track;
4831
- return _regenerator.default.wrap(function _callee4$(_context4) {
4892
+ return _regenerator.default.wrap(function _callee5$(_context5) {
4832
4893
  while (1) {
4833
- switch (_context4.prev = _context4.next) {
4894
+ switch (_context5.prev = _context5.next) {
4834
4895
  case 0:
4835
4896
  if (this.canUpdateMedia()) {
4836
- _context4.next = 2;
4897
+ _context5.next = 2;
4837
4898
  break;
4838
4899
  }
4839
4900
 
4840
- return _context4.abrupt("return", this.enqueueMediaUpdate(MEDIA_UPDATE_TYPE.AUDIO, options));
4901
+ return _context5.abrupt("return", this.enqueueMediaUpdate(MEDIA_UPDATE_TYPE.AUDIO, options));
4841
4902
 
4842
4903
  case 2:
4843
4904
  sendAudio = options.sendAudio, receiveAudio = options.receiveAudio, stream = options.stream, bnrEnabled = options.bnrEnabled;
@@ -4845,30 +4906,30 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
4845
4906
  track = _util.default.getTrack(stream).audioTrack;
4846
4907
 
4847
4908
  if (!(typeof sendAudio !== 'boolean' || typeof receiveAudio !== 'boolean')) {
4848
- _context4.next = 7;
4909
+ _context5.next = 7;
4849
4910
  break;
4850
4911
  }
4851
4912
 
4852
- return _context4.abrupt("return", _promise.default.reject(new _parameter.default('Pass sendAudio and receiveAudio parameter')));
4913
+ return _context5.abrupt("return", _promise.default.reject(new _parameter.default('Pass sendAudio and receiveAudio parameter')));
4853
4914
 
4854
4915
  case 7:
4855
4916
  if (!(sendAudio && !this.isAudioMuted() && (bnrEnabled === _constants.BNR_STATUS.ENABLED || bnrEnabled === _constants.BNR_STATUS.SHOULD_ENABLE))) {
4856
- _context4.next = 13;
4917
+ _context5.next = 13;
4857
4918
  break;
4858
4919
  }
4859
4920
 
4860
4921
  _loggerProxy.default.logger.info('Meeting:index#updateAudio. Calling WebRTC enable bnr method');
4861
4922
 
4862
- _context4.next = 11;
4923
+ _context5.next = 11;
4863
4924
  return this.internal_enableBNR(track);
4864
4925
 
4865
4926
  case 11:
4866
- track = _context4.sent;
4927
+ track = _context5.sent;
4867
4928
 
4868
4929
  _loggerProxy.default.logger.info('Meeting:index#updateAudio. WebRTC enable bnr request completed');
4869
4930
 
4870
4931
  case 13:
4871
- return _context4.abrupt("return", _util.default.validateOptions({
4932
+ return _context5.abrupt("return", _util.default.validateOptions({
4872
4933
  sendAudio: sendAudio,
4873
4934
  localStream: stream
4874
4935
  }).then(function () {
@@ -4908,10 +4969,10 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
4908
4969
 
4909
4970
  case 14:
4910
4971
  case "end":
4911
- return _context4.stop();
4972
+ return _context5.stop();
4912
4973
  }
4913
4974
  }
4914
- }, _callee4, this);
4975
+ }, _callee5, this);
4915
4976
  }));
4916
4977
 
4917
4978
  function updateAudio(_x3) {
@@ -6237,40 +6298,40 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
6237
6298
  }, {
6238
6299
  key: "internal_enableBNR",
6239
6300
  value: function () {
6240
- var _internal_enableBNR = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee5(audioTrack) {
6301
+ var _internal_enableBNR = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee6(audioTrack) {
6241
6302
  var bnrAudioTrack;
6242
- return _regenerator.default.wrap(function _callee5$(_context5) {
6303
+ return _regenerator.default.wrap(function _callee6$(_context6) {
6243
6304
  while (1) {
6244
- switch (_context5.prev = _context5.next) {
6305
+ switch (_context6.prev = _context6.next) {
6245
6306
  case 0:
6246
- _context5.prev = 0;
6307
+ _context6.prev = 0;
6247
6308
 
6248
6309
  _loggerProxy.default.logger.info('Meeting:index#internal_enableBNR. Internal enable BNR called');
6249
6310
 
6250
- _context5.next = 4;
6311
+ _context6.next = 4;
6251
6312
  return _internalMediaCore.Media.Effects.BNR.enableBNR(audioTrack);
6252
6313
 
6253
6314
  case 4:
6254
- bnrAudioTrack = _context5.sent;
6315
+ bnrAudioTrack = _context6.sent;
6255
6316
 
6256
6317
  _loggerProxy.default.logger.info('Meeting:index#internal_enableBNR. BNR enabled track obtained from WebRTC & returned as stream');
6257
6318
 
6258
- return _context5.abrupt("return", bnrAudioTrack);
6319
+ return _context6.abrupt("return", bnrAudioTrack);
6259
6320
 
6260
6321
  case 9:
6261
- _context5.prev = 9;
6262
- _context5.t0 = _context5["catch"](0);
6322
+ _context6.prev = 9;
6323
+ _context6.t0 = _context6["catch"](0);
6263
6324
 
6264
- _loggerProxy.default.logger.error('Meeting:index#internal_enableBNR.', _context5.t0);
6325
+ _loggerProxy.default.logger.error('Meeting:index#internal_enableBNR.', _context6.t0);
6265
6326
 
6266
- throw _context5.t0;
6327
+ throw _context6.t0;
6267
6328
 
6268
6329
  case 13:
6269
6330
  case "end":
6270
- return _context5.stop();
6331
+ return _context6.stop();
6271
6332
  }
6272
6333
  }
6273
- }, _callee5, null, [[0, 9]]);
6334
+ }, _callee6, null, [[0, 9]]);
6274
6335
  }));
6275
6336
 
6276
6337
  function internal_enableBNR(_x4) {