@webex/plugin-meetings 1.147.1 → 1.149.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.
@@ -961,14 +961,15 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
961
961
 
962
962
  _this.floorGrantPending = false;
963
963
  /**
964
- * The latest status of the dial in device (can be "JOINED", "CONNECTED", "LEFT" or "")
964
+ * The latest status of the dial in device (can be "JOINED", "CONNECTED", "LEFT",
965
+ * "TRANSFERRING", "SUCCESS" or "")
965
966
  * @instance
966
967
  * @type {String}
967
968
  * @private
968
969
  * @memberof Meeting
969
970
  */
970
971
 
971
- _this.dialInDeviceStatus = '';
972
+ _this.dialInDeviceStatus = _constants.PSTN_STATUS.UNKNOWN;
972
973
  /**
973
974
  * the url for provisioned device used to dial in
974
975
  * @instance
@@ -978,6 +979,25 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
978
979
  */
979
980
 
980
981
  _this.dialInUrl = '';
982
+ /**
983
+ * The latest status of the dial out device (can be "JOINED", "CONNECTED", "LEFT",
984
+ * "TRANSFERRING", "SUCCESS" or "")
985
+ * @instance
986
+ * @type {String}
987
+ * @private
988
+ * @memberof Meeting
989
+ */
990
+
991
+ _this.dialOutDeviceStatus = _constants.PSTN_STATUS.UNKNOWN;
992
+ /**
993
+ * the url for provisioned device used to dial out
994
+ * @instance
995
+ * @type {String}
996
+ * @private
997
+ * @memberof Meeting
998
+ */
999
+
1000
+ _this.dialOutUrl = '';
981
1001
  /**
982
1002
  * @instance
983
1003
  * @type {MediaMetrics}
@@ -1285,6 +1305,22 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
1285
1305
  };
1286
1306
  }
1287
1307
 
1308
+ var joinRespTxStartAudio = this.getSendingMediaDelayDuration('audio');
1309
+
1310
+ if (joinRespTxStartAudio) {
1311
+ options.audioSetupDelay = _objectSpread(_objectSpread({}, options.audioSetupDelay), {}, {
1312
+ joinRespTxStart: joinRespTxStartAudio
1313
+ });
1314
+ }
1315
+
1316
+ var joinRespTxStartVideo = this.getSendingMediaDelayDuration('video');
1317
+
1318
+ if (joinRespTxStartVideo) {
1319
+ options.videoSetupDelay = _objectSpread(_objectSpread({}, options.videoSetupDelay), {}, {
1320
+ joinRespTxStart: joinRespTxStartVideo
1321
+ });
1322
+ }
1323
+
1288
1324
  if (options.type === _constants.MQA_STATS.CA_TYPE) {
1289
1325
  payload = _metrics.default.initMediaPayload(options.event, identifiers, options);
1290
1326
  } else {
@@ -1398,24 +1434,50 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
1398
1434
  var _this6 = this;
1399
1435
 
1400
1436
  if (this.locusInfo.self) {
1401
- var _payload$newSelf;
1437
+ var _payload$newSelf, _payload$newSelf2;
1402
1438
 
1403
1439
  var dialInPstnDevice = (_payload$newSelf = payload.newSelf) === null || _payload$newSelf === void 0 ? void 0 : _payload$newSelf.pstnDevices.find(function (device) {
1404
1440
  return device.url === _this6.dialInUrl;
1405
1441
  });
1442
+ var dialOutPstnDevice = (_payload$newSelf2 = payload.newSelf) === null || _payload$newSelf2 === void 0 ? void 0 : _payload$newSelf2.pstnDevices.find(function (device) {
1443
+ return device.url === _this6.dialOutUrl;
1444
+ });
1445
+ var changed = false;
1406
1446
 
1407
1447
  if (dialInPstnDevice) {
1408
1448
  var _dialInPstnDevice$dia;
1409
1449
 
1410
- this.dialInDeviceStatus = (_dialInPstnDevice$dia = dialInPstnDevice.dialingStatus) !== null && _dialInPstnDevice$dia !== void 0 ? _dialInPstnDevice$dia : dialInPstnDevice.state;
1450
+ var newStatus = (_dialInPstnDevice$dia = dialInPstnDevice.dialingStatus) !== null && _dialInPstnDevice$dia !== void 0 ? _dialInPstnDevice$dia : dialInPstnDevice.state;
1451
+
1452
+ if (newStatus !== this.dialInDeviceStatus) {
1453
+ this.dialInDeviceStatus = newStatus;
1454
+ changed = true;
1455
+ }
1456
+ }
1457
+
1458
+ if (dialOutPstnDevice) {
1459
+ var _dialOutPstnDevice$di;
1460
+
1461
+ var _newStatus = (_dialOutPstnDevice$di = dialOutPstnDevice.dialingStatus) !== null && _dialOutPstnDevice$di !== void 0 ? _dialOutPstnDevice$di : dialOutPstnDevice.state;
1411
1462
 
1463
+ if (_newStatus !== this.dialOutDeviceStatus) {
1464
+ this.dialOutDeviceStatus = _newStatus;
1465
+ changed = true;
1466
+ }
1467
+ }
1468
+
1469
+ if (changed) {
1412
1470
  _triggerProxy.default.trigger(this, {
1413
1471
  file: 'meeting/index',
1414
1472
  function: 'setUpLocusSelfListener'
1415
1473
  }, _constants.EVENT_TRIGGERS.MEETING_SELF_PHONE_AUDIO_UPDATE, {
1416
1474
  dialIn: {
1417
1475
  status: this.dialInDeviceStatus,
1418
- attendeeId: dialInPstnDevice.attendeeId
1476
+ attendeeId: dialInPstnDevice === null || dialInPstnDevice === void 0 ? void 0 : dialInPstnDevice.attendeeId
1477
+ },
1478
+ dialOut: {
1479
+ status: this.dialOutDeviceStatus,
1480
+ attendeeId: dialOutPstnDevice === null || dialOutPstnDevice === void 0 ? void 0 : dialOutPstnDevice.attendeeId
1419
1481
  }
1420
1482
  });
1421
1483
  }
@@ -3655,7 +3717,7 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
3655
3717
  /**
3656
3718
  * Use phone for meeting audio
3657
3719
  * @param {String} phoneNumber If provided, it will dial-out using this number. If not provided, dial-in will be used
3658
- * @returns {Promise} Resolves once the dial-in or dial-out request has completed
3720
+ * @returns {Promise} Resolves once the dial-in or dial-out request has completed, or rejects if it failed
3659
3721
  * @public
3660
3722
  * @memberof Meeting
3661
3723
  */
@@ -3667,11 +3729,24 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
3667
3729
  return this.dialInPstn();
3668
3730
  }
3669
3731
 
