@webex/plugin-meetings 3.11.0 → 3.12.0-next.10

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.
Files changed (176) hide show
  1. package/dist/aiEnableRequest/index.js +184 -0
  2. package/dist/aiEnableRequest/index.js.map +1 -0
  3. package/dist/aiEnableRequest/utils.js +36 -0
  4. package/dist/aiEnableRequest/utils.js.map +1 -0
  5. package/dist/annotation/index.js +14 -5
  6. package/dist/annotation/index.js.map +1 -1
  7. package/dist/breakouts/breakout.js +1 -1
  8. package/dist/breakouts/index.js +1 -1
  9. package/dist/config.js +7 -2
  10. package/dist/config.js.map +1 -1
  11. package/dist/constants.js +28 -6
  12. package/dist/constants.js.map +1 -1
  13. package/dist/hashTree/constants.js +13 -2
  14. package/dist/hashTree/constants.js.map +1 -1
  15. package/dist/hashTree/hashTree.js +18 -0
  16. package/dist/hashTree/hashTree.js.map +1 -1
  17. package/dist/hashTree/hashTreeParser.js +869 -420
  18. package/dist/hashTree/hashTreeParser.js.map +1 -1
  19. package/dist/hashTree/types.js +4 -2
  20. package/dist/hashTree/types.js.map +1 -1
  21. package/dist/hashTree/utils.js +32 -0
  22. package/dist/hashTree/utils.js.map +1 -1
  23. package/dist/index.js +11 -2
  24. package/dist/index.js.map +1 -1
  25. package/dist/interceptors/constant.js +12 -0
  26. package/dist/interceptors/constant.js.map +1 -0
  27. package/dist/interceptors/dataChannelAuthToken.js +290 -0
  28. package/dist/interceptors/dataChannelAuthToken.js.map +1 -0
  29. package/dist/interceptors/index.js +7 -0
  30. package/dist/interceptors/index.js.map +1 -1
  31. package/dist/interceptors/utils.js +27 -0
  32. package/dist/interceptors/utils.js.map +1 -0
  33. package/dist/interpretation/index.js +2 -2
  34. package/dist/interpretation/index.js.map +1 -1
  35. package/dist/interpretation/siLanguage.js +1 -1
  36. package/dist/locus-info/controlsUtils.js +5 -3
  37. package/dist/locus-info/controlsUtils.js.map +1 -1
  38. package/dist/locus-info/index.js +522 -131
  39. package/dist/locus-info/index.js.map +1 -1
  40. package/dist/locus-info/selfUtils.js +1 -0
  41. package/dist/locus-info/selfUtils.js.map +1 -1
  42. package/dist/locus-info/types.js.map +1 -1
  43. package/dist/media/MediaConnectionAwaiter.js +57 -1
  44. package/dist/media/MediaConnectionAwaiter.js.map +1 -1
  45. package/dist/media/properties.js +4 -2
  46. package/dist/media/properties.js.map +1 -1
  47. package/dist/meeting/in-meeting-actions.js +7 -1
  48. package/dist/meeting/in-meeting-actions.js.map +1 -1
  49. package/dist/meeting/index.js +1304 -928
  50. package/dist/meeting/index.js.map +1 -1
  51. package/dist/meeting/request.js +50 -0
  52. package/dist/meeting/request.js.map +1 -1
  53. package/dist/meeting/request.type.js.map +1 -1
  54. package/dist/meeting/util.js +133 -3
  55. package/dist/meeting/util.js.map +1 -1
  56. package/dist/meetings/index.js +117 -48
  57. package/dist/meetings/index.js.map +1 -1
  58. package/dist/member/index.js +10 -0
  59. package/dist/member/index.js.map +1 -1
  60. package/dist/member/util.js +10 -0
  61. package/dist/member/util.js.map +1 -1
  62. package/dist/metrics/constants.js +6 -1
  63. package/dist/metrics/constants.js.map +1 -1
  64. package/dist/multistream/mediaRequestManager.js +9 -60
  65. package/dist/multistream/mediaRequestManager.js.map +1 -1
  66. package/dist/multistream/remoteMediaManager.js +11 -0
  67. package/dist/multistream/remoteMediaManager.js.map +1 -1
  68. package/dist/multistream/sendSlotManager.js +116 -2
  69. package/dist/multistream/sendSlotManager.js.map +1 -1
  70. package/dist/reachability/index.js +18 -10
  71. package/dist/reachability/index.js.map +1 -1
  72. package/dist/reactions/reactions.type.js.map +1 -1
  73. package/dist/reconnection-manager/index.js +0 -1
  74. package/dist/reconnection-manager/index.js.map +1 -1
  75. package/dist/types/aiEnableRequest/index.d.ts +5 -0
  76. package/dist/types/aiEnableRequest/utils.d.ts +2 -0
  77. package/dist/types/config.d.ts +4 -0
  78. package/dist/types/constants.d.ts +23 -1
  79. package/dist/types/hashTree/constants.d.ts +2 -0
  80. package/dist/types/hashTree/hashTree.d.ts +7 -0
  81. package/dist/types/hashTree/hashTreeParser.d.ts +122 -14
  82. package/dist/types/hashTree/types.d.ts +3 -0
  83. package/dist/types/hashTree/utils.d.ts +17 -0
  84. package/dist/types/index.d.ts +1 -0
  85. package/dist/types/interceptors/constant.d.ts +5 -0
  86. package/dist/types/interceptors/dataChannelAuthToken.d.ts +43 -0
  87. package/dist/types/interceptors/index.d.ts +2 -1
  88. package/dist/types/interceptors/utils.d.ts +1 -0
  89. package/dist/types/locus-info/index.d.ts +60 -8
  90. package/dist/types/locus-info/types.d.ts +7 -0
  91. package/dist/types/media/MediaConnectionAwaiter.d.ts +10 -1
  92. package/dist/types/media/properties.d.ts +2 -1
  93. package/dist/types/meeting/in-meeting-actions.d.ts +6 -0
  94. package/dist/types/meeting/index.d.ts +72 -7
  95. package/dist/types/meeting/request.d.ts +16 -1
  96. package/dist/types/meeting/request.type.d.ts +5 -0
  97. package/dist/types/meeting/util.d.ts +31 -0
  98. package/dist/types/meetings/index.d.ts +4 -2
  99. package/dist/types/member/index.d.ts +1 -0
  100. package/dist/types/member/util.d.ts +5 -0
  101. package/dist/types/metrics/constants.d.ts +5 -0
  102. package/dist/types/multistream/mediaRequestManager.d.ts +0 -23
  103. package/dist/types/multistream/sendSlotManager.d.ts +23 -1
  104. package/dist/types/reactions/reactions.type.d.ts +1 -0
  105. package/dist/types/webinar/utils.d.ts +6 -0
  106. package/dist/webinar/index.js +438 -163
  107. package/dist/webinar/index.js.map +1 -1
  108. package/dist/webinar/utils.js +25 -0
  109. package/dist/webinar/utils.js.map +1 -0
  110. package/package.json +24 -23
  111. package/src/aiEnableRequest/README.md +84 -0
  112. package/src/aiEnableRequest/index.ts +170 -0
  113. package/src/aiEnableRequest/utils.ts +25 -0
  114. package/src/annotation/index.ts +27 -7
  115. package/src/config.ts +4 -0
  116. package/src/constants.ts +29 -1
  117. package/src/hashTree/constants.ts +10 -0
  118. package/src/hashTree/hashTree.ts +17 -0
  119. package/src/hashTree/hashTreeParser.ts +764 -264
  120. package/src/hashTree/types.ts +4 -0
  121. package/src/hashTree/utils.ts +26 -0
  122. package/src/index.ts +8 -1
  123. package/src/interceptors/constant.ts +6 -0
  124. package/src/interceptors/dataChannelAuthToken.ts +170 -0
  125. package/src/interceptors/index.ts +2 -1
  126. package/src/interceptors/utils.ts +16 -0
  127. package/src/interpretation/index.ts +2 -2
  128. package/src/locus-info/controlsUtils.ts +11 -0
  129. package/src/locus-info/index.ts +579 -113
  130. package/src/locus-info/selfUtils.ts +1 -0
  131. package/src/locus-info/types.ts +8 -0
  132. package/src/media/MediaConnectionAwaiter.ts +41 -1
  133. package/src/media/properties.ts +3 -1
  134. package/src/meeting/in-meeting-actions.ts +12 -0
  135. package/src/meeting/index.ts +389 -87
  136. package/src/meeting/request.ts +42 -0
  137. package/src/meeting/request.type.ts +6 -0
  138. package/src/meeting/util.ts +160 -2
  139. package/src/meetings/index.ts +157 -44
  140. package/src/member/index.ts +10 -0
  141. package/src/member/util.ts +12 -0
  142. package/src/metrics/constants.ts +6 -0
  143. package/src/multistream/mediaRequestManager.ts +4 -54
  144. package/src/multistream/remoteMediaManager.ts +13 -0
  145. package/src/multistream/sendSlotManager.ts +97 -3
  146. package/src/reachability/index.ts +9 -0
  147. package/src/reactions/reactions.type.ts +1 -0
  148. package/src/reconnection-manager/index.ts +0 -1
  149. package/src/webinar/index.ts +265 -6
  150. package/src/webinar/utils.ts +16 -0
  151. package/test/unit/spec/aiEnableRequest/index.ts +981 -0
  152. package/test/unit/spec/aiEnableRequest/utils.ts +130 -0
  153. package/test/unit/spec/annotation/index.ts +69 -7
  154. package/test/unit/spec/hashTree/hashTree.ts +66 -0
  155. package/test/unit/spec/hashTree/hashTreeParser.ts +2469 -195
  156. package/test/unit/spec/hashTree/utils.ts +88 -1
  157. package/test/unit/spec/interceptors/dataChannelAuthToken.ts +210 -0
  158. package/test/unit/spec/interceptors/utils.ts +75 -0
  159. package/test/unit/spec/locus-info/controlsUtils.js +29 -0
  160. package/test/unit/spec/locus-info/index.js +1134 -55
  161. package/test/unit/spec/media/MediaConnectionAwaiter.ts +41 -1
  162. package/test/unit/spec/media/properties.ts +12 -3
  163. package/test/unit/spec/meeting/in-meeting-actions.ts +8 -2
  164. package/test/unit/spec/meeting/index.js +884 -152
  165. package/test/unit/spec/meeting/request.js +70 -0
  166. package/test/unit/spec/meeting/utils.js +438 -26
  167. package/test/unit/spec/meetings/index.js +653 -32
  168. package/test/unit/spec/member/index.js +28 -4
  169. package/test/unit/spec/member/util.js +65 -27
  170. package/test/unit/spec/multistream/mediaRequestManager.ts +2 -85
  171. package/test/unit/spec/multistream/remoteMediaManager.ts +30 -0
  172. package/test/unit/spec/multistream/sendSlotManager.ts +135 -36
  173. package/test/unit/spec/reachability/index.ts +23 -0
  174. package/test/unit/spec/reconnection-manager/index.js +4 -8
  175. package/test/unit/spec/webinar/index.ts +534 -37
  176. package/test/unit/spec/webinar/utils.ts +39 -0
