@webex/plugin-meetings 3.0.0-beta.0 → 3.0.0-beta.1

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.
@@ -4619,125 +4619,105 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
4619
4619
  enableRtx: _this38.config.enableRtx,
4620
4620
  enableExtmap: _this38.config.enableExtmap,
4621
4621
  setStartLocalSDPGenRemoteSDPRecvDelay: _this38.setStartLocalSDPGenRemoteSDPRecvDelay.bind(_this38)
4622
- }).then(function (peerConnection) {
4623
- return _this38.getDevices().then(function (devices) {
4624
- _util.default.handleDeviceLogging(devices);
4625
-
4626
- return peerConnection;
4627
- });
4628
- }).then(function (peerConnection) {
4629
- _this38.handleMediaLogging(_this38.mediaProperties);
4630
-
4631
- _loggerProxy.default.logger.info("".concat(LOG_HEADER, " PeerConnection Received from attachMedia "));
4632
-
4633
- _this38.setRemoteStream(peerConnection);
4634
-
4635
- if (_this38.config.stats.enableStatsAnalyzer) {
4636
- // TODO: ** Dont re create StatsAnalyzer on reconnect or rejoin
4637
- _this38.networkQualityMonitor = new _networkQualityMonitor.default(_this38.config.stats);
4638
- _this38.statsAnalyzer = new _statsAnalyzer.StatsAnalyzer(_this38.config.stats, _this38.networkQualityMonitor);
4639
-
4640
- _this38.setupStatsAnalyzerEventHandlers();
4641
-
4642
- _this38.networkQualityMonitor.on(_constants.EVENT_TRIGGERS.NETWORK_QUALITY, _this38.sendNetworkQualityEvent.bind(_this38));
4643
- }
4644
- }).catch(function (error) {
4645
- _loggerProxy.default.logger.error("".concat(LOG_HEADER, " Error adding media , setting up peerconnection, "), error);
4646
-
4647
- _metrics.default.sendBehavioralMetric(_constants2.default.ADD_MEDIA_FAILURE, {
4648
- correlation_id: _this38.correlationId,
4649
- locus_id: _this38.locusUrl.split('/').pop(),
4650
- reason: error.message,
4651
- stack: error.stack,
4652
- turnDiscoverySkippedReason: turnDiscoverySkippedReason,
4653
- turnServerUsed: turnServerUsed
4654
- });
4622
+ });
4623
+ }).then(function (peerConnection) {
4624
+ return _this38.getDevices().then(function (devices) {
4625
+ _util.default.handleDeviceLogging(devices);
4655
4626
 
4656
- throw error;
4657
- }).then(function () {
4658
- return new _promise.default(function (resolve, reject) {
4659
- var timerCount = 0; // eslint-disable-next-line func-names
4660
- // eslint-disable-next-line prefer-arrow-callback
4627
+ return peerConnection;
4628
+ });
4629
+ }).then(function (peerConnection) {
4630
+ _this38.handleMediaLogging(_this38.mediaProperties);
4661
4631
 
4662
- if (_this38.type === _constants._CALL_) {
4663
- resolve();
4664
- }
4632
+ _loggerProxy.default.logger.info("".concat(LOG_HEADER, " PeerConnection Received from attachMedia "));
4665
4633
 
4666
- var joiningTimer = setInterval(function () {
4667
- timerCount += 1;
4634
+ _this38.setRemoteStream(peerConnection);
4668
4635
 
4669
- if (_this38.meetingState === _constants.FULL_STATE.ACTIVE) {
4670
- clearInterval(joiningTimer);
4671
- resolve();
4672
- }
4636
+ if (_this38.config.stats.enableStatsAnalyzer) {
4637
+ // TODO: ** Dont re create StatsAnalyzer on reconnect or rejoin
4638
+ _this38.networkQualityMonitor = new _networkQualityMonitor.default(_this38.config.stats);
4639
+ _this38.statsAnalyzer = new _statsAnalyzer.StatsAnalyzer(_this38.config.stats, _this38.networkQualityMonitor);
4673
4640
 
4674
- if (timerCount === 4) {
4675
- clearInterval(joiningTimer);
4676
- reject(new Error('Meeting is still not active '));
4677
- }
4678
- }, 1000);
4679
- });
4680
- }).then(function () {
4681
- return logRequest(_this38.roap.sendRoapMediaRequest({
4682
- sdp: _this38.mediaProperties.peerConnection.sdp,
4683
- roapSeq: _this38.roapSeq,
4684
- meeting: _this38 // or can pass meeting ID
4641
+ _this38.setupStatsAnalyzerEventHandlers();
4685
4642
 
4686
- }), {
4687
- header: "".concat(LOG_HEADER, " Send Roap Media Request."),
4688
- success: "".concat(LOG_HEADER, " Successfully send roap media request"),
4689
- failure: "".concat(LOG_HEADER, " Error joining the call on send roap media request, ")
4690
- });
4691
- }).then(function () {
4692
- var peerConnection = _this38.mediaProperties.peerConnection;
4693
- return new _promise.default(function (resolve, reject) {
4694
- if (peerConnection.connectionState === _constants.CONNECTION_STATE.CONNECTED) {
4695
- _loggerProxy.default.logger.info("".concat(LOG_HEADER, " PeerConnection CONNECTED"));
4643
+ _this38.networkQualityMonitor.on(_constants.EVENT_TRIGGERS.NETWORK_QUALITY, _this38.sendNetworkQualityEvent.bind(_this38));
4644
+ }
4645
+ }).catch(function (error) {
4646
+ _loggerProxy.default.logger.error("".concat(LOG_HEADER, " Error adding media , setting up peerconnection, "), error);
4696
4647
 
4697
- resolve(peerConnection);
4698
- return;
4699
- } // Check if Peer Connection is STABLE (connected)
4648
+ _metrics.default.sendBehavioralMetric(_constants2.default.ADD_MEDIA_FAILURE, {
4649
+ correlation_id: _this38.correlationId,
4650
+ locus_id: _this38.locusUrl.split('/').pop(),
4651
+ reason: error.message,
4652
+ stack: error.stack,
4653
+ turnDiscoverySkippedReason: turnDiscoverySkippedReason,
4654
+ turnServerUsed: turnServerUsed
4655
+ });
4700
4656
 
4657
+ throw error;
4658
+ }).then(function () {
4659
+ return new _promise.default(function (resolve, reject) {
4660
+ var timerCount = 0; // eslint-disable-next-line func-names
4661
+ // eslint-disable-next-line prefer-arrow-callback
4701
4662
 
4702
- var stabilityTimeout = setTimeout(function () {
4703
- if (peerConnection.connectionState !== _constants.CONNECTION_STATE.CONNECTED) {
4704
- // TODO: Fix this after the error code pr goes in
4705
- reject((0, _webexErrors.createMeetingsError)(30202, 'Meeting connection failed'));
4706
- } else {
4707
- _loggerProxy.default.logger.info("".concat(LOG_HEADER, " PeerConnection CONNECTED"));
4663
+ if (_this38.type === _constants._CALL_) {
4664
+ resolve();
4665
+ }
4708
4666
 
4709
- resolve(peerConnection);
4710
- }
4711
- }, _constants.PC_BAIL_TIMEOUT);
4667
+ var joiningTimer = setInterval(function () {
4668
+ timerCount += 1;
4712
4669
 
4713
- _this38.once(_constants.EVENT_TRIGGERS.MEDIA_READY, function () {
4714
- _loggerProxy.default.logger.info("".concat(LOG_HEADER, " PeerConnection CONNECTED, clearing stability timer."));
4670
+ if (_this38.meetingState === _constants.FULL_STATE.ACTIVE) {
4671
+ clearInterval(joiningTimer);
4672
+ resolve();
4673
+ }
4715
4674
 
4716
- clearTimeout(stabilityTimeout);
4717
- resolve(peerConnection);
4718
- });
4719
- });
4720
- }).then(function () {
4721
- if (mediaSettings && mediaSettings.sendShare && localShare) {
4722
- if (_this38.state === _constants.MEETING_STATE.STATES.JOINED) {
4723
- return _this38.share();
4724
- } // When the self state changes to JOINED then request the floor
4675
+ if (timerCount === 4) {
4676
+ clearInterval(joiningTimer);
4677
+ reject(new Error('Meeting is still not active '));
4678
+ }
4679
+ }, 1000);
4680
+ });
4681
+ }).then(function () {
4682
+ return logRequest(_this38.roap.sendRoapMediaRequest({
4683
+ sdp: _this38.mediaProperties.peerConnection.sdp,
4684
+ roapSeq: _this38.roapSeq,
4685
+ meeting: _this38 // or can pass meeting ID
4686
+
4687
+ }), {
4688
+ header: "".concat(LOG_HEADER, " Send Roap Media Request."),
4689
+ success: "".concat(LOG_HEADER, " Successfully send roap media request"),
4690
+ failure: "".concat(LOG_HEADER, " Error joining the call on send roap media request, ")
4691
+ });
4692
+ }).then(function () {
4693
+ return _this38.mediaProperties.waitForIceConnectedState().catch(function () {
4694
+ throw (0, _webexErrors.createMeetingsError)(30202, 'Meeting connection failed');
4695
+ });
4696
+ }).then(function () {
4697
+ _loggerProxy.default.logger.info("".concat(LOG_HEADER, " PeerConnection CONNECTED"));
4725
4698
 
4699
+ if (mediaSettings && mediaSettings.sendShare && localShare) {
4700
+ if (_this38.state === _constants.MEETING_STATE.STATES.JOINED) {
4701
+ return _this38.share();
4702
+ } // When the self state changes to JOINED then request the floor
4726
4703
 
4727
- _this38.floorGrantPending = true;
4728
- }
4729
4704
 
4730
- _metrics.default.sendBehavioralMetric(_constants2.default.ADD_MEDIA_SUCCESS, {
4731
- correlation_id: _this38.correlationId,
4732
- locus_id: _this38.locusUrl.split('/').pop()
4733
- });
4705
+ _this38.floorGrantPending = true;
4706
+ }
4734
4707
 
4735
- return _promise.default.resolve();
4708
+ return {};
4709
+ }).then(function () {
4710
+ return _this38.mediaProperties.getCurrentConnectionType();
4711
+ }).then(function (connectionType) {
4712
+ _metrics.default.sendBehavioralMetric(_constants2.default.ADD_MEDIA_SUCCESS, {
4713
+ correlation_id: _this38.correlationId,
4714
+ locus_id: _this38.locusUrl.split('/').pop(),
4715
+ connectionType: connectionType
4736
4716
  });
4737
4717
  }).catch(function (error) {
4738
4718
  // Clean up stats analyzer, peer connection, and turn off listeners
4739
4719
  var stopStatsAnalyzer = _this38.statsAnalyzer ? _this38.statsAnalyzer.stopAnalyzer() : _promise.default.resolve();
4740
- stopStatsAnalyzer.then(function () {
4720
+ return stopStatsAnalyzer.then(function () {
4741
4721
  _this38.statsAnalyzer = null;
4742
4722
 
4743
4723
  if (_this38.mediaProperties.peerConnection) {