@webex/plugin-meetings 2.34.0 → 2.35.0

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.
@@ -1 +1 @@
1
- {"version":3,"names":["MediaProperties","options","MEETINGS","peerConnection","MediaUtil","createPeerConnection","mediaDirection","videoTrack","audioTrack","shareTrack","remoteShare","remoteAudioTrack","remoteVideoTrack","localQualityLevel","QUALITY_LEVELS","remoteQualityLevel","HIGH","mediaSettings","videoDeviceId","type","values","deviceId","turnServerInfo","LoggerProxy","logger","warn","unsetRemoteMedia","unsetLocalVideoTrack","unsetLocalShareTrack","unsetRemoteStream","unsetRemoteShare"],"sources":["properties.js"],"sourcesContent":["import {\n MEETINGS,\n QUALITY_LEVELS\n} from '../constants';\nimport LoggerProxy from '../common/logs/logger-proxy';\n\nimport MediaUtil from './util';\n\n/**\n * @class MediaProperties\n */\nexport default class MediaProperties {\n namespace = MEETINGS;\n\n /**\n * @param {Object} [options] -- to auto construct\n * @returns {MediaProperties}\n */\n constructor(options = {}) {\n this.peerConnection = MediaUtil.createPeerConnection();\n this.mediaDirection = options.mediaDirection;\n this.videoTrack = options.videoTrack;\n this.audioTrack = options.audioTrack;\n this.shareTrack = options.shareTrack;\n this.remoteShare = options.remoteShare;\n this.remoteAudioTrack = options.remoteAudioTrack;\n this.remoteVideoTrack = options.remoteVideoTrack;\n this.localQualityLevel = options.localQualityLevel || QUALITY_LEVELS['720p'];\n this.remoteQualityLevel = options.remoteQualityLevel || QUALITY_LEVELS.HIGH;\n this.mediaSettings = {};\n this.videoDeviceId = null;\n }\n\n /**\n * Retrieves the preferred video input device\n * @returns {Object|null}\n */\n getVideoDeviceId() {\n return this.videoDeviceId || null;\n }\n\n setMediaDirection(mediaDirection) {\n this.mediaDirection = mediaDirection;\n }\n\n setMediaSettings(type, values) {\n this.mediaSettings[type] = values;\n }\n\n setMediaPeerConnection(peerConnection) {\n this.peerConnection = peerConnection;\n }\n\n setLocalVideoTrack(videoTrack) {\n this.videoTrack = videoTrack;\n }\n\n setLocalAudioTrack(audioTrack) {\n this.audioTrack = audioTrack;\n }\n\n setLocalQualityLevel(localQualityLevel) {\n this.localQualityLevel = localQualityLevel;\n }\n\n setLocalShareTrack(shareTrack) {\n this.shareTrack = shareTrack;\n }\n\n setRemoteQualityLevel(remoteQualityLevel) {\n this.remoteQualityLevel = remoteQualityLevel;\n }\n\n setRemoteShare(remoteShare) {\n this.remoteShare = remoteShare;\n }\n\n /**\n * Sets the remote audio track\n * @param {MediaTrack} remoteAudioTrack MediaTrack to save\n * @returns {void}\n */\n setRemoteAudioTrack(remoteAudioTrack) {\n this.remoteAudioTrack = remoteAudioTrack;\n }\n\n /**\n * Sets the remote video track\n * @param {MediaTrack} remoteVideoTrack MediaTrack to save\n * @returns {void}\n */\n setRemoteVideoTrack(remoteVideoTrack) {\n this.remoteVideoTrack = remoteVideoTrack;\n }\n\n /**\n * Stores the preferred video input device\n * @param {string} deviceId Preferred video input device\n * @returns {void}\n */\n setVideoDeviceId(deviceId) {\n this.videoDeviceId = deviceId;\n }\n\n unsetPeerConnection() {\n this.peerConnection = null;\n }\n\n reInitiatePeerconnection(turnServerInfo) {\n this.peerConnection = MediaUtil.createPeerConnection(turnServerInfo);\n }\n\n unsetLocalVideoTrack() {\n this.videoTrack = null;\n }\n\n unsetLocalShareTrack() {\n this.shareTrack = null;\n }\n\n unsetLocalAudioTrack() {\n this.audioTrack = null;\n }\n\n /**\n * Removes remote stream from class instance\n * @deprecated after v1.89.3\n * @returns {void}\n */\n unsetRemoteStream() {\n LoggerProxy.logger.warn('Media:properties#unsetRemoteStream --> [DEPRECATION WARNING]: unsetRemoteStream has been deprecated after v1.89.3 (use unsetRemoteTracks instead)');\n // unsets audio and video only\n this.unsetRemoteMedia();\n }\n\n /**\n * Removes both remote audio and video from class instance\n * @returns {void}\n */\n unsetRemoteMedia() {\n this.remoteAudioTrack = null;\n this.remoteVideoTrack = null;\n }\n\n unsetRemoteShare() {\n this.remoteShare = null;\n }\n\n unsetLocalVideoTracks() {\n this.unsetLocalVideoTrack();\n this.unsetLocalShareTrack();\n }\n\n /**\n * Removes remote stream and remote share from class instance\n * @deprecated after v1.89.3\n * @returns {void}\n */\n unsetRemoteStreams() {\n LoggerProxy.logger.warn('Media:properties#unsetRemoteStreams --> [DEPRECATION WARNING]: unsetRemoteStreams has been deprecated after v1.89.3 (use unsetRemoteTracks instead)');\n this.unsetRemoteStream();\n this.unsetRemoteShare();\n }\n\n /**\n * Unsets all remote tracks\n * @returns {void}\n */\n unsetRemoteTracks() {\n this.unsetRemoteMedia();\n this.unsetRemoteShare();\n }\n\n unsetShareStreams() {\n this.unsetLocalShareTrack();\n this.unsetRemoteShare();\n }\n\n /**\n * Removes both local and remote video stream from class instance\n * @deprecated after v1.89.3\n * @returns {void}\n */\n unsetMediaStreams() {\n LoggerProxy.logger.warn('Media:properties#unsetMediaStreams --> [DEPRECATION WARNING]: unsetMediaStreams has been deprecated after v1.89.3 (use unsetMediaTracks instead)');\n this.unsetLocalVideoTrack();\n this.unsetRemoteStream();\n }\n\n /**\n * Removes both local and remote video stream from class instance\n * @returns {void}\n */\n unsetMediaTracks() {\n this.unsetLocalVideoTrack();\n this.unsetRemoteMedia();\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;;AAIA;;AAEA;;AAEA;AACA;AACA;IACqBA,e;EAGnB;AACF;AACA;AACA;EACE,2BAA0B;IAAA,IAAdC,OAAc,uEAAJ,EAAI;IAAA;IAAA,iDANdC,mBAMc;IACxB,KAAKC,cAAL,GAAsBC,aAAA,CAAUC,oBAAV,EAAtB;IACA,KAAKC,cAAL,GAAsBL,OAAO,CAACK,cAA9B;IACA,KAAKC,UAAL,GAAkBN,OAAO,CAACM,UAA1B;IACA,KAAKC,UAAL,GAAkBP,OAAO,CAACO,UAA1B;IACA,KAAKC,UAAL,GAAkBR,OAAO,CAACQ,UAA1B;IACA,KAAKC,WAAL,GAAmBT,OAAO,CAACS,WAA3B;IAC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ACA,KAAKE,oBAAL;MACA,KAAKE,iBAAL;IACD;IAED;AACF;AACA;AACA;;;;WACE,4BAAmB;MACjB,KAAKF,oBAAL;MACA,KAAKD,gBAAL;IACD"}
1
+ {"version":3,"names":["MediaProperties","options","MEETINGS","peerConnection","MediaUtil","createPeerConnection","mediaDirection","videoTrack","audioTrack","shareTrack","remoteShare","remoteAudioTrack","remoteVideoTrack","localQualityLevel","QUALITY_LEVELS","remoteQualityLevel","HIGH","mediaSettings","videoDeviceId","type","values","deviceId","turnServerInfo","LoggerProxy","logger","warn","unsetRemoteMedia","unsetLocalVideoTrack","unsetLocalShareTrack","unsetRemoteStream","unsetRemoteShare","isIceConnected","iceConnectionState","ICE_STATE","CONNECTED","COMPLETED","resolve","reject","timer","iceListener","log","connectionState","clearTimeout","removeEventListener","setTimeout","PC_BAIL_TIMEOUT","addEventListener","waitForIceConnectedState","allStatsReports","getStats","statsResult","forEach","report","push","successfulCandidatePairs","filter","state","toLowerCase","foundConnectionType","some","pair","localCandidate","find","id","localCandidateId","undefined","connectionType","relayProtocol","toUpperCase","protocol"],"sources":["properties.js"],"sourcesContent":["import {\n ICE_STATE,\n MEETINGS,\n PC_BAIL_TIMEOUT,\n QUALITY_LEVELS\n} from '../constants';\nimport LoggerProxy from '../common/logs/logger-proxy';\n\nimport MediaUtil from './util';\n\n/**\n * @class MediaProperties\n */\nexport default class MediaProperties {\n namespace = MEETINGS;\n\n /**\n * @param {Object} [options] -- to auto construct\n * @returns {MediaProperties}\n */\n constructor(options = {}) {\n this.peerConnection = MediaUtil.createPeerConnection();\n this.mediaDirection = options.mediaDirection;\n this.videoTrack = options.videoTrack;\n this.audioTrack = options.audioTrack;\n this.shareTrack = options.shareTrack;\n this.remoteShare = options.remoteShare;\n this.remoteAudioTrack = options.remoteAudioTrack;\n this.remoteVideoTrack = options.remoteVideoTrack;\n this.localQualityLevel = options.localQualityLevel || QUALITY_LEVELS['720p'];\n this.remoteQualityLevel = options.remoteQualityLevel || QUALITY_LEVELS.HIGH;\n this.mediaSettings = {};\n this.videoDeviceId = null;\n }\n\n /**\n * Retrieves the preferred video input device\n * @returns {Object|null}\n */\n getVideoDeviceId() {\n return this.videoDeviceId || null;\n }\n\n setMediaDirection(mediaDirection) {\n this.mediaDirection = mediaDirection;\n }\n\n setMediaSettings(type, values) {\n this.mediaSettings[type] = values;\n }\n\n setMediaPeerConnection(peerConnection) {\n this.peerConnection = peerConnection;\n }\n\n setLocalVideoTrack(videoTrack) {\n this.videoTrack = videoTrack;\n }\n\n setLocalAudioTrack(audioTrack) {\n this.audioTrack = audioTrack;\n }\n\n setLocalQualityLevel(localQualityLevel) {\n this.localQualityLevel = localQualityLevel;\n }\n\n setLocalShareTrack(shareTrack) {\n this.shareTrack = shareTrack;\n }\n\n setRemoteQualityLevel(remoteQualityLevel) {\n this.remoteQualityLevel = remoteQualityLevel;\n }\n\n setRemoteShare(remoteShare) {\n this.remoteShare = remoteShare;\n }\n\n /**\n * Sets the remote audio track\n * @param {MediaTrack} remoteAudioTrack MediaTrack to save\n * @returns {void}\n */\n setRemoteAudioTrack(remoteAudioTrack) {\n this.remoteAudioTrack = remoteAudioTrack;\n }\n\n /**\n * Sets the remote video track\n * @param {MediaTrack} remoteVideoTrack MediaTrack to save\n * @returns {void}\n */\n setRemoteVideoTrack(remoteVideoTrack) {\n this.remoteVideoTrack = remoteVideoTrack;\n }\n\n /**\n * Stores the preferred video input device\n * @param {string} deviceId Preferred video input device\n * @returns {void}\n */\n setVideoDeviceId(deviceId) {\n this.videoDeviceId = deviceId;\n }\n\n unsetPeerConnection() {\n this.peerConnection = null;\n }\n\n reInitiatePeerconnection(turnServerInfo) {\n this.peerConnection = MediaUtil.createPeerConnection(turnServerInfo);\n }\n\n unsetLocalVideoTrack() {\n this.videoTrack = null;\n }\n\n unsetLocalShareTrack() {\n this.shareTrack = null;\n }\n\n unsetLocalAudioTrack() {\n this.audioTrack = null;\n }\n\n /**\n * Removes remote stream from class instance\n * @deprecated after v1.89.3\n * @returns {void}\n */\n unsetRemoteStream() {\n LoggerProxy.logger.warn('Media:properties#unsetRemoteStream --> [DEPRECATION WARNING]: unsetRemoteStream has been deprecated after v1.89.3 (use unsetRemoteTracks instead)');\n // unsets audio and video only\n this.unsetRemoteMedia();\n }\n\n /**\n * Removes both remote audio and video from class instance\n * @returns {void}\n */\n unsetRemoteMedia() {\n this.remoteAudioTrack = null;\n this.remoteVideoTrack = null;\n }\n\n unsetRemoteShare() {\n this.remoteShare = null;\n }\n\n unsetLocalVideoTracks() {\n this.unsetLocalVideoTrack();\n this.unsetLocalShareTrack();\n }\n\n /**\n * Removes remote stream and remote share from class instance\n * @deprecated after v1.89.3\n * @returns {void}\n */\n unsetRemoteStreams() {\n LoggerProxy.logger.warn('Media:properties#unsetRemoteStreams --> [DEPRECATION WARNING]: unsetRemoteStreams has been deprecated after v1.89.3 (use unsetRemoteTracks instead)');\n this.unsetRemoteStream();\n this.unsetRemoteShare();\n }\n\n /**\n * Unsets all remote tracks\n * @returns {void}\n */\n unsetRemoteTracks() {\n this.unsetRemoteMedia();\n this.unsetRemoteShare();\n }\n\n unsetShareStreams() {\n this.unsetLocalShareTrack();\n this.unsetRemoteShare();\n }\n\n /**\n * Removes both local and remote video stream from class instance\n * @deprecated after v1.89.3\n * @returns {void}\n */\n unsetMediaStreams() {\n LoggerProxy.logger.warn('Media:properties#unsetMediaStreams --> [DEPRECATION WARNING]: unsetMediaStreams has been deprecated after v1.89.3 (use unsetMediaTracks instead)');\n this.unsetLocalVideoTrack();\n this.unsetRemoteStream();\n }\n\n /**\n * Removes both local and remote video stream from class instance\n * @returns {void}\n */\n unsetMediaTracks() {\n this.unsetLocalVideoTrack();\n this.unsetRemoteMedia();\n }\n\n /**\n * Waits until ice connection is established\n *\n * @returns {Promise<void>}\n */\n waitForIceConnectedState() {\n const isIceConnected = () => (\n this.peerConnection.iceConnectionState === ICE_STATE.CONNECTED ||\n this.peerConnection.iceConnectionState === ICE_STATE.COMPLETED\n );\n\n if (isIceConnected()) {\n return Promise.resolve();\n }\n\n return new Promise((resolve, reject) => {\n let timer;\n\n const iceListener = () => {\n LoggerProxy.logger.log(`Media:properties#waitForIceConnectedState --> ice state: ${this.peerConnection.iceConnectionState}, conn state: ${this.peerConnection.connectionState}`);\n\n if (isIceConnected()) {\n clearTimeout(timer);\n this.peerConnection.removeEventListener('iceconnectionstatechange', iceListener);\n resolve();\n }\n };\n\n timer = setTimeout(() => {\n this.peerConnection.removeEventListener('iceconnectionstatechange', iceListener);\n reject();\n }, PC_BAIL_TIMEOUT);\n\n this.peerConnection.addEventListener('iceconnectionstatechange', iceListener);\n });\n }\n\n /**\n * Returns the type of a connection that has been established\n *\n * @returns {Promise<'UDP' | 'TCP' | 'TURN-TLS' | 'TURN-TCP' | 'TURN-UDP' | 'unknown'>}\n */\n async getCurrentConnectionType() {\n // we can only get the connection type after ICE connection has been established\n await this.waitForIceConnectedState();\n\n const allStatsReports = [];\n\n try {\n // eslint-disable-next-line no-await-in-loop\n const statsResult = await this.peerConnection.getStats();\n\n statsResult.forEach((report) => allStatsReports.push(report));\n }\n catch (error) {\n LoggerProxy.logger.warn(`Media:properties#getCurrentConnectionType --> getStats() failed: ${error}`);\n }\n\n const successfulCandidatePairs = allStatsReports.filter(\n (report) => report.type === 'candidate-pair' && report.state?.toLowerCase() === 'succeeded'\n );\n\n let foundConnectionType = 'unknown';\n\n // all of the successful pairs should have the same connection type, so just return the type for the first one\n successfulCandidatePairs.some((pair) => {\n const localCandidate = allStatsReports.find((report) => report.type === 'local-candidate' && report.id === pair.localCandidateId);\n\n if (localCandidate === undefined) {\n LoggerProxy.logger.warn(`Media:properties#getCurrentConnectionType --> failed to find local candidate \"${pair.localCandidateId}\" in getStats() results`);\n\n return false;\n }\n\n let connectionType;\n\n if (localCandidate.relayProtocol) {\n connectionType = `TURN-${localCandidate.relayProtocol.toUpperCase()}`;\n }\n else {\n connectionType = localCandidate.protocol?.toUpperCase(); // it will be UDP or TCP\n }\n\n if (connectionType) {\n foundConnectionType = connectionType;\n\n return true;\n }\n\n return false;\n });\n\n return foundConnectionType;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AAMA;;AAEA;;AAEA;AACA;AACA;IACqBA,e;EAGnB;AACF;AACA;AACA;EACE,2BAA0B;IAAA,IAAdC,OAAc,uEAAJ,EAAI;IAAA;IAAA,iDANdC,mBAMc;IACxB,KAAKC,cAAL,GAAsBC,aAAA,CAAUC,oBAAV,EAAtB;IACA,KAAKC,cAAL,GAAsBL,OAAO,CAACK,cAA9B;IACA,KAAKC,UAAL,GAAkBN,OAAO,CAACM,UAA1B;IACA,KAAKC,UAAL,GAAkBP,OAAO,CAACO,UAA1B;IACA,KAAKC,UAAL,GAAkBR,OAAO,CAACQ,UAA1B;IACA,KAAKC,WAAL,GAAmBT,OAAO,CAACS,WAA3B;IACA,KAAKC,gBAAL,GAAwBV,OAAO,CAACU,gBAAhC;IACA,KAAKC,gBAAL,GAAwBX,OAAO,CAACW,gBAAhC;IACA,KAAKC,iBAAL,GAAyBZ,OAAO,CAACY,iBAAR,IAA6BC,yBAAA,CAAe,MAAf,CAAtD;IACA,KAAKC,kBAAL,GAA0Bd,OAAO,CAACc,kBAAR,IAA8BD,yBAAA,CAAeE,IAAvE;IACA,KAAKC,aAAL,GAAqB,EAArB;IACA,KAAKC,aAAL,GAAqB,IAArB;EACD;EAED;AACF;AACA;AACA;;;;;WACE,4BAAmB;MACjB,OAAO,KAAKA,aAAL,IAAsB,IAA7B;IACD;;;WAED,2BAAkBZ,cAAlB,EAAkC;MAChC,KAAKA,cAAL,GAAsBA,cAAtB;IACD;;;WAED,0BAAiBa,IAAjB,EAAuBC,MAAvB,EAA+B;MAC7B,KAAKH,aAAL,CAAmBE,IAAnB,IAA2BC,MAA3B;IACD;;;WAED,gCAAuBjB,cAAvB,EAAuC;MACrC,KAAKA,cAAL,GAAsBA,cAAtB;IACD;;;WAED,4BAAmBI,UAAnB,EAA+B;MAC7B,KAAKA,UAAL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,CAAqB,UAACV,MAAD;oBAAA,OAAYA,MAAM,CAACjC,IAAP,KAAgB,iBAAhB,IAAqCiC,MAAM,CAACW,EAAP,KAAcH,IAAI,CAACI,gBAApE;kBAAA,CAArB,CAAvB;;kBAEA,IAAIH,cAAc,KAAKI,SAAvB,EAAkC;oBAChC1C,oBAAA,CAAYC,MAAZ,CAAmBC,IAAnB,0FAAyGmC,IAAI,CAACI,gBAA9G;;oBAEA,OAAO,KAAP;kBACD;;kBAED,IAAIE,cAAJ;;kBAEA,IAAIL,cAAc,CAACM,aAAnB,EAAkC;oBAChCD,cAAc,kBAAWL,cAAc,CAACM,aAAf,CAA6BC,WAA7B,EAAX,CAAd;kBACD,CAFD,MAGK;oBAAA;;oBACHF,cAAc,4BAAGL,cAAc,CAACQ,QAAlB,0DAAG,sBAAyBD,WAAzB,EAAjB,CADG,CACsD;kBAC1D;;kBAED,IAAIF,cAAJ,EAAoB;oBAClBR,mBAAmB,GAAGQ,cAAtB;oBAEA,OAAO,IAAP;kBACD;;kBAED,OAAO,KAAP;gBACD,CAzBD;gBAvBF,iCAkDSR,mBAlDT;;cAAA;cAAA;gBAAA;YAAA;UAAA;QAAA;MAAA,C"}
@@ -24,12 +24,12 @@ exports.default = exports.MEDIA_UPDATE_TYPE = void 0;
24
24
 
25
25
  var _regenerator = _interopRequireDefault(require("@babel/runtime-corejs2/regenerator"));
26
26
 
27
+ var _keys = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/object/keys"));
28
+
27
29
  var _promise = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/promise"));
28
30
 
29
31
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/object/define-property"));
30
32
 
31
- var _keys = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/object/keys"));
32
-
33
33
  var _stringify = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/json/stringify"));
34
34
 
35
35
  var _assign = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/object/assign"));
@@ -54,6 +54,8 @@ var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime-corejs2/he
54
54
 
55
55
  var _defineProperty3 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/defineProperty"));
56
56
 
57
+ var _isString2 = _interopRequireDefault(require("lodash/isString"));
58
+
57
59
  var _pick2 = _interopRequireDefault(require("lodash/pick"));
58
60
 
59
61
  var _isEqual2 = _interopRequireDefault(require("lodash/isEqual"));
@@ -499,6 +501,18 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
499
501
  _loggerProxy.default.logger.warn('Meeting:index#getMediaStreams --> Please use `meeting.shareScreen()` to manually start the screen share after successfully joining the meeting');
500
502
  }
501
503
 
504
+ if (audioVideo && (0, _isString2.default)(audioVideo)) {
505
+ if ((0, _keys.default)(_constants.VIDEO_RESOLUTIONS).includes(audioVideo)) {
506
+ _this.mediaProperties.setLocalQualityLevel(audioVideo);
507
+
508
+ audioVideo = {
509
+ video: _constants.VIDEO_RESOLUTIONS[audioVideo].video
510
+ };
511
+ } else {
512
+ throw new _parameter.default("".concat(audioVideo, " not supported. Either pass level from pre-defined resolutions or pass complete audioVideo object"));
513
+ }
514
+ }
515
+
502
516
  if (!audioVideo.video) {
503
517
  audioVideo = _objectSpread(_objectSpread({}, audioVideo), {}, {
504
518
  video: _objectSpread(_objectSpread({}, audioVideo.video), _constants.VIDEO_RESOLUTIONS[_this.mediaProperties.localQualityLevel].video)
@@ -3195,7 +3209,7 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
3195
3209
  var localQualityLevel = this.mediaProperties.localQualityLevel;
3196
3210
 
3197
3211
  if (Number(localQualityLevel.slice(0, -1)) > height) {
3198
- _loggerProxy.default.logger.error("Meeting:index#setLocalVideoTrack --> Local video quality of ".concat(localQualityLevel, " not supported,\n downscaling to highest possible resolution of ").concat(height, "p"));
3212
+ _loggerProxy.default.logger.warn("Meeting:index#setLocalVideoTrack --> Local video quality of ".concat(localQualityLevel, " not supported,\n downscaling to highest possible resolution of ").concat(height, "p"));
3199
3213
 
3200
3214
  this.mediaProperties.setLocalQualityLevel("".concat(height, "p"));
3201
3215
  }
@@ -4605,125 +4619,105 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
4605
4619
  enableRtx: _this38.config.enableRtx,
4606
4620
  enableExtmap: _this38.config.enableExtmap,
4607
4621
  setStartLocalSDPGenRemoteSDPRecvDelay: _this38.setStartLocalSDPGenRemoteSDPRecvDelay.bind(_this38)
4608
- }).then(function (peerConnection) {
4609
- return _this38.getDevices().then(function (devices) {
4610
- _util.default.handleDeviceLogging(devices);
4611
-
4612
- return peerConnection;
4613
- });
4614
- }).then(function (peerConnection) {
4615
- _this38.handleMediaLogging(_this38.mediaProperties);
4616
-
4617
- _loggerProxy.default.logger.info("".concat(LOG_HEADER, " PeerConnection Received from attachMedia "));
4618
-
4619
- _this38.setRemoteStream(peerConnection);
4620
-
4621
- if (_this38.config.stats.enableStatsAnalyzer) {
4622
- // TODO: ** Dont re create StatsAnalyzer on reconnect or rejoin
4623
- _this38.networkQualityMonitor = new _networkQualityMonitor.default(_this38.config.stats);
4624
- _this38.statsAnalyzer = new _statsAnalyzer.StatsAnalyzer(_this38.config.stats, _this38.networkQualityMonitor);
4625
-
4626
- _this38.setupStatsAnalyzerEventHandlers();
4622
+ });
4623
+ }).then(function (peerConnection) {
4624
+ return _this38.getDevices().then(function (devices) {
4625
+ _util.default.handleDeviceLogging(devices);
4627
4626
 
4628
- _this38.networkQualityMonitor.on(_constants.EVENT_TRIGGERS.NETWORK_QUALITY, _this38.sendNetworkQualityEvent.bind(_this38));
4629
- }
4630
- }).catch(function (error) {
4631
- _loggerProxy.default.logger.error("".concat(LOG_HEADER, " Error adding media , setting up peerconnection, "), error);
4627
+ return peerConnection;
4628
+ });
4629
+ }).then(function (peerConnection) {
4630
+ _this38.handleMediaLogging(_this38.mediaProperties);
4632
4631
 
4633
- _metrics.default.sendBehavioralMetric(_constants2.default.ADD_MEDIA_FAILURE, {
4634
- correlation_id: _this38.correlationId,
4635
- locus_id: _this38.locusUrl.split('/').pop(),
4636
- reason: error.message,
4637
- stack: error.stack,
4638
- turnDiscoverySkippedReason: turnDiscoverySkippedReason,
4639
- turnServerUsed: turnServerUsed
4640
- });
4632
+ _loggerProxy.default.logger.info("".concat(LOG_HEADER, " PeerConnection Received from attachMedia "));
4641
4633
 
4642
- throw error;
4643
- }).then(function () {
4644
- return new _promise.default(function (resolve, reject) {
4645
- var timerCount = 0; // eslint-disable-next-line func-names
4646
- // eslint-disable-next-line prefer-arrow-callback
4634
+ _this38.setRemoteStream(peerConnection);
4647
4635
 
4648
- if (_this38.type === _constants._CALL_) {
4649
- resolve();
4650
- }
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);
4651
4640
 
4652
- var joiningTimer = setInterval(function () {
4653
- timerCount += 1;
4641
+ _this38.setupStatsAnalyzerEventHandlers();
4654
4642
 
4655
- if (_this38.meetingState === _constants.FULL_STATE.ACTIVE) {
4656
- clearInterval(joiningTimer);
4657
- resolve();
4658
- }
4659
-
4660
- if (timerCount === 4) {
4661
- clearInterval(joiningTimer);
4662
- reject(new Error('Meeting is still not active '));
4663
- }
4664
- }, 1000);
4665
- });
4666
- }).then(function () {
4667
- return logRequest(_this38.roap.sendRoapMediaRequest({
4668
- sdp: _this38.mediaProperties.peerConnection.sdp,
4669
- roapSeq: _this38.roapSeq,
4670
- meeting: _this38 // or can pass meeting ID
4671
-
4672
- }), {
4673
- header: "".concat(LOG_HEADER, " Send Roap Media Request."),
4674
- success: "".concat(LOG_HEADER, " Successfully send roap media request"),
4675
- failure: "".concat(LOG_HEADER, " Error joining the call on send roap media request, ")
4676
- });
4677
- }).then(function () {
4678
- var peerConnection = _this38.mediaProperties.peerConnection;
4679
- return new _promise.default(function (resolve, reject) {
4680
- if (peerConnection.connectionState === _constants.CONNECTION_STATE.CONNECTED) {
4681
- _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);
4682
4647
 
4683
- resolve(peerConnection);
4684
- return;
4685
- } // 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
+ });
4686
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
4687
4662
 
4688
- var stabilityTimeout = setTimeout(function () {
4689
- if (peerConnection.connectionState !== _constants.CONNECTION_STATE.CONNECTED) {
4690
- // TODO: Fix this after the error code pr goes in
4691
- reject((0, _webexErrors.createMeetingsError)(30202, 'Meeting connection failed'));
4692
- } else {
4693
- _loggerProxy.default.logger.info("".concat(LOG_HEADER, " PeerConnection CONNECTED"));
4663
+ if (_this38.type === _constants._CALL_) {
4664
+ resolve();
4665
+ }
4694
4666
 
4695
- resolve(peerConnection);
4696
- }
4697
- }, _constants.PC_BAIL_TIMEOUT);
4667
+ var joiningTimer = setInterval(function () {
4668
+ timerCount += 1;
4698
4669
 
4699
- _this38.once(_constants.EVENT_TRIGGERS.MEDIA_READY, function () {
4700
- _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
+ }
4701
4674
 
4702
- clearTimeout(stabilityTimeout);
4703
- resolve(peerConnection);
4704
- });
4705
- });
4706
- }).then(function () {
4707
- if (mediaSettings && mediaSettings.sendShare && localShare) {
4708
- if (_this38.state === _constants.MEETING_STATE.STATES.JOINED) {
4709
- return _this38.share();
4710
- } // 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"));
4711
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
4712
4703
 
4713
- _this38.floorGrantPending = true;
4714
- }
4715
4704
 
4716
- _metrics.default.sendBehavioralMetric(_constants2.default.ADD_MEDIA_SUCCESS, {
4717
- correlation_id: _this38.correlationId,
4718
- locus_id: _this38.locusUrl.split('/').pop()
4719
- });
4705
+ _this38.floorGrantPending = true;
4706
+ }
4720
4707
 
4721
- 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
4722
4716
  });
4723
4717
  }).catch(function (error) {
4724
4718
  // Clean up stats analyzer, peer connection, and turn off listeners
4725
4719
  var stopStatsAnalyzer = _this38.statsAnalyzer ? _this38.statsAnalyzer.stopAnalyzer() : _promise.default.resolve();
4726
- stopStatsAnalyzer.then(function () {
4720
+ return stopStatsAnalyzer.then(function () {
4727
4721
  _this38.statsAnalyzer = null;
4728
4722
 
4729
4723
  if (_this38.mediaProperties.peerConnection) {