@@ -8,11 +8,14 @@ _Object$defineProperty(exports, "__esModule", {
8
8
  exports.default = void 0;
9
9
  var _regenerator = _interopRequireDefault(require("@babel/runtime-corejs2/regenerator"));
10
10
  var _map = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/map"));
11
+ var _stringify = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/json/stringify"));
11
12
  var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/asyncToGenerator"));
12
13
  var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/classCallCheck"));
13
14
  var _createClass2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/createClass"));
14
15
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/defineProperty"));
15
16
  var _internalMediaCore = require("@webex/internal-media-core");
17
+ var _metrics = _interopRequireDefault(require("../metrics"));
18
+ var _constants = _interopRequireDefault(require("../metrics/constants"));
16
19
  /**
17
20
  * This class is used to manage the sendSlots for the given media types.
18
21
  */
@@ -223,6 +226,8 @@ var SendSlotManager = exports.default = /*#__PURE__*/function () {
223
226
  }
224
227
 
225
228
  /**
229
+ * @deprecated Use {@link setCustomCodecParameters} instead, which requires specifying the codec MIME type.
230
+ *
226
231
  * This method is used to set the codec parameters for the sendSlot of the given mediaType
227
232
  * @param {MediaType} mediaType MediaType of the sendSlot for which the codec parameters needs to be set (AUDIO_MAIN/VIDEO_MAIN/AUDIO_SLIDES/VIDEO_SLIDES)
228
233
  * @param {Object} codecParameters
@@ -247,7 +252,11 @@ var SendSlotManager = exports.default = /*#__PURE__*/function () {
247
252
  _context3.next = 2;
248
253
  return slot.setCodecParameters(codecParameters);
249
254
  case 2:
250
- this.LoggerProxy.logger.info("SendSlotsManager->setCodecParameters#Set codec parameters for ".concat(mediaType, " to ").concat(codecParameters));
255
+ this.LoggerProxy.logger.warn('SendSlotsManager->setCodecParameters --> [DEPRECATION WARNING]: setCodecParameters has been deprecated, use setCustomCodecParameters instead');
256
+ _metrics.default.sendBehavioralMetric(_constants.default.DEPRECATED_SET_CODEC_PARAMETERS_USED, {
257
+ mediaType: mediaType,
258
+ codecParameters: codecParameters
259
+ });
251
260
  case 3:
252
261
  case "end":
253
262
  return _context3.stop();
@@ -260,6 +269,8 @@ var SendSlotManager = exports.default = /*#__PURE__*/function () {
260
269
  return setCodecParameters;
261
270
  }()
262
271
  /**
272
+ * @deprecated Use {@link markCustomCodecParametersForDeletion} instead, which requires specifying the codec MIME type.
273
+ *
263
274
  * This method is used to delete the codec parameters for the sendSlot of the given mediaType
264
275
  * @param {MediaType} mediaType MediaType of the sendSlot for which the codec parameters needs to be deleted (AUDIO_MAIN/VIDEO_MAIN/AUDIO_SLIDES/VIDEO_SLIDES)
265
276
  * @param {Array<String>} parameters Array of keys of the codec parameters to be deleted
@@ -284,7 +295,11 @@ var SendSlotManager = exports.default = /*#__PURE__*/function () {
284
295
  _context4.next = 2;
285
296
  return slot.deleteCodecParameters(parameters);
286
297
  case 2:
287
- this.LoggerProxy.logger.info("SendSlotsManager->deleteCodecParameters#Deleted the following codec parameters -> ".concat(parameters, " for ").concat(mediaType));
298
+ this.LoggerProxy.logger.warn('SendSlotsManager->deleteCodecParameters --> [DEPRECATION WARNING]: deleteCodecParameters has been deprecated, use markCustomCodecParametersForDeletion instead');
299
+ _metrics.default.sendBehavioralMetric(_constants.default.DEPRECATED_DELETE_CODEC_PARAMETERS_USED, {
300
+ mediaType: mediaType,
301
+ parameters: parameters
302
+ });
288
303
  case 3:
289
304
  case "end":
290
305
  return _context4.stop();
@@ -296,6 +311,105 @@ var SendSlotManager = exports.default = /*#__PURE__*/function () {
296
311
  }
297
312
  return deleteCodecParameters;
298
313
  }()
314
+ /**
315
+ * Sets custom codec parameters for the sendSlot of the given mediaType, scoped to a specific codec MIME type.
316
+ * Delegates to WCME's setCustomCodecParameters API.
317
+ * @param {MediaType} mediaType MediaType of the sendSlot
318
+ * @param {MediaCodecMimeType} codecMimeType The codec MIME type to apply parameters to (e.g. OPUS, H264, AV1)
319
+ * @param {CodecParameters} parameters Key-value pairs of codec parameters to set
320
+ * @returns {Promise<void>}
321
+ */
322
+ )
323
+ }, {
324
+ key: "setCustomCodecParameters",
325
+ value: (function () {
326
+ var _setCustomCodecParameters = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee5(mediaType, codecMimeType, parameters) {
327
+ var slot, _t;
328
+ return _regenerator.default.wrap(function (_context5) {
329
+ while (1) switch (_context5.prev = _context5.next) {
330
+ case 0:
331
+ slot = this.slots.get(mediaType);
332
+ if (slot) {
333
+ _context5.next = 1;
334
+ break;
335
+ }
336
+ throw new Error("Slot for ".concat(mediaType, " does not exist"));
337
+ case 1:
338
+ _context5.prev = 1;
339
+ _context5.next = 2;
340
+ return slot.setCustomCodecParameters(codecMimeType, parameters);
341
+ case 2:
342
+ this.LoggerProxy.logger.info("SendSlotsManager->setCustomCodecParameters#Set custom codec parameters for ".concat(mediaType, " (codec: ").concat(codecMimeType, ") to ").concat((0, _stringify.default)(parameters)));
343
+ _context5.next = 4;
344
+ break;
345
+ case 3:
346
+ _context5.prev = 3;
347
+ _t = _context5["catch"](1);
348
+ this.LoggerProxy.logger.error("SendSlotsManager->setCustomCodecParameters#Failed to set custom codec parameters for ".concat(mediaType, " (codec: ").concat(codecMimeType, "): ").concat(_t));
349
+ throw _t;
350
+ case 4:
351
+ _context5.prev = 4;
352
+ _metrics.default.sendBehavioralMetric(_constants.default.SET_CUSTOM_CODEC_PARAMETERS_USED, {
353
+ mediaType: mediaType,
354
+ codecMimeType: codecMimeType,
355
+ parameters: parameters
356
+ });
357
+ return _context5.finish(4);
358
+ case 5:
359
+ case "end":
360
+ return _context5.stop();
361
+ }
362
+ }, _callee5, this, [[1, 3, 4, 5]]);
363
+ }));
364
+ function setCustomCodecParameters(_x8, _x9, _x0) {
365
+ return _setCustomCodecParameters.apply(this, arguments);
366
+ }
367
+ return setCustomCodecParameters;
368
+ }()
369
+ /**
370
+ * Marks custom codec parameters for deletion on the sendSlot of the given mediaType, scoped to a specific codec MIME type.
371
+ * Delegates to WCME's markCustomCodecParametersForDeletion API.
372
+ * @param {MediaType} mediaType MediaType of the sendSlot
373
+ * @param {MediaCodecMimeType} codecMimeType The codec MIME type whose parameters should be deleted (e.g. OPUS, H264, AV1)
374
+ * @param {string[]} parameters Array of parameter keys to delete
375
+ * @returns {Promise<void>}
376
+ */
377
+ )
378
+ }, {
379
+ key: "markCustomCodecParametersForDeletion",
380
+ value: (function () {
381
+ var _markCustomCodecParametersForDeletion = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee6(mediaType, codecMimeType, parameters) {
382
+ var slot;
383
+ return _regenerator.default.wrap(function (_context6) {
384
+ while (1) switch (_context6.prev = _context6.next) {
385
+ case 0:
386
+ slot = this.slots.get(mediaType);
387
+ if (slot) {
388
+ _context6.next = 1;
389
+ break;
390
+ }
391
+ throw new Error("Slot for ".concat(mediaType, " does not exist"));
392
+ case 1:
393
+ _context6.next = 2;
394
+ return slot.markCustomCodecParametersForDeletion(codecMimeType, parameters);
395
+ case 2:
396
+ this.LoggerProxy.logger.info("SendSlotsManager->markCustomCodecParametersForDeletion#Marked codec parameters for deletion -> ".concat(parameters, " for ").concat(mediaType, " (codec: ").concat(codecMimeType, ")"));
397
+ _metrics.default.sendBehavioralMetric(_constants.default.MARK_CUSTOM_CODEC_PARAMETERS_FOR_DELETION_USED, {
398
+ mediaType: mediaType,
399
+ codecMimeType: codecMimeType,
400
+ parameters: parameters
401
+ });
402
+ case 3:
403
+ case "end":
404
+ return _context6.stop();
405
+ }
406
+ }, _callee6, this);
407
+ }));
408
+ function markCustomCodecParametersForDeletion(_x1, _x10, _x11) {
409
+ return _markCustomCodecParametersForDeletion.apply(this, arguments);
410
+ }
411
+ return markCustomCodecParametersForDeletion;
412
+ }()
299
413
  /**
300
414
  * This method is used to reset the SendSlotsManager by deleting all the sendSlots
301
415
  * @returns {undefined}
@@ -1 +1 @@
1
- {"version":3,"names":["_internalMediaCore","require","SendSlotManager","exports","default","LoggerProxy","_classCallCheck2","_defineProperty2","_map","_createClass2","key","value","createSlot","mediaConnection","mediaType","active","arguments","length","undefined","slots","has","Error","concat","slot","createSendSlot","set","logger","info","getSlot","get","setNamedMediaGroups","namedMediaGroups","MediaType","AudioMain","setSourceStateOverride","state","VideoMain","currentStateOverride","getSourceStateOverride","sourceStateOverrides","clearSourceStateOverride","delete","_publishStream","_asyncToGenerator2","_regenerator","mark","_callee","stream","wrap","_context","prev","next","publishStream","label","muted","stop","_x","_x2","apply","_unpublishStream","_callee2","_context2","unpublishStream","_x3","setActive","_setCodecParameters","_callee3","codecParameters","_context3","setCodecParameters","_x4","_x5","_deleteCodecParameters","_callee4","parameters","_context4","deleteCodecParameters","_x6","_x7","reset","clear"],"sources":["sendSlotManager.ts"],"sourcesContent":["import {\n SendSlot,\n MediaType,\n LocalStream,\n MultistreamRoapMediaConnection,\n NamedMediaGroup,\n StreamState,\n} from '@webex/internal-media-core';\n\n/**\n * This class is used to manage the sendSlots for the given media types.\n */\nexport default class SendSlotManager {\n private readonly slots: Map<MediaType, SendSlot> = new Map();\n private readonly LoggerProxy: any;\n private readonly sourceStateOverrides: Map<MediaType, StreamState> = new Map();\n\n /**\n * Constructor for SendSlotManager\n *\n * @param {any} LoggerProxy is used to log the messages\n * @constructor\n */\n constructor(LoggerProxy: any) {\n this.LoggerProxy = LoggerProxy;\n }\n\n /**\n * This method is used to create a sendSlot for the given mediaType and returns the created sendSlot\n * @param {MultistreamRoapMediaConnection} mediaConnection MultistreamRoapMediaConnection for which a sendSlot needs to be created\n * @param {MediaType} mediaType MediaType for which a sendSlot needs to be created (AUDIO_MAIN/VIDEO_MAIN/AUDIO_SLIDES/VIDEO_SLIDES)\n * @param {boolean} active This is optional boolean to set the active state of the sendSlot. Default is true\n * @returns {SendSlot} slot The created sendSlot\n */\n public createSlot(\n mediaConnection: MultistreamRoapMediaConnection,\n mediaType: MediaType,\n active = true\n ): SendSlot {\n if (this.slots.has(mediaType)) {\n throw new Error(`Slot for ${mediaType} already exists`);\n }\n\n const slot: SendSlot = mediaConnection.createSendSlot(mediaType, active);\n\n this.slots.set(mediaType, slot);\n\n this.LoggerProxy.logger.info(\n `SendSlotsManager->createSlot#Created slot for ${mediaType} with active ${active}`\n );\n\n return slot;\n }\n\n /**\n * This method is used to retrieve the sendSlot for the given mediaType\n * @param {MediaType} mediaType of which the slot needs to be retrieved\n * @returns {SendSlot}\n */\n public getSlot(mediaType: MediaType): SendSlot {\n const slot = this.slots.get(mediaType);\n\n if (!slot) {\n throw new Error(`Slot for ${mediaType} does not exist`);\n }\n\n return slot;\n }\n\n /**\n * Allow users to specify 'namedMediaGroups' to indicate which named media group its audio should be sent to.\n * @param {MediaType} mediaType MediaType of the sendSlot to which the audio stream needs to be send to the media group\n * @param {[]}namedMediaGroups - Allow users to specify 'namedMediaGroups'.If the value of 'namedMediaGroups' is zero,\n * named media group will be canceled and the audio stream will be sent to the floor.\n * @returns {void}\n */\n public setNamedMediaGroups(mediaType: MediaType, namedMediaGroups: NamedMediaGroup[]) {\n if (mediaType !== MediaType.AudioMain) {\n throw new Error(\n `sendSlotManager cannot set named media group which media type is ${mediaType}`\n );\n }\n\n const slot = this.slots.get(mediaType);\n\n if (!slot) {\n throw new Error(`Slot for ${mediaType} does not exist`);\n }\n\n slot.setNamedMediaGroups(namedMediaGroups);\n\n this.LoggerProxy.logger.info(\n `SendSlotsManager->setNamedMediaGroups#set named media group ${namedMediaGroups}`\n );\n }\n\n /**\n * Sets the source state override for the given media type.\n * @param {MediaType} mediaType - The type of media (must be MediaType.VideoMain to apply source state changes).\n * @param {StreamState | null} state - The state to set or null to clear the override value.\n * @returns {void}\n */\n public setSourceStateOverride(mediaType: MediaType, state: StreamState | null) {\n if (mediaType !== MediaType.VideoMain) {\n throw new Error(\n `Invalid media type '${mediaType}'. Source state overrides are only applicable to ${MediaType.VideoMain}.`\n );\n }\n\n const slot = this.slots.get(mediaType);\n\n if (!slot) {\n throw new Error(`Slot for ${mediaType} does not exist`);\n }\n\n const currentStateOverride = this.getSourceStateOverride(mediaType);\n if (currentStateOverride === state) {\n return;\n }\n\n if (state) {\n slot.setSourceStateOverride(state);\n this.sourceStateOverrides.set(mediaType, state);\n } else {\n slot.clearSourceStateOverride();\n this.sourceStateOverrides.delete(mediaType);\n }\n\n this.LoggerProxy.logger.info(\n `SendSlotManager->setSourceStateOverride#set source state override for ${mediaType} to ${state}`\n );\n }\n\n /**\n * Gets the source state override for the given media type.\n * @param {MediaType} mediaType - The type of media to get the source state override for.\n * @returns {StreamState | null} - The current source state override or null if not set.\n */\n private getSourceStateOverride(mediaType: MediaType): StreamState | null {\n if (mediaType !== MediaType.VideoMain) {\n throw new Error(\n `Invalid media type '${mediaType}'. Source state overrides are only applicable to ${MediaType.VideoMain}.`\n );\n }\n\n return this.sourceStateOverrides.get(mediaType) || null;\n }\n\n /**\n * This method publishes the given stream to the sendSlot for the given mediaType\n * @param {MediaType} mediaType MediaType of the sendSlot to which a stream needs to be published (AUDIO_MAIN/VIDEO_MAIN/AUDIO_SLIDES/VIDEO_SLIDES)\n * @param {LocalStream} stream LocalStream to be published\n * @returns {Promise<void>}\n */\n public async publishStream(mediaType: MediaType, stream: LocalStream): Promise<void> {\n const slot = this.slots.get(mediaType);\n\n if (!slot) {\n throw new Error(`Slot for ${mediaType} does not exist`);\n }\n\n await slot.publishStream(stream);\n\n this.LoggerProxy.logger.info(\n `SendSlotsManager->publishStream#Published stream for ${mediaType} and stream with label ${stream.label} and muted ${stream.muted}`\n );\n }\n\n /**\n * This method unpublishes the stream from the sendSlot of the given mediaType\n * @param {MediaType} mediaType MediaType of the sendSlot from which a stream needs to be unpublished (AUDIO_MAIN/VIDEO_MAIN/AUDIO_SLIDES/VIDEO_SLIDES)\n * @returns {Promise<void>}\n */\n public async unpublishStream(mediaType: MediaType): Promise<void> {\n const slot = this.slots.get(mediaType);\n\n if (!slot) {\n throw new Error(`Slot for ${mediaType} does not exist`);\n }\n\n await slot.unpublishStream();\n\n this.LoggerProxy.logger.info(\n `SendSlotsManager->unpublishStream#Unpublished stream for ${mediaType}`\n );\n }\n\n /**\n * This method is used to set the active state of the sendSlot for the given mediaType\n * @param {MediaType} mediaType The MediaType of the sendSlot for which the active state needs to be set (AUDIO_MAIN/VIDEO_MAIN/AUDIO_SLIDES/VIDEO_SLIDES)\n * @param {boolean} active The boolean to set the active state of the sendSlot. Default is true\n * @returns {void}\n */\n public setActive(mediaType: MediaType, active = true): void {\n const slot = this.slots.get(mediaType);\n\n if (!slot) {\n throw new Error(`Slot for ${mediaType} does not exist`);\n }\n\n slot.active = active;\n\n this.LoggerProxy.logger.info(\n `SendSlotsManager->setActive#Set active for ${mediaType} to ${active}`\n );\n }\n\n /**\n * This method is used to set the codec parameters for the sendSlot of the given mediaType\n * @param {MediaType} mediaType MediaType of the sendSlot for which the codec parameters needs to be set (AUDIO_MAIN/VIDEO_MAIN/AUDIO_SLIDES/VIDEO_SLIDES)\n * @param {Object} codecParameters\n * @returns {Promise<void>}\n */\n public async setCodecParameters(\n mediaType: MediaType,\n codecParameters: {\n [key: string]: string | undefined; // As per ts-sdp undefined is considered as a valid value to be used for codec parameters\n }\n ): Promise<void> {\n // These codec parameter changes underneath are SDP value changes that are taken care by WCME automatically. So no need for any change in streams from the web sdk side\n const slot = this.slots.get(mediaType);\n\n if (!slot) {\n throw new Error(`Slot for ${mediaType} does not exist`);\n }\n\n await slot.setCodecParameters(codecParameters);\n\n this.LoggerProxy.logger.info(\n `SendSlotsManager->setCodecParameters#Set codec parameters for ${mediaType} to ${codecParameters}`\n );\n }\n\n /**\n * This method is used to delete the codec parameters for the sendSlot of the given mediaType\n * @param {MediaType} mediaType MediaType of the sendSlot for which the codec parameters needs to be deleted (AUDIO_MAIN/VIDEO_MAIN/AUDIO_SLIDES/VIDEO_SLIDES)\n * @param {Array<String>} parameters Array of keys of the codec parameters to be deleted\n * @returns {Promise<void>}\n */\n public async deleteCodecParameters(mediaType: MediaType, parameters: string[]): Promise<void> {\n const slot = this.slots.get(mediaType);\n\n if (!slot) {\n throw new Error(`Slot for ${mediaType} does not exist`);\n }\n\n await slot.deleteCodecParameters(parameters);\n\n this.LoggerProxy.logger.info(\n `SendSlotsManager->deleteCodecParameters#Deleted the following codec parameters -> ${parameters} for ${mediaType}`\n );\n }\n\n /**\n * This method is used to reset the SendSlotsManager by deleting all the sendSlots\n * @returns {undefined}\n */\n public reset(): void {\n this.slots.clear();\n }\n}\n"],"mappings":";;;;;;;;;;;;;;AAAA,IAAAA,kBAAA,GAAAC,OAAA;AASA;AACA;AACA;AAFA,IAGqBC,eAAe,GAAAC,OAAA,CAAAC,OAAA;EAKlC;AACF;AACA;AACA;AACA;AACA;EACE,SAAAF,gBAAYG,WAAgB,EAAE;IAAA,IAAAC,gBAAA,CAAAF,OAAA,QAAAF,eAAA;IAAA,IAAAK,gBAAA,CAAAH,OAAA,iBAVqB,IAAAI,IAAA,CAAAJ,OAAA,CAAQ,CAAC;IAAA,IAAAG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CACH;MAAA,SAZYG,qBAAqBA,CAAAC,GAAA,EAAAC,GAAA;QAAA,OAAAN,sBAAA,CAAAd,KAAA,OAAA1C,SAAA;MAAA;MAAA,OAArB4D,qBAAqB;IAAA;IAclC;AACF;AACA;AACA;IAHE;EAAA;IAAAlE,GAAA;IAAAC,KAAA,EAIA,SAAOoE,KAAKA,CAAA,EAAS;MACnB,IAAI,CAAC5D,KAAK,CAAC6D,KAAK,CAAC,CAAC;IACpB;EAAC;AAAA","ignoreList":[]}
1
+ {"version":3,"names":["_internalMediaCore","require","_metrics","_interopRequireDefault","_constants","SendSlotManager","exports","default","LoggerProxy","_classCallCheck2","_defineProperty2","_map","_createClass2","key","value","createSlot","mediaConnection","mediaType","active","arguments","length","undefined","slots","has","Error","concat","slot","createSendSlot","set","logger","info","getSlot","get","setNamedMediaGroups","namedMediaGroups","MediaType","AudioMain","setSourceStateOverride","state","VideoMain","currentStateOverride","getSourceStateOverride","sourceStateOverrides","clearSourceStateOverride","delete","_publishStream","_asyncToGenerator2","_regenerator","mark","_callee","stream","wrap","_context","prev","next","publishStream","label","muted","stop","_x","_x2","apply","_unpublishStream","_callee2","_context2","unpublishStream","_x3","setActive","_setCodecParameters","_callee3","codecParameters","_context3","setCodecParameters","warn","Metrics","sendBehavioralMetric","BEHAVIORAL_METRICS","DEPRECATED_SET_CODEC_PARAMETERS_USED","_x4","_x5","_deleteCodecParameters","_callee4","parameters","_context4","deleteCodecParameters","DEPRECATED_DELETE_CODEC_PARAMETERS_USED","_x6","_x7","_setCustomCodecParameters","_callee5","codecMimeType","_t","_context5","setCustomCodecParameters","_stringify","error","SET_CUSTOM_CODEC_PARAMETERS_USED","finish","_x8","_x9","_x0","_markCustomCodecParametersForDeletion","_callee6","_context6","markCustomCodecParametersForDeletion","MARK_CUSTOM_CODEC_PARAMETERS_FOR_DELETION_USED","_x1","_x10","_x11","reset","clear"],"sources":["sendSlotManager.ts"],"sourcesContent":["import {\n SendSlot,\n MediaType,\n LocalStream,\n MultistreamRoapMediaConnection,\n NamedMediaGroup,\n StreamState,\n MediaCodecMimeType,\n CodecParameters,\n} from '@webex/internal-media-core';\nimport Metrics from '../metrics';\nimport BEHAVIORAL_METRICS from '../metrics/constants';\n\n/**\n * This class is used to manage the sendSlots for the given media types.\n */\nexport default class SendSlotManager {\n private readonly slots: Map<MediaType, SendSlot> = new Map();\n private readonly LoggerProxy: any;\n private readonly sourceStateOverrides: Map<MediaType, StreamState> = new Map();\n\n /**\n * Constructor for SendSlotManager\n *\n * @param {any} LoggerProxy is used to log the messages\n * @constructor\n */\n constructor(LoggerProxy: any) {\n this.LoggerProxy = LoggerProxy;\n }\n\n /**\n * This method is used to create a sendSlot for the given mediaType and returns the created sendSlot\n * @param {MultistreamRoapMediaConnection} mediaConnection MultistreamRoapMediaConnection for which a sendSlot needs to be created\n * @param {MediaType} mediaType MediaType for which a sendSlot needs to be created (AUDIO_MAIN/VIDEO_MAIN/AUDIO_SLIDES/VIDEO_SLIDES)\n * @param {boolean} active This is optional boolean to set the active state of the sendSlot. Default is true\n * @returns {SendSlot} slot The created sendSlot\n */\n public createSlot(\n mediaConnection: MultistreamRoapMediaConnection,\n mediaType: MediaType,\n active = true\n ): SendSlot {\n if (this.slots.has(mediaType)) {\n throw new Error(`Slot for ${mediaType} already exists`);\n }\n\n const slot: SendSlot = mediaConnection.createSendSlot(mediaType, active);\n\n this.slots.set(mediaType, slot);\n\n this.LoggerProxy.logger.info(\n `SendSlotsManager->createSlot#Created slot for ${mediaType} with active ${active}`\n );\n\n return slot;\n }\n\n /**\n * This method is used to retrieve the sendSlot for the given mediaType\n * @param {MediaType} mediaType of which the slot needs to be retrieved\n * @returns {SendSlot}\n */\n public getSlot(mediaType: MediaType): SendSlot {\n const slot = this.slots.get(mediaType);\n\n if (!slot) {\n throw new Error(`Slot for ${mediaType} does not exist`);\n }\n\n return slot;\n }\n\n /**\n * Allow users to specify 'namedMediaGroups' to indicate which named media group its audio should be sent to.\n * @param {MediaType} mediaType MediaType of the sendSlot to which the audio stream needs to be send to the media group\n * @param {[]}namedMediaGroups - Allow users to specify 'namedMediaGroups'.If the value of 'namedMediaGroups' is zero,\n * named media group will be canceled and the audio stream will be sent to the floor.\n * @returns {void}\n */\n public setNamedMediaGroups(mediaType: MediaType, namedMediaGroups: NamedMediaGroup[]) {\n if (mediaType !== MediaType.AudioMain) {\n throw new Error(\n `sendSlotManager cannot set named media group which media type is ${mediaType}`\n );\n }\n\n const slot = this.slots.get(mediaType);\n\n if (!slot) {\n throw new Error(`Slot for ${mediaType} does not exist`);\n }\n\n slot.setNamedMediaGroups(namedMediaGroups);\n\n this.LoggerProxy.logger.info(\n `SendSlotsManager->setNamedMediaGroups#set named media group ${namedMediaGroups}`\n );\n }\n\n /**\n * Sets the source state override for the given media type.\n * @param {MediaType} mediaType - The type of media (must be MediaType.VideoMain to apply source state changes).\n * @param {StreamState | null} state - The state to set or null to clear the override value.\n * @returns {void}\n */\n public setSourceStateOverride(mediaType: MediaType, state: StreamState | null) {\n if (mediaType !== MediaType.VideoMain) {\n throw new Error(\n `Invalid media type '${mediaType}'. Source state overrides are only applicable to ${MediaType.VideoMain}.`\n );\n }\n\n const slot = this.slots.get(mediaType);\n\n if (!slot) {\n throw new Error(`Slot for ${mediaType} does not exist`);\n }\n\n const currentStateOverride = this.getSourceStateOverride(mediaType);\n if (currentStateOverride === state) {\n return;\n }\n\n if (state) {\n slot.setSourceStateOverride(state);\n this.sourceStateOverrides.set(mediaType, state);\n } else {\n slot.clearSourceStateOverride();\n this.sourceStateOverrides.delete(mediaType);\n }\n\n this.LoggerProxy.logger.info(\n `SendSlotManager->setSourceStateOverride#set source state override for ${mediaType} to ${state}`\n );\n }\n\n /**\n * Gets the source state override for the given media type.\n * @param {MediaType} mediaType - The type of media to get the source state override for.\n * @returns {StreamState | null} - The current source state override or null if not set.\n */\n private getSourceStateOverride(mediaType: MediaType): StreamState | null {\n if (mediaType !== MediaType.VideoMain) {\n throw new Error(\n `Invalid media type '${mediaType}'. Source state overrides are only applicable to ${MediaType.VideoMain}.`\n );\n }\n\n return this.sourceStateOverrides.get(mediaType) || null;\n }\n\n /**\n * This method publishes the given stream to the sendSlot for the given mediaType\n * @param {MediaType} mediaType MediaType of the sendSlot to which a stream needs to be published (AUDIO_MAIN/VIDEO_MAIN/AUDIO_SLIDES/VIDEO_SLIDES)\n * @param {LocalStream} stream LocalStream to be published\n * @returns {Promise<void>}\n */\n public async publishStream(mediaType: MediaType, stream: LocalStream): Promise<void> {\n const slot = this.slots.get(mediaType);\n\n if (!slot) {\n throw new Error(`Slot for ${mediaType} does not exist`);\n }\n\n await slot.publishStream(stream);\n\n this.LoggerProxy.logger.info(\n `SendSlotsManager->publishStream#Published stream for ${mediaType} and stream with label ${stream.label} and muted ${stream.muted}`\n );\n }\n\n /**\n * This method unpublishes the stream from the sendSlot of the given mediaType\n * @param {MediaType} mediaType MediaType of the sendSlot from which a stream needs to be unpublished (AUDIO_MAIN/VIDEO_MAIN/AUDIO_SLIDES/VIDEO_SLIDES)\n * @returns {Promise<void>}\n */\n public async unpublishStream(mediaType: MediaType): Promise<void> {\n const slot = this.slots.get(mediaType);\n\n if (!slot) {\n throw new Error(`Slot for ${mediaType} does not exist`);\n }\n\n await slot.unpublishStream();\n\n this.LoggerProxy.logger.info(\n `SendSlotsManager->unpublishStream#Unpublished stream for ${mediaType}`\n );\n }\n\n /**\n * This method is used to set the active state of the sendSlot for the given mediaType\n * @param {MediaType} mediaType The MediaType of the sendSlot for which the active state needs to be set (AUDIO_MAIN/VIDEO_MAIN/AUDIO_SLIDES/VIDEO_SLIDES)\n * @param {boolean} active The boolean to set the active state of the sendSlot. Default is true\n * @returns {void}\n */\n public setActive(mediaType: MediaType, active = true): void {\n const slot = this.slots.get(mediaType);\n\n if (!slot) {\n throw new Error(`Slot for ${mediaType} does not exist`);\n }\n\n slot.active = active;\n\n this.LoggerProxy.logger.info(\n `SendSlotsManager->setActive#Set active for ${mediaType} to ${active}`\n );\n }\n\n /**\n * @deprecated Use {@link setCustomCodecParameters} instead, which requires specifying the codec MIME type.\n *\n * This method is used to set the codec parameters for the sendSlot of the given mediaType\n * @param {MediaType} mediaType MediaType of the sendSlot for which the codec parameters needs to be set (AUDIO_MAIN/VIDEO_MAIN/AUDIO_SLIDES/VIDEO_SLIDES)\n * @param {Object} codecParameters\n * @returns {Promise<void>}\n */\n public async setCodecParameters(\n mediaType: MediaType,\n codecParameters: {\n [key: string]: string | undefined; // As per ts-sdp undefined is considered as a valid value to be used for codec parameters\n }\n ): Promise<void> {\n // These codec parameter changes underneath are SDP value changes that are taken care by WCME automatically. So no need for any change in streams from the web sdk side\n const slot = this.slots.get(mediaType);\n\n if (!slot) {\n throw new Error(`Slot for ${mediaType} does not exist`);\n }\n\n await slot.setCodecParameters(codecParameters);\n\n this.LoggerProxy.logger.warn(\n 'SendSlotsManager->setCodecParameters --> [DEPRECATION WARNING]: setCodecParameters has been deprecated, use setCustomCodecParameters instead'\n );\n\n Metrics.sendBehavioralMetric(BEHAVIORAL_METRICS.DEPRECATED_SET_CODEC_PARAMETERS_USED, {\n mediaType,\n codecParameters,\n });\n }\n\n /**\n * @deprecated Use {@link markCustomCodecParametersForDeletion} instead, which requires specifying the codec MIME type.\n *\n * This method is used to delete the codec parameters for the sendSlot of the given mediaType\n * @param {MediaType} mediaType MediaType of the sendSlot for which the codec parameters needs to be deleted (AUDIO_MAIN/VIDEO_MAIN/AUDIO_SLIDES/VIDEO_SLIDES)\n * @param {Array<String>} parameters Array of keys of the codec parameters to be deleted\n * @returns {Promise<void>}\n */\n public async deleteCodecParameters(mediaType: MediaType, parameters: string[]): Promise<void> {\n const slot = this.slots.get(mediaType);\n\n if (!slot) {\n throw new Error(`Slot for ${mediaType} does not exist`);\n }\n\n await slot.deleteCodecParameters(parameters);\n\n this.LoggerProxy.logger.warn(\n 'SendSlotsManager->deleteCodecParameters --> [DEPRECATION WARNING]: deleteCodecParameters has been deprecated, use markCustomCodecParametersForDeletion instead'\n );\n\n Metrics.sendBehavioralMetric(BEHAVIORAL_METRICS.DEPRECATED_DELETE_CODEC_PARAMETERS_USED, {\n mediaType,\n parameters,\n });\n }\n\n /**\n * Sets custom codec parameters for the sendSlot of the given mediaType, scoped to a specific codec MIME type.\n * Delegates to WCME's setCustomCodecParameters API.\n * @param {MediaType} mediaType MediaType of the sendSlot\n * @param {MediaCodecMimeType} codecMimeType The codec MIME type to apply parameters to (e.g. OPUS, H264, AV1)\n * @param {CodecParameters} parameters Key-value pairs of codec parameters to set\n * @returns {Promise<void>}\n */\n public async setCustomCodecParameters(\n mediaType: MediaType,\n codecMimeType: MediaCodecMimeType,\n parameters: CodecParameters\n ): Promise<void> {\n const slot = this.slots.get(mediaType);\n\n if (!slot) {\n throw new Error(`Slot for ${mediaType} does not exist`);\n }\n\n try {\n await slot.setCustomCodecParameters(codecMimeType, parameters);\n\n this.LoggerProxy.logger.info(\n `SendSlotsManager->setCustomCodecParameters#Set custom codec parameters for ${mediaType} (codec: ${codecMimeType}) to ${JSON.stringify(\n parameters\n )}`\n );\n } catch (error) {\n this.LoggerProxy.logger.error(\n `SendSlotsManager->setCustomCodecParameters#Failed to set custom codec parameters for ${mediaType} (codec: ${codecMimeType}): ${error}`\n );\n throw error;\n } finally {\n Metrics.sendBehavioralMetric(BEHAVIORAL_METRICS.SET_CUSTOM_CODEC_PARAMETERS_USED, {\n mediaType,\n codecMimeType,\n parameters,\n });\n }\n }\n\n /**\n * Marks custom codec parameters for deletion on the sendSlot of the given mediaType, scoped to a specific codec MIME type.\n * Delegates to WCME's markCustomCodecParametersForDeletion API.\n * @param {MediaType} mediaType MediaType of the sendSlot\n * @param {MediaCodecMimeType} codecMimeType The codec MIME type whose parameters should be deleted (e.g. OPUS, H264, AV1)\n * @param {string[]} parameters Array of parameter keys to delete\n * @returns {Promise<void>}\n */\n public async markCustomCodecParametersForDeletion(\n mediaType: MediaType,\n codecMimeType: MediaCodecMimeType,\n parameters: string[]\n ): Promise<void> {\n const slot = this.slots.get(mediaType);\n\n if (!slot) {\n throw new Error(`Slot for ${mediaType} does not exist`);\n }\n\n await slot.markCustomCodecParametersForDeletion(codecMimeType, parameters);\n\n this.LoggerProxy.logger.info(\n `SendSlotsManager->markCustomCodecParametersForDeletion#Marked codec parameters for deletion -> ${parameters} for ${mediaType} (codec: ${codecMimeType})`\n );\n\n Metrics.sendBehavioralMetric(\n BEHAVIORAL_METRICS.MARK_CUSTOM_CODEC_PARAMETERS_FOR_DELETION_USED,\n {\n mediaType,\n codecMimeType,\n parameters,\n }\n );\n }\n\n /**\n * This method is used to reset the SendSlotsManager by deleting all the sendSlots\n * @returns {undefined}\n */\n public reset(): void {\n this.slots.clear();\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;AAAA,IAAAA,kBAAA,GAAAC,OAAA;AAUA,IAAAC,QAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,UAAA,GAAAD,sBAAA,CAAAF,OAAA;AAEA;AACA;AACA;AAFA,IAGqBI,eAAe,GAAAC,OAAA,CAAAC,OAAA;EAKlC;AACF;AACA;AACA;AACA;AACA;EACE,SAAAF,gBAAYG,WAAgB,EAAE;IAAA,IAAAC,gBAAA,CAAAF,OAAA,QAAAF,eAAA;IAAA,IAAAK,gBAAA,CAAAH,OAAA,iBAVqB,IAAAI,IAAA,CAAAJ,OAAA,CAAQ,CAAC;IAAA,IAAAG,gBAAA,CAAAH,OAAA;IAAA,IAAAG,gBAAA,CAAAH,OAAA,gCAES,IAAAI,IAAA,CAAAJ,OAAA,CAAQ,CAAC;IAS5E,IAAI,CAACC,WAAW,GAAGA,WAAW;EAChC;;EAEA;AACF;AACA;AACA;AACA;AACA;AACA;EANE,WAAAI,aAAA,CAAAL,OAAA,EAAAF,eAAA;IAAAQ,GAAA;IAAAC,KAAA,EAOA,SAAOC,UAAUA,CACfC,eAA+C,EAC/CC,SAAoB,EAEV;MAAA,IADVC,MAAM,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,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AAoB,CAC1BC,kBAAkB,CAAC6B,8CAA8C,EACjE;gBACExF,SAAS,EAATA,SAAS;gBACTyE,aAAa,EAAbA,aAAa;gBACbR,UAAU,EAAVA;cACF,CACF,CAAC;YAAC;YAAA;cAAA,OAAAqB,SAAA,CAAA7C,IAAA;UAAA;QAAA,GAAA4C,QAAA;MAAA,CACH;MAAA,SAzBYE,oCAAoCA,CAAAE,GAAA,EAAAC,IAAA,EAAAC,IAAA;QAAA,OAAAP,qCAAA,CAAAxC,KAAA,OAAA1C,SAAA;MAAA;MAAA,OAApCqF,oCAAoC;IAAA;IA2BjD;AACF;AACA;AACA;IAHE;EAAA;IAAA3F,GAAA;IAAAC,KAAA,EAIA,SAAO+F,KAAKA,CAAA,EAAS;MACnB,IAAI,CAACvF,KAAK,CAACwF,KAAK,CAAC,CAAC;IACpB;EAAC;AAAA","ignoreList":[]}
@@ -30,6 +30,7 @@ var _inherits2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/
30
30
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/defineProperty"));
31
31
  var _lodash = require("lodash");
32
32
  var _common = require("@webex/common");
33
+ var _webCapabilities = require("@webex/web-capabilities");
33
34
  var _loggerProxy = _interopRequireDefault(require("../common/logs/logger-proxy"));
34
35
  var _util = _interopRequireDefault(require("../meeting/util"));
35
36
  var _constants = require("../constants");
@@ -232,35 +233,42 @@ var Reachability = exports.default = /*#__PURE__*/function (_EventsScope) {
232
233
  }
233
234
  throw new Error('enableReachabilityChecks is disabled in config');
234
235
  case 1:
235
- _context2.prev = 1;
236
+ if (!(_webCapabilities.WebCapabilities.supportsRTCPeerConnection() !== _webCapabilities.CapabilityState.CAPABLE)) {
237
+ _context2.next = 2;
238
+ break;
239
+ }
240
+ _loggerProxy.default.logger.warn('Reachability:index#gatherReachability --> WebRTC API is not available, skipping reachability checks');
241
+ return _context2.abrupt("return", {});
242
+ case 2:
243
+ _context2.prev = 2;
236
244
  this.lastTrigger = trigger;
237
245
 
238
246
  // kick off ip version detection. We don't await it, as we don't want to waste time
239
247
  // and if it fails, that's ok we can still carry on
240
248
  // @ts-ignore
241
249
  this.webex.internal.device.ipNetworkDetector.detect(true);
242
- _context2.next = 2;
250
+ _context2.next = 3;
243
251
  return this.getClusters('startup');
244
- case 2:
252
+ case 3:
245
253
  _yield$this$getCluste = _context2.sent;
246
254
  clusters = _yield$this$getCluste.clusters;
247
255
  this.reachabilityDefer = new _common.Defer();
248
256
 
249
257
  // Perform Reachability Check
250
- _context2.next = 3;
258
+ _context2.next = 4;
251
259
  return this.performReachabilityChecks(clusters);
252
- case 3:
253
- return _context2.abrupt("return", this.reachabilityDefer.promise);
254
260
  case 4:
255
- _context2.prev = 4;
256
- _t2 = _context2["catch"](1);
261
+ return _context2.abrupt("return", this.reachabilityDefer.promise);
262
+ case 5:
263
+ _context2.prev = 5;
264
+ _t2 = _context2["catch"](2);
257
265
  _loggerProxy.default.logger.error("Reachability:index#gatherReachability --> Error:", _t2);
258
266
  return _context2.abrupt("return", {});
259
- case 5:
267
+ case 6:
260
268
  case "end":
261
269
  return _context2.stop();
262
270
  }
263
- }, _callee2, this, [[1, 4]]);
271
+ }, _callee2, this, [[2, 5]]);
264
272
  }));
265
273
  function gatherReachability(_x3) {
266
274
  return _gatherReachability.apply(this, arguments);