3670
- return _promise.default.reject(new Error('Dial-out is not supported yet'));
3732
+ return this.dialOutPstn(phoneNumber);
3733
+ }
3734
+ /**
3735
+ * Determines if the given pstnStatus is in a state which implies the phone is provisioned
3736
+ * @param {String} pstnStatus
3737
+ * @returns {Boolean}
3738
+ * @private
3739
+ * @memberof Meeting
3740
+ */
3741
+
3742
+ }, {
3743
+ key: "isPhoneProvisioned",
3744
+ value: function isPhoneProvisioned(pstnStatus) {
3745
+ return [_constants.PSTN_STATUS.JOINED, _constants.PSTN_STATUS.CONNECTED, _constants.PSTN_STATUS.SUCCESS].includes(pstnStatus);
3671
3746
  }
3672
3747
  /**
3673
3748
  * Enable dial-in for audio
3674
- * @returns {Promise} Resolves once the dial-in request has completed
3749
+ * @returns {Promise} Resolves once the dial-in request has completed, or rejects if it failed
3675
3750
  * @private
3676
3751
  * @memberof Meeting
3677
3752
  */
@@ -3681,7 +3756,7 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
3681
3756
  value: function dialInPstn() {
3682
3757
  var _this33 = this;
3683
3758
 
3684
- if (this.dialInDeviceStatus === 'CONNECTED' || this.dialInDeviceStatus === 'JOINED') return _promise.default.resolve(); // prevent multiple dial in devices from being provisioned
3759
+ if (this.isPhoneProvisioned(this.dialInDeviceStatus)) return _promise.default.resolve(); // prevent multiple dial in devices from being provisioned
3685
3760
 
3686
3761
  var correlationId = this.correlationId,
3687
3762
  locusUrl = this.locusUrl;
@@ -3704,6 +3779,49 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
3704
3779
  reason: (_error$error2 = error.error) === null || _error$error2 === void 0 ? void 0 : _error$error2.message,
3705
3780
  stack: error.stack
3706
3781
  });
3782
+
3783
+ return _promise.default.reject(error);
3784
+ });
3785
+ }
3786
+ /**
3787
+ * Enable dial-out for audio
3788
+ * @param {String} phoneNumber Phone number to dial out to
3789
+ * @returns {Promise} Resolves once the dial-out request has completed (it doesn't wait for the user to answer the phone), or rejects if it failed
3790
+ * @private
3791
+ * @memberof Meeting
3792
+ */
3793
+
3794
+ }, {
3795
+ key: "dialOutPstn",
3796
+ value: function dialOutPstn(phoneNumber) {
3797
+ var _this34 = this;
3798
+
3799
+ if (this.isPhoneProvisioned(this.dialOutDeviceStatus)) return _promise.default.resolve(); // prevent multiple dial out devices from being provisioned
3800
+
3801
+ var correlationId = this.correlationId,
3802
+ locusUrl = this.locusUrl;
3803
+ if (!this.dialOutUrl) this.dialOutUrl = "dialout:///".concat(_uuid.default.v4());
3804
+ return this.meetingRequest.dialOut({
3805
+ correlationId: correlationId,
3806
+ dialOutUrl: this.dialOutUrl,
3807
+ phoneNumber: phoneNumber,
3808
+ locusUrl: locusUrl,
3809
+ clientUrl: this.deviceUrl
3810
+ }).then(function (res) {
3811
+ _this34.locusInfo.onFullLocus(res.body.locus);
3812
+ }).catch(function (error) {
3813
+ var _error$error3;
3814
+
3815
+ _metrics.default.sendOperationalMetric(_constants.METRICS_OPERATIONAL_MEASURES.ADD_DIAL_OUT_FAILURE, {
3816
+ correlation_id: _this34.correlationId,
3817
+ dial_out_url: _this34.dialOutUrl,
3818
+ locus_id: locusUrl.split('/').pop(),
3819
+ client_url: _this34.deviceUrl,
3820
+ reason: (_error$error3 = error.error) === null || _error$error3 === void 0 ? void 0 : _error$error3.message,
3821
+ stack: error.stack
3822
+ });
3823
+
3824
+ return _promise.default.reject(error);
3707
3825
  });
3708
3826
  }
3709
3827
  /**
@@ -3717,12 +3835,7 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
3717
3835
  }, {
3718
3836
  key: "disconnectPhoneAudio",
3719
3837
  value: function disconnectPhoneAudio() {
3720
- if (this.dialInDeviceStatus === 'CONNECTED') {
3721
- return _util.default.leavePstn(this, this.dialInUrl);
3722
- } // TODO: handle dial out
3723
-
3724
-
3725
- return _promise.default.resolve();
3838
+ return _promise.default.all([this.isPhoneProvisioned(this.dialInDeviceStatus) ? _util.default.disconnectPhoneAudio(this, this.dialInUrl) : _promise.default.resolve(), this.isPhoneProvisioned(this.dialOutDeviceStatus) ? _util.default.disconnectPhoneAudio(this, this.dialOutUrl) : _promise.default.resolve()]);
3726
3839
  }
3727
3840
  /**
3728
3841
  * Moves the call to the specified resourceId
@@ -3735,7 +3848,7 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
3735
3848
  }, {
3736
3849
  key: "moveTo",
3737
3850
  value: function moveTo(resourceId) {
3738
- var _this34 = this;
3851
+ var _this35 = this;
3739
3852
 
3740
3853
  if (!resourceId) {
3741
3854
  throw new _parameter.default('Cannot move call without a resourceId.');
@@ -3773,9 +3886,9 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
3773
3886
  resourceId: resourceId,
3774
3887
  moveToResource: true
3775
3888
  }).then(function () {
3776
- _this34.meetingFiniteStateMachine.join();
3889
+ _this35.meetingFiniteStateMachine.join();
3777
3890
 
3778
- return _this34.updateMedia({
3891
+ return _this35.updateMedia({
3779
3892
  mediaSettings: {
3780
3893
  sendVideo: false,
3781
3894
  receiveVideo: false,
@@ -3785,10 +3898,10 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
3785
3898
  receiveShare: false
3786
3899
  }
3787
3900
  }).then(function () {
3788
- return _promise.default.resolve(_this34);
3901
+ return _promise.default.resolve(_this35);
3789
3902
  });
3790
3903
  }).catch(function (error) {
3791
- _this34.meetingFiniteStateMachine.fail(error);
3904
+ _this35.meetingFiniteStateMachine.fail(error);
3792
3905
 
3793
3906
  return _promise.default.reject(error);
3794
3907
  });
@@ -3804,7 +3917,7 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
3804
3917
  }, {
3805
3918
  key: "moveFrom",
3806
3919
  value: function moveFrom(resourceId) {
3807
- var _this35 = this;
3920
+ var _this36 = this;
3808
3921
 
3809
3922
  if (!resourceId) {
3810
3923
  throw new _parameter.default('Cannot move call without a resourceId.');
@@ -3843,7 +3956,7 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
3843
3956
  });
3844
3957
 
3845
3958
  return _util.default.joinMeetingOptions(this).then(function (join) {
3846
- return _this35.getMediaStreams({
3959
+ return _this36.getMediaStreams({
3847
3960
  sendAudio: true,
3848
3961
  sendVideo: true,
3849
3962
  sendShare: false
@@ -3852,7 +3965,7 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
3852
3965
  localStream = _ref9[0],
3853
3966
  localShare = _ref9[1];
3854
3967
 
3855
- return _this35.updateMedia({
3968
+ return _this36.updateMedia({
3856
3969
  mediaSettings: {
3857
3970
  sendAudio: true,
3858
3971
  receiveAudio: true,
@@ -3867,14 +3980,14 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
3867
3980
  return _promise.default.resolve(join);
3868
3981
  });
3869
3982
  }).then(function () {
3870
- return _util.default.leaveMeeting(_this35, {
3983
+ return _util.default.leaveMeeting(_this36, {
3871
3984
  resourceId: resourceId,
3872
3985
  correlationId: oldCorrelationId,
3873
3986
  moveMeeting: true
3874
3987
  });
3875
3988
  });
3876
3989
  }).then(function () {
3877
- _this35.webex.meetings.meetingCollection.delete(_this35.id);
3990
+ _this36.webex.meetings.meetingCollection.delete(_this36.id);
3878
3991
 
3879
3992
  return _promise.default.resolve();
3880
3993
  });
@@ -3905,7 +4018,7 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
3905
4018
  * @memberof Meeting
3906
4019
  */
3907
4020
  function addMedia() {
3908
- var _this36 = this;
4021
+ var _this37 = this;
3909
4022
 
3910
4023
  var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
3911
4024
  var LOG_HEADER = 'Meeting:index#addMedia -->';
@@ -3953,53 +4066,53 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
3953
4066
  });
3954
4067
 
3955
4068
  return _util.default.validateOptions(options).then(function () {
3956
- _this36.mediaProperties.setMediaPeerConnection(_util2.default.createPeerConnection());
4069
+ _this37.mediaProperties.setMediaPeerConnection(_util2.default.createPeerConnection());
3957
4070
 
3958
- _this36.setMercuryListener();
4071
+ _this37.setMercuryListener();
3959
4072
 
3960
- _peerConnectionManager.default.setPeerConnectionEvents(_this36);
4073
+ _peerConnectionManager.default.setPeerConnectionEvents(_this37);
3961
4074
 
3962
- return _this36.preMedia(localStream, localShare, mediaSettings);
4075
+ return _this37.preMedia(localStream, localShare, mediaSettings);
3963
4076
  }).then(function () {
3964
- return _media.default.attachMedia(_this36.mediaProperties, {
3965
- meetingId: _this36.id,
3966
- remoteQualityLevel: _this36.mediaProperties.remoteQualityLevel,
3967
- enableRtx: _this36.config.enableRtx,
3968
- enableExtmap: _this36.config.enableExtmap
4077
+ return _media.default.attachMedia(_this37.mediaProperties, {
4078
+ meetingId: _this37.id,
4079
+ remoteQualityLevel: _this37.mediaProperties.remoteQualityLevel,
4080
+ enableRtx: _this37.config.enableRtx,
4081
+ enableExtmap: _this37.config.enableExtmap
3969
4082
  }).then(function (peerConnection) {
3970
- return _this36.getDevices().then(function (devices) {
4083
+ return _this37.getDevices().then(function (devices) {
3971
4084
  _util.default.handleDeviceLogging(devices);
3972
4085
 
3973
4086
  return peerConnection;
3974
4087
  });
3975
4088
  }).then(function (peerConnection) {
3976
- _this36.handleMediaLogging(_this36.mediaProperties);
4089
+ _this37.handleMediaLogging(_this37.mediaProperties);
3977
4090
 
3978
4091
  _loggerProxy.default.logger.info("".concat(LOG_HEADER, " PeerConnection Received from attachMedia "));
3979
4092
 
3980
- _this36.setRemoteStream(peerConnection);
4093
+ _this37.setRemoteStream(peerConnection);
3981
4094
 
3982
- _util.default.startInternalStats(_this36);
4095
+ _util.default.startInternalStats(_this37);
3983
4096
 
3984
- if (_this36.config.metrics.autoSendMQA) {
3985
- _this36.startMediaQualityMetrics();
4097
+ if (_this37.config.metrics.autoSendMQA) {
4098
+ _this37.startMediaQualityMetrics();
3986
4099
  }
3987
4100
 
3988
- if (_this36.config.stats.enableStatsAnalyzer) {
4101
+ if (_this37.config.stats.enableStatsAnalyzer) {
3989
4102
  // TODO: ** Dont re create StatsAnalyzer on reconnect or rejoin
3990
- _this36.networkQualityMonitor = new _networkQualityMonitor.default(_this36.config.stats);
3991
- _this36.statsAnalyzer = new _statsAnalyzer.default(_this36.config.stats, _this36.networkQualityMonitor);
4103
+ _this37.networkQualityMonitor = new _networkQualityMonitor.default(_this37.config.stats);
4104
+ _this37.statsAnalyzer = new _statsAnalyzer.default(_this37.config.stats, _this37.networkQualityMonitor);
3992
4105
 
3993
- _this36.statsAnalyzer.on(_constants.EVENT_TRIGGERS.MEDIA_QUALITY, function (options) {
3994
- var _this36$webex$meeting;
4106
+ _this37.statsAnalyzer.on(_constants.EVENT_TRIGGERS.MEDIA_QUALITY, function (options) {
4107
+ var _this37$webex$meeting;
3995
4108
 
3996
4109
  // TODO: might have to send the same event to the developer
3997
4110
  // Add ip address info if geo hint is present
3998
- options.data.intervalMetadata.peerReflexiveIP = ((_this36$webex$meeting = _this36.webex.meetings.geoHintInfo) === null || _this36$webex$meeting === void 0 ? void 0 : _this36$webex$meeting.clientAddress) || options.data.intervalMetadata.peerReflexiveIP || _constants.MQA_STATS.DEFAULT_IP;
4111
+ options.data.intervalMetadata.peerReflexiveIP = ((_this37$webex$meeting = _this37.webex.meetings.geoHintInfo) === null || _this37$webex$meeting === void 0 ? void 0 : _this37$webex$meeting.clientAddress) || options.data.intervalMetadata.peerReflexiveIP || _constants.MQA_STATS.DEFAULT_IP;
3999
4112
 
4000
4113
  _metrics.default.postEvent({
4001
4114
  event: _config.eventType.MEDIA_QUALITY,
4002
- meeting: _this36,
4115
+ meeting: _this37,
4003
4116
  data: {
4004
4117
  intervalData: options.data,
4005
4118
  networkType: options.networkType
@@ -4007,14 +4120,14 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
4007
4120
  });
4008
4121
  });
4009
4122
 
4010
- _this36.networkQualityMonitor.on(_constants.EVENT_TRIGGERS.NETWORK_QUALITY, _this36.sendNetworkQualityEvent.bind(_this36));
4123
+ _this37.networkQualityMonitor.on(_constants.EVENT_TRIGGERS.NETWORK_QUALITY, _this37.sendNetworkQualityEvent.bind(_this37));
4011
4124
  }
4012
4125
  }).catch(function (error) {
4013
4126
  _loggerProxy.default.logger.error("".concat(LOG_HEADER, " Error adding media , setting up peerconnection, "), error);
4014
4127
 
4015
4128
  _metrics.default.sendOperationalMetric(_constants.METRICS_OPERATIONAL_MEASURES.ADD_MEDIA_FAILURE, {
4016
- correlation_id: _this36.correlationId,
4017
- locus_id: _this36.locusUrl.split('/').pop(),
4129
+ correlation_id: _this37.correlationId,
4130
+ locus_id: _this37.locusUrl.split('/').pop(),
4018
4131
  reason: error.message,
4019
4132
  stack: error.stack
4020
4133
  });
@@ -4025,14 +4138,14 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
4025
4138
  var timerCount = 0; // eslint-disable-next-line func-names
4026
4139
  // eslint-disable-next-line prefer-arrow-callback
4027
4140
 
4028
- if (_this36.type === _constants._CALL_) {
4141
+ if (_this37.type === _constants._CALL_) {
4029
4142
  resolve();
4030
4143
  }
4031
4144
 
4032
4145
  var joiningTimer = setInterval(function () {
4033
4146
  timerCount += 1;
4034
4147
 
4035
- if (_this36.meetingState === _constants.FULL_STATE.ACTIVE) {
4148
+ if (_this37.meetingState === _constants.FULL_STATE.ACTIVE) {
4036
4149
  clearInterval(joiningTimer);
4037
4150
  resolve();
4038
4151
  }
@@ -4044,10 +4157,10 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
4044
4157
  }, 1000);
4045
4158
  });
4046
4159
  }).then(function () {
4047
- return logRequest(_this36.roap.sendRoapMediaRequest({
4048
- sdp: _this36.mediaProperties.peerConnection.sdp,
4049
- roapSeq: _this36.roapSeq,
4050
- meeting: _this36 // or can pass meeting ID
4160
+ return logRequest(_this37.roap.sendRoapMediaRequest({
4161
+ sdp: _this37.mediaProperties.peerConnection.sdp,
4162
+ roapSeq: _this37.roapSeq,
4163
+ meeting: _this37 // or can pass meeting ID
4051
4164
 
4052
4165
  }), {
4053
4166
  header: "".concat(LOG_HEADER, " Send Roap Media Request."),
@@ -4055,7 +4168,7 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
4055
4168
  failure: "".concat(LOG_HEADER, " Error joining the call on send roap media request, ")
4056
4169
  });
4057
4170
  }).then(function () {
4058
- var peerConnection = _this36.mediaProperties.peerConnection;
4171
+ var peerConnection = _this37.mediaProperties.peerConnection;
4059
4172
  return new _promise.default(function (resolve, reject) {
4060
4173
  if (peerConnection.connectionState === _constants.CONNECTION_STATE.CONNECTED) {
4061
4174
  _loggerProxy.default.logger.info("".concat(LOG_HEADER, " PeerConnection CONNECTED"));
@@ -4076,7 +4189,7 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
4076
4189
  }
4077
4190
  }, _constants.PC_BAIL_TIMEOUT);
4078
4191
 
4079
- _this36.once(_constants.EVENT_TRIGGERS.MEDIA_READY, function () {
4192
+ _this37.once(_constants.EVENT_TRIGGERS.MEDIA_READY, function () {
4080
4193
  _loggerProxy.default.logger.info("".concat(LOG_HEADER, " PeerConnection CONNECTED, clearing stability timer."));
4081
4194
 
4082
4195
  clearTimeout(stabilityTimeout);
@@ -4085,51 +4198,51 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
4085
4198
  });
4086
4199
  }).then(function () {
4087
4200
  if (mediaSettings && mediaSettings.sendShare && localShare) {
4088
- if (_this36.state === _constants.MEETING_STATE.STATES.JOINED) {
4089
- return _this36.share();
4201
+ if (_this37.state === _constants.MEETING_STATE.STATES.JOINED) {
4202
+ return _this37.share();
4090
4203
  } // When the self state changes to JOINED then request the floor
4091
4204
 
4092
4205
 
4093
- _this36.floorGrantPending = true;
4206
+ _this37.floorGrantPending = true;
4094
4207
  }
4095
4208
 
4096
4209
  return _promise.default.resolve();
4097
4210
  });
4098
4211
  }).catch(function (error) {
4099
4212
  // Clean up stats analyzer, peer connection, and turn off listeners
4100
- if (_this36.statsAnalyzer) {
4101
- _this36.statsAnalyzer.stopAnalyzer();
4213
+ if (_this37.statsAnalyzer) {
4214
+ _this37.statsAnalyzer.stopAnalyzer();
4102
4215
 
4103
- _this36.statsAnalyzer = null;
4216
+ _this37.statsAnalyzer = null;
4104
4217
  }
4105
4218
 
4106
- if (_this36.mediaProperties.peerConnection) {
4107
- _this36.closePeerConnections();
4219
+ if (_this37.mediaProperties.peerConnection) {
4220
+ _this37.closePeerConnections();
4108
4221
 
4109
- _this36.unsetPeerConnections();
4222
+ _this37.unsetPeerConnections();
4110
4223
  }
4111
4224
 
4112
4225
  _loggerProxy.default.logger.error("".concat(LOG_HEADER, " Error adding media failed to initiate PC and send request, "), error);
4113
4226
 
4114
4227
  _metrics.default.sendOperationalMetric(_constants.METRICS_OPERATIONAL_MEASURES.ADD_MEDIA_FAILURE, {
4115
- correlation_id: _this36.correlationId,
4116
- locus_id: _this36.locusUrl.split('/').pop(),
4228
+ correlation_id: _this37.correlationId,
4229
+ locus_id: _this37.locusUrl.split('/').pop(),
4117
4230
  reason: error.message,
4118
4231
  stack: error.stack,
4119
4232
  code: error.code
4120
4233
  }); // Upload logs on error while adding media
4121
4234
 
4122
4235
 
4123
- _triggerProxy.default.trigger(_this36, {
4236
+ _triggerProxy.default.trigger(_this37, {
4124
4237
  file: 'meeting/index',
4125
4238
  function: 'addMedia'
4126
- }, _constants.EVENTS.REQUEST_UPLOAD_LOGS, _this36); // If addMedia failes for not establishing connection then
4239
+ }, _constants.EVENTS.REQUEST_UPLOAD_LOGS, _this37); // If addMedia failes for not establishing connection then
4127
4240
  // leave the meeting with reson connection failed as meeting anyways will end
4128
4241
  // and cannot be connected unless network condition is checked for firewall
4129
4242
 
4130
4243
 
4131
4244
  if (error.code === _webexErrors.InvalidSdpError.CODE) {
4132
- _this36.leave({
4245
+ _this37.leave({
4133
4246
  reason: _constants.MEETING_REMOVED_REASON.MEETING_CONNECTION_FAILED
4134
4247
  });
4135
4248
  }
@@ -4159,7 +4272,7 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
4159
4272
  }, {
4160
4273
  key: "enqueueMediaUpdate",
4161
4274
  value: function enqueueMediaUpdate(mediaUpdateType, options) {
4162
- var _this37 = this;
4275
+ var _this38 = this;
4163
4276
 
4164
4277
  return new _promise.default(function (resolve, reject) {
4165
4278
  var queueItem = {
@@ -4171,7 +4284,7 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
4171
4284
 
4172
4285
  _loggerProxy.default.logger.log("Meeting:index#enqueueMediaUpdate --> enqueuing media update type=".concat(mediaUpdateType));
4173
4286
 
4174
- _this37.queuedMediaUpdates.push(queueItem);
4287
+ _this38.queuedMediaUpdates.push(queueItem);
4175
4288
  });
4176
4289
  }
4177
4290
  /**
@@ -4197,7 +4310,7 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
4197
4310
  * @memberof Meeting
4198
4311
  */
4199
4312
  function updateMedia() {
4200
- var _this38 = this;
4313
+ var _this39 = this;
4201
4314
 
4202
4315
  var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
4203
4316
  var LOG_HEADER = 'Meeting:index#updateMedia -->';
@@ -4211,17 +4324,17 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
4211
4324
  mediaSettings = options.mediaSettings;
4212
4325
  var previousSendShareStatus = this.mediaProperties.mediaDirection.sendShare;
4213
4326
  return _util.default.validateOptions(options).then(function () {
4214
- return _this38.preMedia(localStream, localShare, mediaSettings);
4327
+ return _this39.preMedia(localStream, localShare, mediaSettings);
4215
4328
  }).then(function () {
4216
- return _media.default.updateMedia(_this38.mediaProperties, {
4217
- meetingId: _this38.id,
4218
- remoteQualityLevel: _this38.mediaProperties.remoteQualityLevel,
4219
- enableRtx: _this38.config.enableRtx,
4220
- enableExtmap: _this38.config.enableExtmap
4329
+ return _media.default.updateMedia(_this39.mediaProperties, {
4330
+ meetingId: _this39.id,
4331
+ remoteQualityLevel: _this39.mediaProperties.remoteQualityLevel,
4332
+ enableRtx: _this39.config.enableRtx,
4333
+ enableExtmap: _this39.config.enableExtmap
4221
4334
  }).then(function (peerConnection) {
4222
4335
  _loggerProxy.default.logger.info("".concat(LOG_HEADER, " PeerConnection received from updateMedia, ").concat(peerConnection));
4223
4336
 
4224
- _this38.setRemoteStream(peerConnection);
4337
+ _this39.setRemoteStream(peerConnection);
4225
4338
 
4226
4339
  if (mediaSettings.receiveShare || localShare) {
4227
4340
  _peerConnectionManager.default.setContentSlides(peerConnection);
@@ -4230,18 +4343,18 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
4230
4343
  _loggerProxy.default.logger.error("".concat(LOG_HEADER, " Error updatedMedia, "), error);
4231
4344
 
4232
4345
  _metrics.default.sendOperationalMetric(_constants.METRICS_OPERATIONAL_MEASURES.UPDATE_MEDIA_FAILURE, {
4233
- correlation_id: _this38.correlationId,
4234
- locus_id: _this38.locusUrl.split('/').pop(),
4346
+ correlation_id: _this39.correlationId,
4347
+ locus_id: _this39.locusUrl.split('/').pop(),
4235
4348
  reason: error.message,
4236
4349
  stack: error.stack
4237
4350
  });
4238
4351
 
4239
4352
  throw error;
4240
4353
  }).then(function () {
4241
- return logRequest(_this38.roap.sendRoapMediaRequest({
4242
- sdp: _this38.mediaProperties.peerConnection.sdp,
4243
- roapSeq: _this38.roapSeq,
4244
- meeting: _this38 // or can pass meeting ID
4354
+ return logRequest(_this39.roap.sendRoapMediaRequest({
4355
+ sdp: _this39.mediaProperties.peerConnection.sdp,
4356
+ roapSeq: _this39.roapSeq,
4357
+ meeting: _this39 // or can pass meeting ID
4245
4358
 
4246
4359
  }), {
4247
4360
  header: "".concat(LOG_HEADER, " sendRoapMediaRequest being sent"),
@@ -4249,13 +4362,13 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
4249
4362
  failure: "".concat(LOG_HEADER, " Error updateMedia on send roap media request, ")
4250
4363
  });
4251
4364
  }).then(function () {
4252
- return _this38.checkForStopShare(mediaSettings.sendShare, previousSendShareStatus);
4365
+ return _this39.checkForStopShare(mediaSettings.sendShare, previousSendShareStatus);
4253
4366
  }).then(function (startShare) {
4254
4367
  // This is a special case if we do an /floor grant followed by /media
4255
4368
  // we actually get a OFFER from the server and a GLAR condition happens
4256
4369
  if (startShare) {
4257
4370
  // We are assuming that the clients are connected when doing an update
4258
- return _this38.share();
4371
+ return _this39.share();
4259
4372
  }
4260
4373
 
4261
4374
  return _promise.default.resolve();
@@ -4276,7 +4389,7 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
4276
4389
  }, {
4277
4390
  key: "updateAudio",
4278
4391
  value: function updateAudio(options) {
4279
- var _this39 = this;
4392
+ var _this40 = this;
4280
4393
 
4281
4394
  if (!this.canUpdateMedia()) {
4282
4395
  return this.enqueueMediaUpdate(MEDIA_UPDATE_TYPE.AUDIO, options);
@@ -4299,13 +4412,13 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
4299
4412
  }).then(function () {
4300
4413
  var previousMediaDirection = {};
4301
4414
 
4302
- if (_this39.mediaProperties.mediaDirection) {
4415
+ if (_this40.mediaProperties.mediaDirection) {
4303
4416
  previousMediaDirection = {
4304
- sendTrack: _this39.mediaProperties.mediaDirection.sendAudio,
4305
- receiveTrack: _this39.mediaProperties.mediaDirection.receiveAudio
4417
+ sendTrack: _this40.mediaProperties.mediaDirection.sendAudio,
4418
+ receiveTrack: _this40.mediaProperties.mediaDirection.receiveAudio
4306
4419
  };
4307
4420
  } else {
4308
- _this39.mediaProperties.mediaDirection = {};
4421
+ _this40.mediaProperties.mediaDirection = {};
4309
4422
  }
4310
4423
 
4311
4424
  return _util.default.updateTransceiver({
@@ -4314,20 +4427,20 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
4314
4427
  receiveTrack: options.receiveAudio,
4315
4428
  track: track,
4316
4429
  transceiver: audioTransceiver,
4317
- peerConnection: _this39.mediaProperties.peerConnection,
4430
+ peerConnection: _this40.mediaProperties.peerConnection,
4318
4431
  previousMediaDirection: previousMediaDirection
4319
4432
  }, {
4320
- mediaProperties: _this39.mediaProperties,
4321
- meeting: _this39,
4322
- id: _this39.id
4433
+ mediaProperties: _this40.mediaProperties,
4434
+ meeting: _this40,
4435
+ id: _this40.id
4323
4436
  });
4324
4437
  }).then(function () {
4325
- _this39.setLocalAudioTrack(track);
4438
+ _this40.setLocalAudioTrack(track);
4326
4439
 
4327
- _this39.mediaProperties.mediaDirection.sendAudio = sendAudio;
4328
- _this39.mediaProperties.mediaDirection.receiveAudio = receiveAudio; // audio state could be undefined if you have not sent audio before
4440
+ _this40.mediaProperties.mediaDirection.sendAudio = sendAudio;
4441
+ _this40.mediaProperties.mediaDirection.receiveAudio = receiveAudio; // audio state could be undefined if you have not sent audio before
4329
4442
 
4330
- _this39.audio = _this39.audio || (0, _muteState.default)(_constants.AUDIO, _this39, _this39.mediaProperties.mediaDirection);
4443
+ _this40.audio = _this40.audio || (0, _muteState.default)(_constants.AUDIO, _this40, _this40.mediaProperties.mediaDirection);
4331
4444
  });
4332
4445
  }
4333
4446
  /**
@@ -4344,7 +4457,7 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
4344
4457
  }, {
4345
4458
  key: "updateVideo",
4346
4459
  value: function updateVideo(options) {
4347
- var _this40 = this;
4460
+ var _this41 = this;
4348
4461
 
4349
4462
  if (!this.canUpdateMedia()) {
4350
4463
  return this.enqueueMediaUpdate(MEDIA_UPDATE_TYPE.VIDEO, options);
@@ -4371,23 +4484,23 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
4371
4484
  receiveTrack: options.receiveVideo,
4372
4485
  track: track,
4373
4486
  transceiver: videoTransceiver,
4374
- peerConnection: _this40.mediaProperties.peerConnection,
4487
+ peerConnection: _this41.mediaProperties.peerConnection,
4375
4488
  previousMediaDirection: {
4376
- sendTrack: _this40.mediaProperties.mediaDirection.sendVideo,
4377
- receiveTrack: _this40.mediaProperties.mediaDirection.receiveVideo
4489
+ sendTrack: _this41.mediaProperties.mediaDirection.sendVideo,
4490
+ receiveTrack: _this41.mediaProperties.mediaDirection.receiveVideo
4378
4491
  }
4379
4492
  }, {
4380
- mediaProperties: _this40.mediaProperties,
4381
- meeting: _this40,
4382
- id: _this40.id
4493
+ mediaProperties: _this41.mediaProperties,
4494
+ meeting: _this41,
4495
+ id: _this41.id
4383
4496
  });
4384
4497
  }).then(function () {
4385
- _this40.setLocalVideoTrack(track);
4498
+ _this41.setLocalVideoTrack(track);
4386
4499
 
4387
- _this40.mediaProperties.mediaDirection.sendVideo = sendVideo;
4388
- _this40.mediaProperties.mediaDirection.receiveVideo = receiveVideo; // video state could be undefined if you have not sent video before
4500
+ _this41.mediaProperties.mediaDirection.sendVideo = sendVideo;
4501
+ _this41.mediaProperties.mediaDirection.receiveVideo = receiveVideo; // video state could be undefined if you have not sent video before
4389
4502
 
4390
- _this40.video = _this40.video || (0, _muteState.default)(_constants.VIDEO, _this40, _this40.mediaProperties.mediaDirection);
4503
+ _this41.video = _this41.video || (0, _muteState.default)(_constants.VIDEO, _this41, _this41.mediaProperties.mediaDirection);
4391
4504
  });
4392
4505
  }
4393
4506
  /**
@@ -4429,7 +4542,7 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
4429
4542
  }, {
4430
4543
  key: "updateShare",
4431
4544
  value: function updateShare(options) {
4432
- var _this41 = this;
4545
+ var _this42 = this;
4433
4546
 
4434
4547
  if (!options.skipSignalingCheck && !this.canUpdateMedia()) {
4435
4548
  return this.enqueueMediaUpdate(MEDIA_UPDATE_TYPE.SHARE, options);
@@ -4452,7 +4565,7 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
4452
4565
  sendShare: sendShare,
4453
4566
  localShare: stream
4454
4567
  }).then(function () {
4455
- return _this41.checkForStopShare(sendShare, previousSendShareStatus);
4568
+ return _this42.checkForStopShare(sendShare, previousSendShareStatus);
4456
4569
  }).then(function (startShare) {
4457
4570
  return _util.default.updateTransceiver({
4458
4571
  type: 'video',
@@ -4460,41 +4573,41 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
4460
4573
  receiveTrack: receiveShare,
4461
4574
  track: track,
4462
4575
  transceiver: shareTransceiver,
4463
- peerConnection: _this41.mediaProperties.peerConnection,
4576
+ peerConnection: _this42.mediaProperties.peerConnection,
4464
4577
  previousMediaDirection: {
4465
- sendTrack: _this41.mediaProperties.mediaDirection.sendShare,
4466
- receiveTrack: _this41.mediaProperties.mediaDirection.receiveShare
4578
+ sendTrack: _this42.mediaProperties.mediaDirection.sendShare,
4579
+ receiveTrack: _this42.mediaProperties.mediaDirection.receiveShare
4467
4580
  }
4468
4581
  }, {
4469
- mediaProperties: _this41.mediaProperties,
4470
- meeting: _this41,
4471
- id: _this41.id
4582
+ mediaProperties: _this42.mediaProperties,
4583
+ meeting: _this42,
4584
+ id: _this42.id
4472
4585
  }).then(function () {
4473
4586
  if (startShare) {
4474
- return _this41.share();
4587
+ return _this42.share();
4475
4588
  }
4476
4589
 
4477
4590
  return _promise.default.resolve();
4478
4591
  });
4479
4592
  }).then(function () {
4480
- _this41.mediaProperties.mediaDirection.sendShare = sendShare;
4481
- _this41.mediaProperties.mediaDirection.receiveShare = receiveShare;
4593
+ _this42.mediaProperties.mediaDirection.sendShare = sendShare;
4594
+ _this42.mediaProperties.mediaDirection.receiveShare = receiveShare;
4482
4595
  }).catch(function (error) {
4483
- _this41.unsetLocalShareTrack(stream);
4596
+ _this42.unsetLocalShareTrack(stream);
4484
4597
 
4485
4598
  throw error;
4486
4599
  }).finally(function () {
4487
4600
  var delay = 1e3; // Check to see if share was stopped natively before onended was assigned.
4488
4601
 
4489
- var sharingModeIsActive = _this41.mediaProperties.peerConnection.shareTransceiver.direction === _constants.SENDRECV;
4490
- var isSharingOutOfSync = sharingModeIsActive && !_this41.isLocalShareLive;
4602
+ var sharingModeIsActive = _this42.mediaProperties.peerConnection.shareTransceiver.direction === _constants.SENDRECV;
4603
+ var isSharingOutOfSync = sharingModeIsActive && !_this42.isLocalShareLive;
4491
4604
 
4492
4605
  if (isSharingOutOfSync) {
4493
4606
  // Adding a delay to avoid a 409 from server
4494
4607
  // which results in user still appearing as if sharing.
4495
4608
  // Also delay give time for changes to peerConnection.
4496
4609
  setTimeout(function () {
4497
- return _this41.handleShareTrackEnded(stream);
4610
+ return _this42.handleShareTrackEnded(stream);
4498
4611
  }, delay);
4499
4612
  }
4500
4613
  });
@@ -4534,7 +4647,7 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
4534
4647
  }, {
4535
4648
  key: "acknowledge",
4536
4649
  value: function acknowledge(type) {
4537
- var _this42 = this;
4650
+ var _this43 = this;
4538
4651
 
4539
4652
  if (!type) {
4540
4653
  return _promise.default.reject(new _parameter.default('Type must be set to acknowledge the meeting.'));
@@ -4548,11 +4661,11 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
4548
4661
  }).then(function (response) {
4549
4662
  return _promise.default.resolve(response);
4550
4663
  }).then(function (response) {
4551
- _this42.meetingFiniteStateMachine.ring(type);
4664
+ _this43.meetingFiniteStateMachine.ring(type);
4552
4665
 
4553
4666
  _metrics.default.postEvent({
4554
4667
  event: _config.eventType.ALERT_DISPLAYED,
4555
- meeting: _this42
4668
+ meeting: _this43
4556
4669
  });
4557
4670
 
4558
4671
  return _promise.default.resolve({
@@ -4577,14 +4690,14 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
4577
4690
  }, {
4578
4691
  key: "decline",
4579
4692
  value: function decline(reason) {
4580
- var _this43 = this;
4693
+ var _this44 = this;
4581
4694
 
4582
4695
  return _util.default.declineMeeting(this, reason).then(function (decline) {
4583
- _this43.meetingFiniteStateMachine.decline();
4696
+ _this44.meetingFiniteStateMachine.decline();
4584
4697
 
4585
4698
  return _promise.default.resolve(decline);
4586
4699
  }).catch(function (error) {
4587
- _this43.meetingFiniteStateMachine.fail(error);
4700
+ _this44.meetingFiniteStateMachine.fail(error);
4588
4701
 
4589
4702
  return _promise.default.reject(error);
4590
4703
  });
@@ -4601,7 +4714,7 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
4601
4714
  }, {
4602
4715
  key: "leave",
4603
4716
  value: function leave() {
4604
- var _this44 = this;
4717
+ var _this45 = this;
4605
4718
 
4606
4719
  var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
4607
4720
 
@@ -4619,41 +4732,41 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
4619
4732
  _loggerProxy.default.logger.log('Meeting:index#leave --> Leaving a meeting');
4620
4733
 
4621
4734
  return _util.default.leaveMeeting(this, options).then(function (leave) {
4622
- _this44.meetingFiniteStateMachine.leave();
4735
+ _this45.meetingFiniteStateMachine.leave();
4623
4736
 
4624
- _this44.audio = null;
4625
- _this44.video = null;
4626
- _this44.isSharing = false;
4737
+ _this45.audio = null;
4738
+ _this45.video = null;
4739
+ _this45.isSharing = false;
4627
4740
 
4628
- if (_this44.shareStatus === _constants.SHARE_STATUS.LOCAL_SHARE_ACTIVE) {
4629
- _this44.shareStatus = _constants.SHARE_STATUS.NO_SHARE;
4741
+ if (_this45.shareStatus === _constants.SHARE_STATUS.LOCAL_SHARE_ACTIVE) {
4742
+ _this45.shareStatus = _constants.SHARE_STATUS.NO_SHARE;
4630
4743
  }
4631
4744
 
4632
- _this44.queuedMediaUpdates = [];
4745
+ _this45.queuedMediaUpdates = [];
4633
4746
 
4634
- if (_this44.transcription) {
4635
- _this44.transcription.closeSocket();
4747
+ if (_this45.transcription) {
4748
+ _this45.transcription.closeSocket();
4636
4749
 
4637
- _this44.triggerStopReceivingTranscriptionEvent();
4750
+ _this45.triggerStopReceivingTranscriptionEvent();
4638
4751
 
4639
- _this44.transcription = undefined;
4752
+ _this45.transcription = undefined;
4640
4753
  } // upload logs on leave irrespective of meeting delete
4641
4754
 
4642
4755
 
4643
- _triggerProxy.default.trigger(_this44, {
4756
+ _triggerProxy.default.trigger(_this45, {
4644
4757
  file: 'meeting/index',
4645
4758
  function: 'leave'
4646
- }, _constants.EVENTS.REQUEST_UPLOAD_LOGS, _this44); // TODO: more testing before we remove this code, we are not sure the scenarios for destroy here
4759
+ }, _constants.EVENTS.REQUEST_UPLOAD_LOGS, _this45); // TODO: more testing before we remove this code, we are not sure the scenarios for destroy here
4647
4760
 
4648
4761
 
4649
- if (_this44.wirelessShare || _this44.guest) {
4762
+ if (_this45.wirelessShare || _this45.guest) {
4650
4763
  // If screen sharing clean the meeting object
4651
- _triggerProxy.default.trigger(_this44, {
4764
+ _triggerProxy.default.trigger(_this45, {
4652
4765
  file: 'meeting/index',
4653
4766
  function: 'leave'
4654
4767
  }, _constants.EVENTS.DESTROY_MEETING, {
4655
4768
  reason: options.reason,
4656
- meetingId: _this44.id
4769
+ meetingId: _this45.id
4657
4770
  });
4658
4771
  }
4659
4772
 
@@ -4661,19 +4774,19 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
4661
4774
 
4662
4775
  return leave;
4663
4776
  }).catch(function (error) {
4664
- _this44.meetingFiniteStateMachine.fail(error);
4777
+ _this45.meetingFiniteStateMachine.fail(error);
4665
4778
 
4666
4779
  _loggerProxy.default.logger.error('Meeting:index#leave --> Failed to leave ', error); // upload logs on leave irrespective of meeting delete
4667
4780
 
4668
4781
 
4669
- _triggerProxy.default.trigger(_this44, {
4782
+ _triggerProxy.default.trigger(_this45, {
4670
4783
  file: 'meeting/index',
4671
4784
  function: 'leave'
4672
- }, _constants.EVENTS.REQUEST_UPLOAD_LOGS, _this44);
4785
+ }, _constants.EVENTS.REQUEST_UPLOAD_LOGS, _this45);
4673
4786
 
4674
4787
  _metrics.default.sendOperationalMetric(_constants.METRICS_OPERATIONAL_MEASURES.MEETING_LEAVE_FAILURE, {
4675
- correlation_id: _this44.correlationId,
4676
- locus_id: _this44.locusUrl.split('/').pop(),
4788
+ correlation_id: _this45.correlationId,
4789
+ locus_id: _this45.locusUrl.split('/').pop(),
4677
4790
  reason: error.message,
4678
4791
  stack: error.stack,
4679
4792
  code: error.code
@@ -4692,7 +4805,7 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
4692
4805
  }, {
4693
4806
  key: "share",
4694
4807
  value: function share() {
4695
- var _this45 = this;
4808
+ var _this46 = this;
4696
4809
 
4697
4810
  var content = this.locusInfo.mediaShares.find(function (element) {
4698
4811
  return element.name === _constants.CONTENT;
@@ -4711,14 +4824,14 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
4711
4824
  uri: content.url,
4712
4825
  resourceUrl: this.resourceUrl
4713
4826
  }).then(function () {
4714
- _this45.isSharing = true;
4827
+ _this46.isSharing = true;
4715
4828
  return _promise.default.resolve();
4716
4829
  }).catch(function (error) {
4717
4830
  _loggerProxy.default.logger.error('Meeting:index#share --> Error ', error);
4718
4831
 
4719
4832
  _metrics.default.sendOperationalMetric(_constants.METRICS_OPERATIONAL_MEASURES.MEETING_SHARE_FAILURE, {
4720
- correlation_id: _this45.correlationId,
4721
- locus_id: _this45.locusUrl.split('/').pop(),
4833
+ correlation_id: _this46.correlationId,
4834
+ locus_id: _this46.locusUrl.split('/').pop(),
4722
4835
  reason: error.message,
4723
4836
  stack: error.stack
4724
4837
  });
@@ -4757,7 +4870,7 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
4757
4870
  }, {
4758
4871
  key: "stopFloorRequest",
4759
4872
  value: function stopFloorRequest() {
4760
- var _this46 = this;
4873
+ var _this47 = this;
4761
4874
 
4762
4875
  var content = this.locusInfo.mediaShares.find(function (element) {
4763
4876
  return element.name === _constants.CONTENT;
@@ -4787,15 +4900,15 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
4787
4900
  _loggerProxy.default.logger.error('Meeting:index#stopFloorRequest --> Error ', error);
4788
4901
 
4789
4902
  _metrics.default.sendOperationalMetric(_constants.METRICS_OPERATIONAL_MEASURES.STOP_FLOOR_REQUEST_FAILURE, {
4790
- correlation_id: _this46.correlationId,
4791
- locus_id: _this46.locusUrl.split('/').pop(),
4903
+ correlation_id: _this47.correlationId,
4904
+ locus_id: _this47.locusUrl.split('/').pop(),
4792
4905
  reason: error.message,
4793
4906
  stack: error.stack
4794
4907
  });
4795
4908
 
4796
4909
  return _promise.default.reject(error);
4797
4910
  }).finally(function () {
4798
- _this46.isSharing = false;
4911
+ _this47.isSharing = false;
4799
4912
  });
4800
4913
  }
4801
4914
 
@@ -4931,7 +5044,7 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
4931
5044
  }, {
4932
5045
  key: "changeVideoLayout",
4933
5046
  value: function changeVideoLayout(layoutType) {
4934
- var _this47 = this;
5047
+ var _this48 = this;
4935
5048
 
4936
5049
  var renderInfo = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
4937
5050
  var main = renderInfo.main,
@@ -4994,7 +5107,7 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
4994
5107
  content: layoutInfo.content
4995
5108
  }).then(function (response) {
4996
5109
  if (response && response.body && response.body.locus) {
4997
- _this47.locusInfo.onFullLocus(response.body.locus);
5110
+ _this48.locusInfo.onFullLocus(response.body.locus);
4998
5111
  }
4999
5112
  }).catch(function (error) {
5000
5113
  _loggerProxy.default.logger.error('Meeting:index#changeVideoLayout --> Error ', error);
@@ -5011,7 +5124,7 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
5011
5124
  }, {
5012
5125
  key: "setLocalVideoQuality",
5013
5126
  value: function setLocalVideoQuality(level) {
5014
- var _this48 = this;
5127
+ var _this49 = this;
5015
5128
 
5016
5129
  _loggerProxy.default.logger.log("Meeting:index#setLocalVideoQuality --> Setting quality to ".concat(level));
5017
5130
 
@@ -5041,7 +5154,7 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
5041
5154
  var _ref11 = (0, _slicedToArray2.default)(_ref10, 1),
5042
5155
  localStream = _ref11[0];
5043
5156
 
5044
- return _this48.updateVideo({
5157
+ return _this49.updateVideo({
5045
5158
  sendVideo: true,
5046
5159
  receiveVideo: true,
5047
5160
  stream: localStream
@@ -5089,7 +5202,7 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
5089
5202
  }, {
5090
5203
  key: "setMeetingQuality",
5091
5204
  value: function setMeetingQuality(level) {
5092
- var _this49 = this;
5205
+ var _this50 = this;
5093
5206
 
5094
5207
  _loggerProxy.default.logger.log("Meeting:index#setMeetingQuality --> Setting quality to ".concat(level));
5095
5208
 
@@ -5114,18 +5227,18 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
5114
5227
  receiveVideo = _this$mediaProperties4.receiveVideo,
5115
5228
  sendVideo = _this$mediaProperties4.sendVideo;
5116
5229
  return (sendVideo ? this.setLocalVideoQuality(level) : _promise.default.resolve()).then(function () {
5117
- return receiveAudio || receiveVideo ? _this49.setRemoteQualityLevel(level) : _promise.default.resolve();
5230
+ return receiveAudio || receiveVideo ? _this50.setRemoteQualityLevel(level) : _promise.default.resolve();
5118
5231
  }).catch(function (error) {
5119
5232
  // From troubleshooting it seems that the stream itself doesn't change the max-fs if the peer connection isn't stable
5120
- _this49.mediaProperties.setLocalQualityLevel(previousLevel.local);
5233
+ _this50.mediaProperties.setLocalQualityLevel(previousLevel.local);
5121
5234
 
5122
- _this49.mediaProperties.setRemoteQualityLevel(previousLevel.remote);
5235
+ _this50.mediaProperties.setRemoteQualityLevel(previousLevel.remote);
5123
5236
 
5124
5237
  _loggerProxy.default.logger.error("Meeting:index#setMeetingQuality --> ".concat(error.message));
5125
5238
 
5126
5239
  _metrics.default.sendOperationalMetric(_constants.METRICS_OPERATIONAL_MEASURES.SET_MEETING_QUALITY_FAILURE, {
5127
- correlation_id: _this49.correlationId,
5128
- locus_id: _this49.locusUrl.split('/').pop(),
5240
+ correlation_id: _this50.correlationId,
5241
+ locus_id: _this50.locusUrl.split('/').pop(),
5129
5242
  reason: error.message,
5130
5243
  stack: error.stack
5131
5244
  }, {
@@ -5149,7 +5262,7 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
5149
5262
  }, {
5150
5263
  key: "shareScreen",
5151
5264
  value: function shareScreen() {
5152
- var _this50 = this;
5265
+ var _this51 = this;
5153
5266
 
5154
5267
  var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
5155
5268
 
@@ -5161,9 +5274,9 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
5161
5274
  }, options);
5162
5275
 
5163
5276
  return _media.default.getDisplayMedia(shareConstraints, this.config).then(function (shareStream) {
5164
- return _this50.updateShare({
5277
+ return _this51.updateShare({
5165
5278
  sendShare: true,
5166
- receiveShare: _this50.mediaProperties.mediaDirection.receiveShare,
5279
+ receiveShare: _this51.mediaProperties.mediaDirection.receiveShare,
5167
5280
  stream: shareStream
5168
5281
  });
5169
5282
  }).catch(function (error) {
@@ -5175,8 +5288,8 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
5175
5288
  // TODO: The getDisplayMedia errors need to be moved inside `media.getDisplayMedia`
5176
5289
  var metricName = _constants.METRICS_OPERATIONAL_MEASURES.GET_DISPLAY_MEDIA_FAILURE;
5177
5290
  var data = {
5178
- correlation_id: _this50.correlationId,
5179
- locus_id: _this50.locusUrl.split('/').pop(),
5291
+ correlation_id: _this51.correlationId,
5292
+ locus_id: _this51.locusUrl.split('/').pop(),
5180
5293
  reason: error.message,
5181
5294
  stack: error.stack
5182
5295
  };
@@ -5296,6 +5409,39 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
5296
5409
  var end = this["endSetupDelay".concat(typeMedia)];
5297
5410
  return start && end ? end - start : undefined;
5298
5411
  }
5412
+ /**
5413
+ * @param {string} typeMedia 'audio' or 'video'
5414
+ * @returns {undefined}
5415
+ */
5416
+
5417
+ }, {
5418
+ key: "setStartSendingMediaDelay",
5419
+ value: function setStartSendingMediaDelay(typeMedia) {
5420
+ this["startSendingMediaDelay".concat(typeMedia)] = performance.now();
5421
+ this["endSendingMediaDelay".concat(typeMedia)] = undefined;
5422
+ }
5423
+ /**
5424
+ * @param {string} typeMedia 'audio' or 'video'
5425
+ * @returns {undefined}
5426
+ */
5427
+
5428
+ }, {
5429
+ key: "setEndSendingMediaDelay",
5430
+ value: function setEndSendingMediaDelay(typeMedia) {
5431
+ this["endSendingMediaDelay".concat(typeMedia)] = performance.now();
5432
+ }
5433
+ /**
5434
+ * @param {string} typeMedia 'audio' or 'video'
5435
+ * @returns {string} duration between join response and first media tx
5436
+ */
5437
+
5438
+ }, {
5439
+ key: "getSendingMediaDelayDuration",
5440
+ value: function getSendingMediaDelayDuration(typeMedia) {
5441
+ var start = this["startSendingMediaDelay".concat(typeMedia)];
5442
+ var end = this["endSendingMediaDelay".concat(typeMedia)];
5443
+ return start && end ? end - start : undefined;
5444
+ }
5299
5445
  }]);
5300
5446
  return Meeting;
5301
5447
  }(_webexCore.StatelessWebexPlugin);