@webex/plugin-meetings 3.11.0-next.45 → 3.11.0-next.47

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.
@@ -178,7 +178,7 @@ var AIEnableRequest = _webexCore.WebexPlugin.extend({
178
178
  method: _constants.HTTP_VERBS.PUT
179
179
  });
180
180
  },
181
- version: "3.11.0-next.45"
181
+ version: "3.11.0-next.47"
182
182
  });
183
183
  var _default = exports.default = AIEnableRequest;
184
184
  //# sourceMappingURL=index.js.map
@@ -209,7 +209,7 @@ var Breakout = _webexCore.WebexPlugin.extend({
209
209
  sessionId: this.sessionId
210
210
  });
211
211
  },
212
- version: "3.11.0-next.45"
212
+ version: "3.11.0-next.47"
213
213
  });
214
214
  var _default = exports.default = Breakout;
215
215
  //# sourceMappingURL=breakout.js.map
@@ -1109,7 +1109,7 @@ var Breakouts = _webexCore.WebexPlugin.extend({
1109
1109
  this.trigger(_constants.BREAKOUTS.EVENTS.ASK_RETURN_TO_MAIN);
1110
1110
  }
1111
1111
  },
1112
- version: "3.11.0-next.45"
1112
+ version: "3.11.0-next.47"
1113
1113
  });
1114
1114
  var _default = exports.default = Breakouts;
1115
1115
  //# sourceMappingURL=index.js.map
@@ -372,7 +372,7 @@ var SimultaneousInterpretation = _webexCore.WebexPlugin.extend({
372
372
  throw error;
373
373
  });
374
374
  },
375
- version: "3.11.0-next.45"
375
+ version: "3.11.0-next.47"
376
376
  });
377
377
  var _default = exports.default = SimultaneousInterpretation;
378
378
  //# sourceMappingURL=index.js.map
@@ -18,7 +18,7 @@ var SILanguage = _webexCore.WebexPlugin.extend({
18
18
  languageCode: 'number',
19
19
  languageName: 'string'
20
20
  },
21
- version: "3.11.0-next.45"
21
+ version: "3.11.0-next.47"
22
22
  });
23
23
  var _default = exports.default = SILanguage;
24
24
  //# sourceMappingURL=siLanguage.js.map
@@ -7,7 +7,6 @@ _Object$defineProperty(exports, "__esModule", {
7
7
  });
8
8
  exports.MediaRequestManager = void 0;
9
9
  var _values = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/object/values"));
10
- var _stringify = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/json/stringify"));
11
10
  var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/toConsumableArray"));
12
11
  var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/classCallCheck"));
13
12
  var _createClass2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/createClass"));
@@ -39,7 +38,6 @@ var MediaRequestManager = exports.MediaRequestManager = /*#__PURE__*/function ()
39
38
  (0, _defineProperty2.default)(this, "degradationPreferences", void 0);
40
39
  (0, _defineProperty2.default)(this, "sourceUpdateListener", void 0);
41
40
  (0, _defineProperty2.default)(this, "debouncedSourceUpdateListener", void 0);
42
- (0, _defineProperty2.default)(this, "previousStreamRequests", []);
43
41
  (0, _defineProperty2.default)(this, "trimRequestsToNumOfSources", void 0);
44
42
  (0, _defineProperty2.default)(this, "numTotalSources", void 0);
45
43
  (0, _defineProperty2.default)(this, "numLiveSources", void 0);
@@ -93,36 +91,6 @@ var MediaRequestManager = exports.MediaRequestManager = /*#__PURE__*/function ()
93
91
  }
94
92
  }
95
93
 
96
- /**
97
- * Returns true if two stream requests are the same, false otherwise.
98
- *
99
- * @param {StreamRequest} streamRequestA - Stream request A for comparison.
100
- * @param {StreamRequest} streamRequestB - Stream request B for comparison.
101
- * @returns {boolean} - Whether they are equal.
102
- */
103
- // eslint-disable-next-line class-methods-use-this
104
- }, {
105
- key: "isEqual",
106
- value: function isEqual(streamRequestA, streamRequestB) {
107
- return (0, _stringify.default)(streamRequestA._toJmpStreamRequest()) === (0, _stringify.default)(streamRequestB._toJmpStreamRequest());
108
- }
109
-
110
- /**
111
- * Compares new stream requests to previous ones and determines
112
- * if they are the same.
113
- *
114
- * @param {StreamRequest[]} newRequests - Array with new requests.
115
- * @returns {boolean} - True if they are equal, false otherwise.
116
- */
117
- }, {
118
- key: "checkIsNewRequestsEqualToPrev",
119
- value: function checkIsNewRequestsEqualToPrev(newRequests) {
120
- var _this2 = this;
121
- return !(0, _lodash.isEmpty)(this.previousStreamRequests) && this.previousStreamRequests.length === newRequests.length && this.previousStreamRequests.every(function (req, idx) {
122
- return _this2.isEqual(req, newRequests[idx]);
123
- });
124
- }
125
-
126
94
  /**
127
95
  * Returns the maxPayloadBitsPerSecond per Stream
128
96
  *
@@ -163,17 +131,6 @@ var MediaRequestManager = exports.MediaRequestManager = /*#__PURE__*/function ()
163
131
  return mediaRequest.codecInfo.maxFs * maxFps / 100;
164
132
  }
165
133
 
166
- /**
167
- * Clears the previous stream requests.
168
- *
169
- * @returns {void}
170
- */
171
- }, {
172
- key: "clearPreviousRequests",
173
- value: function clearPreviousRequests() {
174
- this.previousStreamRequests = [];
175
- }
176
-
177
134
  /** Modifies the passed in clientRequests and makes sure that in total they don't ask
178
135
  * for more streams than there are available.
179
136
  *
@@ -254,7 +211,7 @@ var MediaRequestManager = exports.MediaRequestManager = /*#__PURE__*/function ()
254
211
  }, {
255
212
  key: "sendRequests",
256
213
  value: function sendRequests() {
257
- var _this3 = this;
214
+ var _this2 = this;
258
215
  var streamRequests = [];
259
216
 
260
217
  // clone the requests so that any modifications we do to them don't affect the original ones
@@ -267,24 +224,16 @@ var MediaRequestManager = exports.MediaRequestManager = /*#__PURE__*/function ()
267
224
  if (mr.receiveSlots.length > 0) {
268
225
  streamRequests.push(new _internalMediaCore.StreamRequest(mr.policyInfo.policy === 'active-speaker' ? _internalMediaCore.Policy.ActiveSpeaker : _internalMediaCore.Policy.ReceiverSelected, mr.policyInfo.policy === 'active-speaker' ? new _internalMediaCore.ActiveSpeakerInfo(mr.policyInfo.priority, mr.policyInfo.crossPriorityDuplication, mr.policyInfo.crossPolicyDuplication, mr.policyInfo.preferLiveVideo, mr.policyInfo.namedMediaGroups) : new _internalMediaCore.ReceiverSelectedInfo(mr.policyInfo.csi), mr.receiveSlots.map(function (receiveSlot) {
269
226
  return receiveSlot.wcmeReceiveSlot;
270
- }), _this3.getMaxPayloadBitsPerSecond(mr), mr.codecInfo && [_internalMediaCore.CodecInfo.fromH264(0x80, new _internalMediaCore.H264Codec(mr.codecInfo.maxFs, mr.codecInfo.maxFps || CODEC_DEFAULTS.h264.maxFps, _this3.getH264MaxMbps(mr), mr.codecInfo.maxWidth, mr.codecInfo.maxHeight))]));
227
+ }), _this2.getMaxPayloadBitsPerSecond(mr), mr.codecInfo && [_internalMediaCore.CodecInfo.fromH264(0x80, new _internalMediaCore.H264Codec(mr.codecInfo.maxFs, mr.codecInfo.maxFps || CODEC_DEFAULTS.h264.maxFps, _this2.getH264MaxMbps(mr), mr.codecInfo.maxWidth, mr.codecInfo.maxHeight))]));
271
228
  }
272
229
  });
273
-
274
- //! IMPORTANT: this is only a temporary fix. This will soon be done in the jmp layer (@webex/json-multistream)
275
- // https://jira-eng-gpk2.cisco.com/jira/browse/WEBEX-326713
276
- if (!this.checkIsNewRequestsEqualToPrev(streamRequests)) {
277
- this.sendMediaRequestsCallback(streamRequests);
278
- this.previousStreamRequests = streamRequests;
279
- _loggerProxy.default.logger.info("multistream:sendRequests --> media requests sent. ");
280
- } else {
281
- _loggerProxy.default.logger.info("multistream:sendRequests --> detected duplicate WCME requests, skipping them... ");
282
- }
230
+ this.sendMediaRequestsCallback(streamRequests);
231
+ _loggerProxy.default.logger.info("multistream:sendRequests --> media requests sent. ");
283
232
  }
284
233
  }, {
285
234
  key: "addRequest",
286
235
  value: function addRequest(mediaRequest) {
287
- var _this4 = this;
236
+ var _this3 = this;
288
237
  var commit = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
289
238
  // eslint-disable-next-line no-plusplus
290
239
  var newId = "".concat(this.counter++);
@@ -292,11 +241,11 @@ var MediaRequestManager = exports.MediaRequestManager = /*#__PURE__*/function ()
292
241
  var eventHandler = function eventHandler(_ref) {
293
242
  var maxFs = _ref.maxFs;
294
243
  mediaRequest.preferredMaxFs = maxFs;
295
- _this4.debouncedSourceUpdateListener();
244
+ _this3.debouncedSourceUpdateListener();
296
245
  };
297
246
  mediaRequest.handleMaxFs = eventHandler;
298
247
  mediaRequest.receiveSlots.forEach(function (rs) {
299
- rs.on(_receiveSlot.ReceiveSlotEvents.SourceUpdate, _this4.sourceUpdateListener);
248
+ rs.on(_receiveSlot.ReceiveSlotEvents.SourceUpdate, _this3.sourceUpdateListener);
300
249
  rs.on(_receiveSlot.ReceiveSlotEvents.MaxFsUpdate, mediaRequest.handleMaxFs);
301
250
  });
302
251
  if (commit) {
@@ -307,11 +256,11 @@ var MediaRequestManager = exports.MediaRequestManager = /*#__PURE__*/function ()
307
256
  }, {
308
257
  key: "cancelRequest",
309
258
  value: function cancelRequest(requestId) {
310
- var _this5 = this;
259
+ var _this4 = this;
311
260
  var commit = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
312
261
  var mediaRequest = this.clientRequests[requestId];
313
262
  mediaRequest === null || mediaRequest === void 0 ? void 0 : mediaRequest.receiveSlots.forEach(function (rs) {
314
- rs.off(_receiveSlot.ReceiveSlotEvents.SourceUpdate, _this5.sourceUpdateListener);
263
+ rs.off(_receiveSlot.ReceiveSlotEvents.SourceUpdate, _this4.sourceUpdateListener);
315
264
  rs.off(_receiveSlot.ReceiveSlotEvents.MaxFsUpdate, mediaRequest.handleMaxFs);
316
265
  });
317
266
  delete this.clientRequests[requestId];
@@ -1 +1 @@
1
- {"version":3,"names":["_internalMediaCore","require","_lodash","_loggerProxy","_interopRequireDefault","_receiveSlot","_remoteMedia","CODEC_DEFAULTS","h264","maxFs","maxFps","maxMbps","DEBOUNCED_SOURCE_UPDATE_TIME","MediaRequestManager","exports","sendMediaRequestsCallback","options","_classCallCheck2","default","_defineProperty2","counter","numLiveSources","numTotalSources","clientRequests","degradationPreferences","kind","trimRequestsToNumOfSources","sourceUpdateListener","commit","bind","debouncedSourceUpdateListener","debounce","_createClass2","key","value","setDegradationPreferences","sendRequests","getDegradedClientRequests","_this","maxFsLimits","MAX_FS_VALUES","_loop","i","totalMacroblocksRequested","_values","forEach","mr","codecInfo","Math","min","preferredMaxFs","slotsWithLiveSource","receiveSlots","filter","rs","sourceState","length","maxMacroblocksLimit","LoggerProxy","logger","warn","concat","isEqual","streamRequestA","streamRequestB","_stringify","_toJmpStreamRequest","checkIsNewRequestsEqualToPrev","newRequests","_this2","isEmpty","previousStreamRequests","every","req","idx","getMaxPayloadBitsPerSecond","mediaRequest","RecommendedOpusBitrates","FB_MONO_MUSIC","getRecommendedMaxBitrateForFrameSize","getH264MaxMbps","clearPreviousRequests","trimRequests","preferLiveVideo","getPreferLiveVideo","undefined","numStreamsAvailable","sort","a","b","policyInfo","policy","priority","request","trimmedCount","Error","cloneClientRequests","cloneDeepWith","_toConsumableArray2","_this3","streamRequests","push","StreamRequest","Policy","ActiveSpeaker","ReceiverSelected","ActiveSpeakerInfo","crossPriorityDuplication","crossPolicyDuplication","namedMediaGroups","ReceiverSelectedInfo","csi","map","receiveSlot","wcmeReceiveSlot","WcmeCodecInfo","fromH264","H264Codec","maxWidth","maxHeight","info","addRequest","_this4","arguments","newId","eventHandler","_ref","handleMaxFs","on","ReceiveSlotEvents","SourceUpdate","MaxFsUpdate","cancelRequest","requestId","_this5","off","reset","setNumCurrentSources"],"sources":["mediaRequestManager.ts"],"sourcesContent":["/* eslint-disable require-jsdoc */\nimport {\n StreamRequest,\n Policy,\n ActiveSpeakerInfo,\n ReceiverSelectedInfo,\n CodecInfo as WcmeCodecInfo,\n H264Codec,\n getRecommendedMaxBitrateForFrameSize,\n RecommendedOpusBitrates,\n NamedMediaGroup,\n} from '@webex/internal-media-core';\nimport {cloneDeepWith, debounce, isEmpty} from 'lodash';\n\nimport LoggerProxy from '../common/logs/logger-proxy';\n\nimport {ReceiveSlot, ReceiveSlotEvents} from './receiveSlot';\nimport {MAX_FS_VALUES} from './remoteMedia';\n\nexport interface ActiveSpeakerPolicyInfo {\n policy: 'active-speaker';\n priority: number;\n crossPriorityDuplication: boolean;\n crossPolicyDuplication: boolean;\n preferLiveVideo: boolean;\n namedMediaGroups?: NamedMediaGroup[];\n}\n\nexport interface ReceiverSelectedPolicyInfo {\n policy: 'receiver-selected';\n csi: number;\n}\n\nexport type PolicyInfo = ActiveSpeakerPolicyInfo | ReceiverSelectedPolicyInfo;\n\nexport interface H264CodecInfo {\n codec: 'h264';\n maxFs?: number;\n maxFps?: number;\n maxMbps?: number;\n maxWidth?: number;\n maxHeight?: number;\n}\n\nexport type CodecInfo = H264CodecInfo; // we'll add AV1 here in the future when it's available\n\nexport interface MediaRequest {\n policyInfo: PolicyInfo;\n receiveSlots: Array<ReceiveSlot>;\n codecInfo?: CodecInfo;\n preferredMaxFs?: number;\n handleMaxFs?: ({maxFs}: {maxFs: number}) => void;\n}\n\nexport type MediaRequestId = string;\n\nconst CODEC_DEFAULTS = {\n h264: {\n maxFs: 8192,\n maxFps: 3000,\n maxMbps: 245760,\n },\n};\n\nconst DEBOUNCED_SOURCE_UPDATE_TIME = 1000;\n\ntype DegradationPreferences = {\n maxMacroblocksLimit: number;\n};\n\ntype SendMediaRequestsCallback = (streamRequests: StreamRequest[]) => void;\ntype Kind = 'audio' | 'video';\n\ntype Options = {\n degradationPreferences: DegradationPreferences;\n kind: Kind;\n trimRequestsToNumOfSources: boolean; // if enabled, AS speaker requests will be trimmed based on the calls to setNumCurrentSources()\n};\n\ntype ClientRequestsMap = {[key: MediaRequestId]: MediaRequest};\n\nexport class MediaRequestManager {\n private sendMediaRequestsCallback: SendMediaRequestsCallback;\n\n private kind: Kind;\n\n private counter: number;\n\n private clientRequests: ClientRequestsMap;\n\n private degradationPreferences: DegradationPreferences;\n\n private sourceUpdateListener: () => void;\n\n private debouncedSourceUpdateListener: () => void;\n\n private previousStreamRequests: Array<StreamRequest> = [];\n\n private trimRequestsToNumOfSources: boolean;\n private numTotalSources: number;\n private numLiveSources: number;\n\n constructor(sendMediaRequestsCallback: SendMediaRequestsCallback, options: Options) {\n this.sendMediaRequestsCallback = sendMediaRequestsCallback;\n this.counter = 0;\n this.numLiveSources = 0;\n this.numTotalSources = 0;\n this.clientRequests = {};\n this.degradationPreferences = options.degradationPreferences;\n this.kind = options.kind;\n this.trimRequestsToNumOfSources = options.trimRequestsToNumOfSources;\n this.sourceUpdateListener = this.commit.bind(this);\n this.debouncedSourceUpdateListener = debounce(\n this.sourceUpdateListener,\n DEBOUNCED_SOURCE_UPDATE_TIME\n );\n }\n\n public setDegradationPreferences(degradationPreferences: DegradationPreferences) {\n this.degradationPreferences = degradationPreferences;\n this.sendRequests(); // re-send requests after preferences are set\n }\n\n private getDegradedClientRequests(clientRequests: ClientRequestsMap) {\n const maxFsLimits = [\n MAX_FS_VALUES['1080p'],\n MAX_FS_VALUES['720p'],\n MAX_FS_VALUES['540p'],\n MAX_FS_VALUES['360p'],\n MAX_FS_VALUES['180p'],\n MAX_FS_VALUES['90p'],\n ];\n\n // reduce max-fs until total macroblocks is below limit\n for (let i = 0; i < maxFsLimits.length; i += 1) {\n let totalMacroblocksRequested = 0;\n Object.values(clientRequests).forEach((mr) => {\n if (mr.codecInfo) {\n mr.codecInfo.maxFs = Math.min(\n mr.preferredMaxFs || CODEC_DEFAULTS.h264.maxFs,\n mr.codecInfo.maxFs || CODEC_DEFAULTS.h264.maxFs,\n maxFsLimits[i]\n );\n // we only consider sources with \"live\" state\n const slotsWithLiveSource = mr.receiveSlots.filter((rs) => rs.sourceState === 'live');\n totalMacroblocksRequested += mr.codecInfo.maxFs * slotsWithLiveSource.length;\n }\n });\n if (totalMacroblocksRequested <= this.degradationPreferences.maxMacroblocksLimit) {\n if (i !== 0) {\n LoggerProxy.logger.warn(\n `multistream:mediaRequestManager --> too many streams with high max-fs, frame size will be limited to ${maxFsLimits[i]}`\n );\n }\n break;\n } else if (i === maxFsLimits.length - 1) {\n LoggerProxy.logger.warn(\n `multistream:mediaRequestManager --> even with frame size limited to ${maxFsLimits[i]} you are still requesting too many streams, consider reducing the number of requests`\n );\n }\n }\n }\n\n /**\n * Returns true if two stream requests are the same, false otherwise.\n *\n * @param {StreamRequest} streamRequestA - Stream request A for comparison.\n * @param {StreamRequest} streamRequestB - Stream request B for comparison.\n * @returns {boolean} - Whether they are equal.\n */\n // eslint-disable-next-line class-methods-use-this\n public isEqual(streamRequestA: StreamRequest, streamRequestB: StreamRequest) {\n return (\n JSON.stringify(streamRequestA._toJmpStreamRequest()) ===\n JSON.stringify(streamRequestB._toJmpStreamRequest())\n );\n }\n\n /**\n * Compares new stream requests to previous ones and determines\n * if they are the same.\n *\n * @param {StreamRequest[]} newRequests - Array with new requests.\n * @returns {boolean} - True if they are equal, false otherwise.\n */\n private checkIsNewRequestsEqualToPrev(newRequests: StreamRequest[]) {\n return (\n !isEmpty(this.previousStreamRequests) &&\n this.previousStreamRequests.length === newRequests.length &&\n this.previousStreamRequests.every((req, idx) => this.isEqual(req, newRequests[idx]))\n );\n }\n\n /**\n * Returns the maxPayloadBitsPerSecond per Stream\n *\n * If MediaRequestManager kind is \"audio\", a constant bitrate will be returned.\n * If MediaRequestManager kind is \"video\", the bitrate will be calculated based\n * on maxFs (default h264 maxFs as fallback if maxFs is not defined)\n *\n * @param {MediaRequest} mediaRequest - mediaRequest to take data from\n * @returns {number} maxPayloadBitsPerSecond\n */\n private getMaxPayloadBitsPerSecond(mediaRequest: MediaRequest): number {\n if (this.kind === 'audio') {\n // return mono_music bitrate default if the kind of mediarequest manager is audio:\n return RecommendedOpusBitrates.FB_MONO_MUSIC;\n }\n\n return getRecommendedMaxBitrateForFrameSize(\n mediaRequest.codecInfo.maxFs || CODEC_DEFAULTS.h264.maxFs\n );\n }\n\n /**\n * Returns the max Macro Blocks per second (maxMbps) per H264 Stream\n *\n * The maxMbps will be calculated based on maxFs and maxFps\n * (default h264 maxFps as fallback if maxFps is not defined)\n *\n * @param {MediaRequest} mediaRequest - mediaRequest to take data from\n * @returns {number} maxMbps\n */\n // eslint-disable-next-line class-methods-use-this\n private getH264MaxMbps(mediaRequest: MediaRequest): number {\n // fallback for maxFps (not needed for maxFs, since there is a fallback already in getDegradedClientRequests)\n const maxFps = mediaRequest.codecInfo.maxFps || CODEC_DEFAULTS.h264.maxFps;\n\n // divided by 100 since maxFps is 3000 (for 30 frames per seconds)\n return (mediaRequest.codecInfo.maxFs * maxFps) / 100;\n }\n\n /**\n * Clears the previous stream requests.\n *\n * @returns {void}\n */\n public clearPreviousRequests(): void {\n this.previousStreamRequests = [];\n }\n\n /** Modifies the passed in clientRequests and makes sure that in total they don't ask\n * for more streams than there are available.\n *\n * @param {Object} clientRequests\n * @returns {void}\n */\n private trimRequests(clientRequests: ClientRequestsMap) {\n const preferLiveVideo = this.getPreferLiveVideo();\n\n if (!this.trimRequestsToNumOfSources) {\n return;\n }\n\n // preferLiveVideo being undefined means that there are no active-speaker requests so we don't need to do any trimming\n if (preferLiveVideo === undefined) {\n return;\n }\n\n let numStreamsAvailable = preferLiveVideo ? this.numLiveSources : this.numTotalSources;\n\n Object.values(clientRequests)\n .sort((a, b) => {\n // we have to count how many streams we're asking for\n // and should not ask for more than numStreamsAvailable in total,\n // so we might need to trim active-speaker requests and first ones to trim should be\n // the ones with lowest priority\n\n // receiver-selected requests have priority over active-speakers\n if (a.policyInfo.policy === 'receiver-selected') {\n return -1;\n }\n if (b.policyInfo.policy === 'receiver-selected') {\n return 1;\n }\n\n // and active-speakers are sorted by descending priority\n return b.policyInfo.priority - a.policyInfo.priority;\n })\n .forEach((request) => {\n // we only trim active-speaker requests\n if (request.policyInfo.policy === 'active-speaker') {\n const trimmedCount = Math.min(numStreamsAvailable, request.receiveSlots.length);\n\n request.receiveSlots.length = trimmedCount;\n\n numStreamsAvailable -= trimmedCount;\n } else {\n numStreamsAvailable -= request.receiveSlots.length;\n }\n\n if (numStreamsAvailable < 0) {\n numStreamsAvailable = 0;\n }\n });\n }\n\n private getPreferLiveVideo(): boolean | undefined {\n let preferLiveVideo;\n\n Object.values(this.clientRequests).forEach((mr) => {\n if (mr.policyInfo.policy === 'active-speaker') {\n // take the value from first encountered active speaker request\n if (preferLiveVideo === undefined) {\n preferLiveVideo = mr.policyInfo.preferLiveVideo;\n }\n\n if (mr.policyInfo.preferLiveVideo !== preferLiveVideo) {\n throw new Error(\n 'a mix of active-speaker groups with different values for preferLiveVideo is not supported'\n );\n }\n }\n });\n\n return preferLiveVideo;\n }\n\n private cloneClientRequests(): ClientRequestsMap {\n // we clone the client requests but without cloning the ReceiveSlots that they reference\n return cloneDeepWith(this.clientRequests, (value, key) => {\n if (key === 'receiveSlots') {\n return [...value];\n }\n\n return undefined;\n });\n }\n\n private sendRequests() {\n const streamRequests: StreamRequest[] = [];\n\n // clone the requests so that any modifications we do to them don't affect the original ones\n const clientRequests = this.cloneClientRequests();\n\n this.trimRequests(clientRequests);\n this.getDegradedClientRequests(clientRequests);\n\n // map all the client media requests to wcme stream requests\n Object.values(clientRequests).forEach((mr) => {\n if (mr.receiveSlots.length > 0) {\n streamRequests.push(\n new StreamRequest(\n mr.policyInfo.policy === 'active-speaker'\n ? Policy.ActiveSpeaker\n : Policy.ReceiverSelected,\n mr.policyInfo.policy === 'active-speaker'\n ? new ActiveSpeakerInfo(\n mr.policyInfo.priority,\n mr.policyInfo.crossPriorityDuplication,\n mr.policyInfo.crossPolicyDuplication,\n mr.policyInfo.preferLiveVideo,\n mr.policyInfo.namedMediaGroups\n )\n : new ReceiverSelectedInfo(mr.policyInfo.csi),\n mr.receiveSlots.map((receiveSlot) => receiveSlot.wcmeReceiveSlot),\n this.getMaxPayloadBitsPerSecond(mr),\n mr.codecInfo && [\n WcmeCodecInfo.fromH264(\n 0x80,\n new H264Codec(\n mr.codecInfo.maxFs,\n mr.codecInfo.maxFps || CODEC_DEFAULTS.h264.maxFps,\n this.getH264MaxMbps(mr),\n mr.codecInfo.maxWidth,\n mr.codecInfo.maxHeight\n )\n ),\n ]\n )\n );\n }\n });\n\n //! IMPORTANT: this is only a temporary fix. This will soon be done in the jmp layer (@webex/json-multistream)\n // https://jira-eng-gpk2.cisco.com/jira/browse/WEBEX-326713\n if (!this.checkIsNewRequestsEqualToPrev(streamRequests)) {\n this.sendMediaRequestsCallback(streamRequests);\n this.previousStreamRequests = streamRequests;\n LoggerProxy.logger.info(`multistream:sendRequests --> media requests sent. `);\n } else {\n LoggerProxy.logger.info(\n `multistream:sendRequests --> detected duplicate WCME requests, skipping them... `\n );\n }\n }\n\n public addRequest(mediaRequest: MediaRequest, commit = true): MediaRequestId {\n // eslint-disable-next-line no-plusplus\n const newId = `${this.counter++}`;\n\n this.clientRequests[newId] = mediaRequest;\n\n const eventHandler = ({maxFs}) => {\n mediaRequest.preferredMaxFs = maxFs;\n this.debouncedSourceUpdateListener();\n };\n mediaRequest.handleMaxFs = eventHandler;\n\n mediaRequest.receiveSlots.forEach((rs) => {\n rs.on(ReceiveSlotEvents.SourceUpdate, this.sourceUpdateListener);\n rs.on(ReceiveSlotEvents.MaxFsUpdate, mediaRequest.handleMaxFs);\n });\n\n if (commit) {\n this.commit();\n }\n\n return newId;\n }\n\n public cancelRequest(requestId: MediaRequestId, commit = true) {\n const mediaRequest = this.clientRequests[requestId];\n\n mediaRequest?.receiveSlots.forEach((rs) => {\n rs.off(ReceiveSlotEvents.SourceUpdate, this.sourceUpdateListener);\n rs.off(ReceiveSlotEvents.MaxFsUpdate, mediaRequest.handleMaxFs);\n });\n\n delete this.clientRequests[requestId];\n\n if (commit) {\n this.commit();\n }\n }\n\n public commit() {\n return this.sendRequests();\n }\n\n public reset() {\n this.clientRequests = {};\n this.numTotalSources = 0;\n this.numLiveSources = 0;\n }\n\n public setNumCurrentSources(numTotalSources: number, numLiveSources: number) {\n this.numTotalSources = numTotalSources;\n this.numLiveSources = numLiveSources;\n\n this.sendRequests();\n }\n}\n"],"mappings":";;;;;;;;;;;;;;AACA,IAAAA,kBAAA,GAAAC,OAAA;AAWA,IAAAC,OAAA,GAAAD,OAAA;AAEA,IAAAE,YAAA,GAAAC,sBAAA,CAAAH,OAAA;AAEA,IAAAI,YAAA,GAAAJ,OAAA;AACA,IAAAK,YAAA,GAAAL,OAA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oB,CAAC;QACjE2B,EAAE,CAACiF,GAAG,CAACN,8BAAiB,CAACE,WAAW,EAAEvD,YAAY,CAACmD,WAAW,CAAC;MACjE,CAAC,CAAC;MAEF,OAAO,IAAI,CAACxG,cAAc,CAAC8G,SAAS,CAAC;MAErC,IAAIzG,MAAM,EAAE;QACV,IAAI,CAACA,MAAM,CAAC,CAAC;MACf;IACF;EAAC;IAAAK,GAAA;IAAAC,KAAA,EAED,SAAON,MAAMA,CAAA,EAAG;MACd,OAAO,IAAI,CAACQ,YAAY,CAAC,CAAC;IAC5B;EAAC;IAAAH,GAAA;IAAAC,KAAA,EAED,SAAOsG,KAAKA,CAAA,EAAG;MACb,IAAI,CAACjH,cAAc,GAAG,CAAC,CAAC;MACxB,IAAI,CAACD,eAAe,GAAG,CAAC;MACxB,IAAI,CAACD,cAAc,GAAG,CAAC;IACzB;EAAC;IAAAY,GAAA;IAAAC,KAAA,EAED,SAAOuG,oBAAoBA,CAACnH,eAAuB,EAAED,cAAsB,EAAE;MAC3E,IAAI,CAACC,eAAe,GAAGA,eAAe;MACtC,IAAI,CAACD,cAAc,GAAGA,cAAc;MAEpC,IAAI,CAACe,YAAY,CAAC,CAAC;IACrB;EAAC;AAAA","ignoreList":[]}
1
+ {"version":3,"names":["_internalMediaCore","require","_lodash","_loggerProxy","_interopRequireDefault","_receiveSlot","_remoteMedia","CODEC_DEFAULTS","h264","maxFs","maxFps","maxMbps","DEBOUNCED_SOURCE_UPDATE_TIME","MediaRequestManager","exports","sendMediaRequestsCallback","options","_classCallCheck2","default","_defineProperty2","counter","numLiveSources","numTotalSources","clientRequests","degradationPreferences","kind","trimRequestsToNumOfSources","sourceUpdateListener","commit","bind","debouncedSourceUpdateListener","debounce","_createClass2","key","value","setDegradationPreferences","sendRequests","getDegradedClientRequests","_this","maxFsLimits","MAX_FS_VALUES","_loop","i","totalMacroblocksRequested","_values","forEach","mr","codecInfo","Math","min","preferredMaxFs","slotsWithLiveSource","receiveSlots","filter","rs","sourceState","length","maxMacroblocksLimit","LoggerProxy","logger","warn","concat","getMaxPayloadBitsPerSecond","mediaRequest","RecommendedOpusBitrates","FB_MONO_MUSIC","getRecommendedMaxBitrateForFrameSize","getH264MaxMbps","trimRequests","preferLiveVideo","getPreferLiveVideo","undefined","numStreamsAvailable","sort","a","b","policyInfo","policy","priority","request","trimmedCount","Error","cloneClientRequests","cloneDeepWith","_toConsumableArray2","_this2","streamRequests","push","StreamRequest","Policy","ActiveSpeaker","ReceiverSelected","ActiveSpeakerInfo","crossPriorityDuplication","crossPolicyDuplication","namedMediaGroups","ReceiverSelectedInfo","csi","map","receiveSlot","wcmeReceiveSlot","WcmeCodecInfo","fromH264","H264Codec","maxWidth","maxHeight","info","addRequest","_this3","arguments","newId","eventHandler","_ref","handleMaxFs","on","ReceiveSlotEvents","SourceUpdate","MaxFsUpdate","cancelRequest","requestId","_this4","off","reset","setNumCurrentSources"],"sources":["mediaRequestManager.ts"],"sourcesContent":["/* eslint-disable require-jsdoc */\nimport {\n StreamRequest,\n Policy,\n ActiveSpeakerInfo,\n ReceiverSelectedInfo,\n CodecInfo as WcmeCodecInfo,\n H264Codec,\n getRecommendedMaxBitrateForFrameSize,\n RecommendedOpusBitrates,\n NamedMediaGroup,\n} from '@webex/internal-media-core';\nimport {cloneDeepWith, debounce} from 'lodash';\n\nimport LoggerProxy from '../common/logs/logger-proxy';\n\nimport {ReceiveSlot, ReceiveSlotEvents} from './receiveSlot';\nimport {MAX_FS_VALUES} from './remoteMedia';\n\nexport interface ActiveSpeakerPolicyInfo {\n policy: 'active-speaker';\n priority: number;\n crossPriorityDuplication: boolean;\n crossPolicyDuplication: boolean;\n preferLiveVideo: boolean;\n namedMediaGroups?: NamedMediaGroup[];\n}\n\nexport interface ReceiverSelectedPolicyInfo {\n policy: 'receiver-selected';\n csi: number;\n}\n\nexport type PolicyInfo = ActiveSpeakerPolicyInfo | ReceiverSelectedPolicyInfo;\n\nexport interface H264CodecInfo {\n codec: 'h264';\n maxFs?: number;\n maxFps?: number;\n maxMbps?: number;\n maxWidth?: number;\n maxHeight?: number;\n}\n\nexport type CodecInfo = H264CodecInfo; // we'll add AV1 here in the future when it's available\n\nexport interface MediaRequest {\n policyInfo: PolicyInfo;\n receiveSlots: Array<ReceiveSlot>;\n codecInfo?: CodecInfo;\n preferredMaxFs?: number;\n handleMaxFs?: ({maxFs}: {maxFs: number}) => void;\n}\n\nexport type MediaRequestId = string;\n\nconst CODEC_DEFAULTS = {\n h264: {\n maxFs: 8192,\n maxFps: 3000,\n maxMbps: 245760,\n },\n};\n\nconst DEBOUNCED_SOURCE_UPDATE_TIME = 1000;\n\ntype DegradationPreferences = {\n maxMacroblocksLimit: number;\n};\n\ntype SendMediaRequestsCallback = (streamRequests: StreamRequest[]) => void;\ntype Kind = 'audio' | 'video';\n\ntype Options = {\n degradationPreferences: DegradationPreferences;\n kind: Kind;\n trimRequestsToNumOfSources: boolean; // if enabled, AS speaker requests will be trimmed based on the calls to setNumCurrentSources()\n};\n\ntype ClientRequestsMap = {[key: MediaRequestId]: MediaRequest};\n\nexport class MediaRequestManager {\n private sendMediaRequestsCallback: SendMediaRequestsCallback;\n\n private kind: Kind;\n\n private counter: number;\n\n private clientRequests: ClientRequestsMap;\n\n private degradationPreferences: DegradationPreferences;\n\n private sourceUpdateListener: () => void;\n\n private debouncedSourceUpdateListener: () => void;\n\n private trimRequestsToNumOfSources: boolean;\n private numTotalSources: number;\n private numLiveSources: number;\n\n constructor(sendMediaRequestsCallback: SendMediaRequestsCallback, options: Options) {\n this.sendMediaRequestsCallback = sendMediaRequestsCallback;\n this.counter = 0;\n this.numLiveSources = 0;\n this.numTotalSources = 0;\n this.clientRequests = {};\n this.degradationPreferences = options.degradationPreferences;\n this.kind = options.kind;\n this.trimRequestsToNumOfSources = options.trimRequestsToNumOfSources;\n this.sourceUpdateListener = this.commit.bind(this);\n this.debouncedSourceUpdateListener = debounce(\n this.sourceUpdateListener,\n DEBOUNCED_SOURCE_UPDATE_TIME\n );\n }\n\n public setDegradationPreferences(degradationPreferences: DegradationPreferences) {\n this.degradationPreferences = degradationPreferences;\n this.sendRequests(); // re-send requests after preferences are set\n }\n\n private getDegradedClientRequests(clientRequests: ClientRequestsMap) {\n const maxFsLimits = [\n MAX_FS_VALUES['1080p'],\n MAX_FS_VALUES['720p'],\n MAX_FS_VALUES['540p'],\n MAX_FS_VALUES['360p'],\n MAX_FS_VALUES['180p'],\n MAX_FS_VALUES['90p'],\n ];\n\n // reduce max-fs until total macroblocks is below limit\n for (let i = 0; i < maxFsLimits.length; i += 1) {\n let totalMacroblocksRequested = 0;\n Object.values(clientRequests).forEach((mr) => {\n if (mr.codecInfo) {\n mr.codecInfo.maxFs = Math.min(\n mr.preferredMaxFs || CODEC_DEFAULTS.h264.maxFs,\n mr.codecInfo.maxFs || CODEC_DEFAULTS.h264.maxFs,\n maxFsLimits[i]\n );\n // we only consider sources with \"live\" state\n const slotsWithLiveSource = mr.receiveSlots.filter((rs) => rs.sourceState === 'live');\n totalMacroblocksRequested += mr.codecInfo.maxFs * slotsWithLiveSource.length;\n }\n });\n if (totalMacroblocksRequested <= this.degradationPreferences.maxMacroblocksLimit) {\n if (i !== 0) {\n LoggerProxy.logger.warn(\n `multistream:mediaRequestManager --> too many streams with high max-fs, frame size will be limited to ${maxFsLimits[i]}`\n );\n }\n break;\n } else if (i === maxFsLimits.length - 1) {\n LoggerProxy.logger.warn(\n `multistream:mediaRequestManager --> even with frame size limited to ${maxFsLimits[i]} you are still requesting too many streams, consider reducing the number of requests`\n );\n }\n }\n }\n\n /**\n * Returns the maxPayloadBitsPerSecond per Stream\n *\n * If MediaRequestManager kind is \"audio\", a constant bitrate will be returned.\n * If MediaRequestManager kind is \"video\", the bitrate will be calculated based\n * on maxFs (default h264 maxFs as fallback if maxFs is not defined)\n *\n * @param {MediaRequest} mediaRequest - mediaRequest to take data from\n * @returns {number} maxPayloadBitsPerSecond\n */\n private getMaxPayloadBitsPerSecond(mediaRequest: MediaRequest): number {\n if (this.kind === 'audio') {\n // return mono_music bitrate default if the kind of mediarequest manager is audio:\n return RecommendedOpusBitrates.FB_MONO_MUSIC;\n }\n\n return getRecommendedMaxBitrateForFrameSize(\n mediaRequest.codecInfo.maxFs || CODEC_DEFAULTS.h264.maxFs\n );\n }\n\n /**\n * Returns the max Macro Blocks per second (maxMbps) per H264 Stream\n *\n * The maxMbps will be calculated based on maxFs and maxFps\n * (default h264 maxFps as fallback if maxFps is not defined)\n *\n * @param {MediaRequest} mediaRequest - mediaRequest to take data from\n * @returns {number} maxMbps\n */\n // eslint-disable-next-line class-methods-use-this\n private getH264MaxMbps(mediaRequest: MediaRequest): number {\n // fallback for maxFps (not needed for maxFs, since there is a fallback already in getDegradedClientRequests)\n const maxFps = mediaRequest.codecInfo.maxFps || CODEC_DEFAULTS.h264.maxFps;\n\n // divided by 100 since maxFps is 3000 (for 30 frames per seconds)\n return (mediaRequest.codecInfo.maxFs * maxFps) / 100;\n }\n\n /** Modifies the passed in clientRequests and makes sure that in total they don't ask\n * for more streams than there are available.\n *\n * @param {Object} clientRequests\n * @returns {void}\n */\n private trimRequests(clientRequests: ClientRequestsMap) {\n const preferLiveVideo = this.getPreferLiveVideo();\n\n if (!this.trimRequestsToNumOfSources) {\n return;\n }\n\n // preferLiveVideo being undefined means that there are no active-speaker requests so we don't need to do any trimming\n if (preferLiveVideo === undefined) {\n return;\n }\n\n let numStreamsAvailable = preferLiveVideo ? this.numLiveSources : this.numTotalSources;\n\n Object.values(clientRequests)\n .sort((a, b) => {\n // we have to count how many streams we're asking for\n // and should not ask for more than numStreamsAvailable in total,\n // so we might need to trim active-speaker requests and first ones to trim should be\n // the ones with lowest priority\n\n // receiver-selected requests have priority over active-speakers\n if (a.policyInfo.policy === 'receiver-selected') {\n return -1;\n }\n if (b.policyInfo.policy === 'receiver-selected') {\n return 1;\n }\n\n // and active-speakers are sorted by descending priority\n return b.policyInfo.priority - a.policyInfo.priority;\n })\n .forEach((request) => {\n // we only trim active-speaker requests\n if (request.policyInfo.policy === 'active-speaker') {\n const trimmedCount = Math.min(numStreamsAvailable, request.receiveSlots.length);\n\n request.receiveSlots.length = trimmedCount;\n\n numStreamsAvailable -= trimmedCount;\n } else {\n numStreamsAvailable -= request.receiveSlots.length;\n }\n\n if (numStreamsAvailable < 0) {\n numStreamsAvailable = 0;\n }\n });\n }\n\n private getPreferLiveVideo(): boolean | undefined {\n let preferLiveVideo;\n\n Object.values(this.clientRequests).forEach((mr) => {\n if (mr.policyInfo.policy === 'active-speaker') {\n // take the value from first encountered active speaker request\n if (preferLiveVideo === undefined) {\n preferLiveVideo = mr.policyInfo.preferLiveVideo;\n }\n\n if (mr.policyInfo.preferLiveVideo !== preferLiveVideo) {\n throw new Error(\n 'a mix of active-speaker groups with different values for preferLiveVideo is not supported'\n );\n }\n }\n });\n\n return preferLiveVideo;\n }\n\n private cloneClientRequests(): ClientRequestsMap {\n // we clone the client requests but without cloning the ReceiveSlots that they reference\n return cloneDeepWith(this.clientRequests, (value, key) => {\n if (key === 'receiveSlots') {\n return [...value];\n }\n\n return undefined;\n });\n }\n\n private sendRequests() {\n const streamRequests: StreamRequest[] = [];\n\n // clone the requests so that any modifications we do to them don't affect the original ones\n const clientRequests = this.cloneClientRequests();\n\n this.trimRequests(clientRequests);\n this.getDegradedClientRequests(clientRequests);\n\n // map all the client media requests to wcme stream requests\n Object.values(clientRequests).forEach((mr) => {\n if (mr.receiveSlots.length > 0) {\n streamRequests.push(\n new StreamRequest(\n mr.policyInfo.policy === 'active-speaker'\n ? Policy.ActiveSpeaker\n : Policy.ReceiverSelected,\n mr.policyInfo.policy === 'active-speaker'\n ? new ActiveSpeakerInfo(\n mr.policyInfo.priority,\n mr.policyInfo.crossPriorityDuplication,\n mr.policyInfo.crossPolicyDuplication,\n mr.policyInfo.preferLiveVideo,\n mr.policyInfo.namedMediaGroups\n )\n : new ReceiverSelectedInfo(mr.policyInfo.csi),\n mr.receiveSlots.map((receiveSlot) => receiveSlot.wcmeReceiveSlot),\n this.getMaxPayloadBitsPerSecond(mr),\n mr.codecInfo && [\n WcmeCodecInfo.fromH264(\n 0x80,\n new H264Codec(\n mr.codecInfo.maxFs,\n mr.codecInfo.maxFps || CODEC_DEFAULTS.h264.maxFps,\n this.getH264MaxMbps(mr),\n mr.codecInfo.maxWidth,\n mr.codecInfo.maxHeight\n )\n ),\n ]\n )\n );\n }\n });\n\n this.sendMediaRequestsCallback(streamRequests);\n LoggerProxy.logger.info(`multistream:sendRequests --> media requests sent. `);\n }\n\n public addRequest(mediaRequest: MediaRequest, commit = true): MediaRequestId {\n // eslint-disable-next-line no-plusplus\n const newId = `${this.counter++}`;\n\n this.clientRequests[newId] = mediaRequest;\n\n const eventHandler = ({maxFs}) => {\n mediaRequest.preferredMaxFs = maxFs;\n this.debouncedSourceUpdateListener();\n };\n mediaRequest.handleMaxFs = eventHandler;\n\n mediaRequest.receiveSlots.forEach((rs) => {\n rs.on(ReceiveSlotEvents.SourceUpdate, this.sourceUpdateListener);\n rs.on(ReceiveSlotEvents.MaxFsUpdate, mediaRequest.handleMaxFs);\n });\n\n if (commit) {\n this.commit();\n }\n\n return newId;\n }\n\n public cancelRequest(requestId: MediaRequestId, commit = true) {\n const mediaRequest = this.clientRequests[requestId];\n\n mediaRequest?.receiveSlots.forEach((rs) => {\n rs.off(ReceiveSlotEvents.SourceUpdate, this.sourceUpdateListener);\n rs.off(ReceiveSlotEvents.MaxFsUpdate, mediaRequest.handleMaxFs);\n });\n\n delete this.clientRequests[requestId];\n\n if (commit) {\n this.commit();\n }\n }\n\n public commit() {\n return this.sendRequests();\n }\n\n public reset() {\n this.clientRequests = {};\n this.numTotalSources = 0;\n this.numLiveSources = 0;\n }\n\n public setNumCurrentSources(numTotalSources: number, numLiveSources: number) {\n this.numTotalSources = numTotalSources;\n this.numLiveSources = numLiveSources;\n\n this.sendRequests();\n }\n}\n"],"mappings":";;;;;;;;;;;;;AACA,IAAAA,kBAAA,GAAAC,OAAA;AAWA,IAAAC,OAAA,GAAAD,OAAA;A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AAG,IAAI,CAACxC,cAAc,CAACgG,SAAS,CAAC;MAEnDxD,YAAY,aAAZA,YAAY,uBAAZA,YAAY,CAAEX,YAAY,CAACP,OAAO,CAAC,UAACS,EAAE,EAAK;QACzCA,EAAE,CAACmE,GAAG,CAACN,8BAAiB,CAACC,YAAY,EAAEI,MAAI,CAAC7F,oBAAoB,CAAC;QACjE2B,EAAE,CAACmE,GAAG,CAACN,8BAAiB,CAACE,WAAW,EAAEtD,YAAY,CAACkD,WAAW,CAAC;MACjE,CAAC,CAAC;MAEF,OAAO,IAAI,CAAC1F,cAAc,CAACgG,SAAS,CAAC;MAErC,IAAI3F,MAAM,EAAE;QACV,IAAI,CAACA,MAAM,CAAC,CAAC;MACf;IACF;EAAC;IAAAK,GAAA;IAAAC,KAAA,EAED,SAAON,MAAMA,CAAA,EAAG;MACd,OAAO,IAAI,CAACQ,YAAY,CAAC,CAAC;IAC5B;EAAC;IAAAH,GAAA;IAAAC,KAAA,EAED,SAAOwF,KAAKA,CAAA,EAAG;MACb,IAAI,CAACnG,cAAc,GAAG,CAAC,CAAC;MACxB,IAAI,CAACD,eAAe,GAAG,CAAC;MACxB,IAAI,CAACD,cAAc,GAAG,CAAC;IACzB;EAAC;IAAAY,GAAA;IAAAC,KAAA,EAED,SAAOyF,oBAAoBA,CAACrG,eAAuB,EAAED,cAAsB,EAAE;MAC3E,IAAI,CAACC,eAAe,GAAGA,eAAe;MACtC,IAAI,CAACD,cAAc,GAAGA,cAAc;MAEpC,IAAI,CAACe,YAAY,CAAC,CAAC;IACrB;EAAC;AAAA","ignoreList":[]}
@@ -706,7 +706,6 @@ var ReconnectionManager = exports.default = /*#__PURE__*/function () {
706
706
  // resend media requests
707
707
  if (this.meeting.isMultistream) {
708
708
  (0, _values.default)(this.meeting.mediaRequestManagers).forEach(function (mediaRequestManager) {
709
- mediaRequestManager.clearPreviousRequests();
710
709
  mediaRequestManager.commit();
711
710
  });
712
711
  }
@@ -1 +1 @@
1
- {"version":3,"names":["_loggerProxy","_interopRequireDefault","require","_triggerProxy","_constants","_constants2","_reconnection","_reconnectionNotStarted","_metrics","_callSuper","t","o","e","_getPrototypeOf2","default","_possibleConstructorReturn2","_isNativeReflectConstruct","_Reflect$construct","constructor","apply","Boolean","prototype","valueOf","call","NeedsRetryError","_Error","_classCallCheck2","arguments","_inherits2","_createClass2","_wrapNativeSuper2","Error","NeedsRejoinError","_Error2","_ref","_this","wasSharing","_ref$error","error","_defineProperty2","ReconnectionManager","exports","meeting","iceState","disconnected","resolve","timer","undefined","timeoutDuration","config","reconnection","iceReconnectionTimeout","status","RECONNECTION","STATE","DEFAULT_STATUS","webex","maxRejoinAttempts","rejoinAttempts","autoRejoinEnabled","autoRejoin","reset","key","value","resetReconnectionTimer","clearTimeout","iceReconnected","LoggerProxy","logger","log","waitForIceReconnect","_this2","_promise","reject","setTimeout","concat","cleanUp","_stopLocalShareStream","_asyncToGenerator2","_regenerator","mark","_callee","reason","wrap","_context","prev","next","unpublishStreams","mediaProperties","shareVideoStream","shareAudioStream","Trigger","trigger","file","function","EVENT_TRIGGERS","MEETING_STOPPED_SHARING_LOCAL","stop","stopLocalShareStream","_x","isReconnectInProgress","IN_PROGRESS","canStartReconnection","enabled","info","_reconnect","_callee2","_this3","_ref2","_ref2$networkDisconne","networkDisconnect","_ref2$networkRetry","networkRetry","completionCallback","triggerEvent","_args2","_t","_t2","_t3","_context2","length","id","event","payload","ReconnectionNotStartedError","MEETING_RECONNECTION_STARTING","internal","newMetrics","submitClientEvent","name","options","meetingId","meetings","startReachability","executeReconnection","reconnect","abrupt","message","errors","category","errorCode","fatal","shownToUser","rejoinMeeting","MEETING_RECONNECTION_SUCCESS","recoveredBy","MEETING_RECONNECTION_FAILURE","ReconnectionError","Metrics","sendBehavioralMetric","BEHAVIORAL_METRICS","MEETING_RECONNECT_FAILURE","correlation_id","correlationId","locus_id","locusUrl","split","pop","stack","finish","_executeReconnection","_callee3","_ref3","_ref3$networkDisconne","media","_t4","_t5","_t6","_context3","shareStatus","SHARE_STATUS","LOCAL_SHARE_ACTIVE","SHARE_STOPPED_REASON","MEDIA_RECONNECTION","reconnectMercuryWebSocket","device","url","FAILURE","syncMeetings","keepOnlyLocusMeetings","getMeetingByType","_ID_","state","_LEFT_","type","_CALL_","reconnectMedia","sent","_x2","_rejoinMeeting","_callee4","_args4","_t7","_t8","_context4","join","rejoin","MEETING_REJOIN","MEETING_MAX_REJOIN_FAILURE","_reconnectMedia","_callee5","_turnServerResult$tur","turnServerResult","iceServers","_context5","roap","doTurnDiscovery","turnServerInfo","urls","push","username","credential","password","webrtcMediaConnection","isMultistream","_values","mediaRequestManagers","forEach","mediaRequestManager","clearPreviousRequests","commit","_reconnectMercuryWebSocket","_callee6","_t9","_t0","_context6","mercury","connected","disconnect","connect"],"sources":["index.ts"],"sourcesContent":["/*!\n * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.\n */\n\n/* eslint-disable no-warning-comments */\n\nimport LoggerProxy from '../common/logs/logger-proxy';\nimport Trigger from '../common/events/trigger-proxy';\nimport {\n EVENT_TRIGGERS,\n RECONNECTION,\n SHARE_STATUS,\n SHARE_STOPPED_REASON,\n _CALL_,\n _LEFT_,\n _ID_,\n RECONNECTION_STATE,\n} from '../constants';\nimport BEHAVIORAL_METRICS from '../metrics/constants';\nimport ReconnectionError from '../common/errors/reconnection';\nimport ReconnectionNotStartedError from '../common/errors/reconnection-not-started';\nimport Metrics from '../metrics';\nimport Meeting from '../meeting';\nimport {MediaRequestManager} from '../multistream/mediaRequestManager';\n\n/**\n * Used to indicate that the reconnect logic needs to be retried.\n *\n * @class NeedsRetryError\n * @extends {Error}\n */\nclass NeedsRetryError extends Error {}\n\n/**\n * Used to indicate that the meeting needs to be rejoined, not just media reconnected\n *\n * @class NeedsRejoinError\n * @extends {Error}\n */\nclass NeedsRejoinError extends Error {\n wasSharing: any;\n\n /**\n * Creates an instance of NeedsRejoinError.\n * @param {Object} params\n * @param {boolean} params.wasSharing\n * @param {Error} params.error\n * @memberof NeedsRejoinError\n */\n constructor({\n wasSharing,\n error = new Error('Meeting needs to be rejoined'),\n }: {\n wasSharing?: boolean;\n error?: Error;\n }) {\n // @ts-ignore\n super(error);\n\n this.wasSharing = wasSharing;\n }\n}\n\n/**\n * @export\n * @class ReconnectionManager\n */\nexport default class ReconnectionManager {\n autoRejoinEnabled: any;\n iceState: any;\n maxRejoinAttempts: any;\n meeting: any;\n rejoinAttempts: any;\n shareStatus: any;\n status: any;\n webex: any;\n /**\n * @param {Meeting} meeting\n */\n constructor(meeting: Meeting) {\n /**\n * Stores ICE reconnection state data.\n *\n * @instance\n * @type {Object}\n * @private\n * @memberof ReconnectionManager\n */\n this.iceState = {\n disconnected: false,\n resolve: () => {},\n timer: undefined,\n // @ts-ignore\n timeoutDuration: meeting.config.reconnection.iceReconnectionTimeout,\n };\n\n /**\n * @instance\n * @type {RECONNECTION_STATE}\n * @private\n * @memberof ReconnectionManager\n */\n this.status = RECONNECTION.STATE.DEFAULT_STATUS;\n /**\n * @instance\n * @type {Object}\n * @private\n * @memberof ReconnectionManager\n */\n // TODO : change this logic to not save the meeting instance\n // It gets complicated when meeting ends on remote side , We have a old meeting instance which is not up to date\n // @ts-ignore\n this.webex = meeting.webex;\n /**\n * @instance\n * @type {Meeting}\n * @private\n * @memberof ReconnectionManager\n */\n // TODO: try removing the circular dependency for meeting and reconnection manager\n // try moving this to meetings collection\n this.meeting = meeting;\n\n // @ts-ignore\n this.maxRejoinAttempts = meeting.config.reconnection.maxRejoinAttempts;\n this.rejoinAttempts = 0;\n // @ts-ignore\n this.autoRejoinEnabled = meeting.config.reconnection.autoRejoin;\n\n // Make sure reconnection state is in default\n this.reset();\n }\n\n /**\n * @public\n * @memberof ReconnectionManager\n * @returns {void}\n */\n resetReconnectionTimer() {\n this.iceState.resolve();\n this.iceState.resolve = () => {};\n\n if (this.iceState.timer) {\n clearTimeout(this.iceState.timer);\n delete this.iceState.timer;\n }\n }\n\n /**\n * Sets the iceState to connected and clears any disconnect timeouts and\n * related timeout data within the iceState.\n *\n * @returns {undefined}\n * @public\n * @memberof ReconnectionManager\n */\n public iceReconnected() {\n if (this.iceState.disconnected) {\n LoggerProxy.logger.log('ReconnectionManager:index#iceReconnected --> ice has reconnected');\n\n this.resetReconnectionTimer();\n\n this.iceState.disconnected = false;\n }\n }\n\n /**\n * Set the iceState to disconnected and generates a timeout that waits for the\n * iceState to reconnect and then resolves. If the ice state is already\n * processing a reconnect, it immediately resolves. Rejects if the timeout\n * duration is reached.\n *\n * @returns {Promise<undefined>}\n * @public\n * @memberof ReconnectionManager\n */\n public waitForIceReconnect() {\n if (!this.iceState.disconnected) {\n LoggerProxy.logger.log(\n 'ReconnectionManager:index#waitForIceReconnect --> waiting for ice reconnect'\n );\n\n this.iceState.disconnected = true;\n\n return new Promise<void>((resolve, reject) => {\n this.iceState.timer = setTimeout(() => {\n if (this.iceState.disconnected === false) {\n resolve();\n } else {\n this.iceState.disconnected = false;\n reject(\n new Error(`ice reconnection did not occur in ${this.iceState.timeoutDuration}ms`)\n );\n }\n }, this.iceState.timeoutDuration);\n\n this.iceState.resolve = resolve;\n });\n }\n\n // return a resolved promise to prevent multiple catch executions of reconnect\n return Promise.resolve();\n }\n\n /**\n * @returns {undefined}\n * @public\n * @memberof ReconnectionManager\n */\n public reset() {\n this.status = RECONNECTION.STATE.DEFAULT_STATUS;\n this.rejoinAttempts = 0;\n }\n\n /**\n * @returns {undefined}\n * @public\n * @memberof ReconnectionManager\n */\n public cleanUp() {\n this.reset();\n }\n\n /**\n * Stop the local share stream.\n *\n * @param {string} reason a {@link SHARE_STOPPED_REASON}\n * @returns {undefined}\n * @private\n * @memberof ReconnectionManager\n */\n private async stopLocalShareStream(reason: string) {\n await this.meeting.unpublishStreams([\n this.meeting.mediaProperties.shareVideoStream,\n this.meeting.mediaProperties.shareAudioStream,\n ]);\n Trigger.trigger(\n this.meeting,\n {\n file: 'reconnection-manager/index',\n function: 'stopLocalShareStream',\n },\n EVENT_TRIGGERS.MEETING_STOPPED_SHARING_LOCAL,\n {\n reason,\n }\n );\n }\n\n /**\n * @public\n * @memberof ReconnectionManager\n * @returns {Boolean} true if reconnection operation is in progress\n */\n isReconnectInProgress() {\n return this.status === RECONNECTION.STATE.IN_PROGRESS;\n }\n\n /**\n * @returns {Boolean}\n * @throws {ReconnectInProgress, ReconnectionDisabled}\n * @private\n * @memberof ReconnectionManager\n */\n private canStartReconnection() {\n if (this.meeting.config.reconnection.enabled) {\n if (this.status === RECONNECTION.STATE.DEFAULT_STATUS) {\n return true;\n }\n\n LoggerProxy.logger.info(\n 'ReconnectionManager:index#canStartReconnection --> Reconnection already in progress.'\n );\n\n return false;\n }\n\n LoggerProxy.logger.info(\n 'ReconnectionManager:index#canStartReconnection --> Reconnection is not enabled.'\n );\n\n return false;\n }\n\n /**\n * Initiates a media reconnect for the active meeting\n * @param {Object} reconnectOptions\n * @param {boolean} [reconnectOptions.networkDisconnect=false] indicates if a network disconnect event happened\n * @param {boolean} [reconnectOptions.networkRetry=false] indicates if we are retrying the reconnect\n * @param {Function} [completionCallback] callback that gets called when reconnection is started successfully\n * @returns {Promise}\n * @public\n * @memberof ReconnectionManager\n */\n public async reconnect(\n {\n networkDisconnect = false,\n networkRetry = false,\n }: {\n networkDisconnect?: boolean;\n networkRetry?: boolean;\n } = {},\n completionCallback: (() => Promise<void>) | undefined = undefined\n ) {\n LoggerProxy.logger.info(\n `ReconnectionManager:index#reconnect --> Reconnection start for meeting ${this.meeting.id}.`\n );\n\n const triggerEvent = (event, payload = undefined) =>\n Trigger.trigger(\n this.meeting,\n {\n file: 'reconnection-manager/index',\n function: 'reconnect',\n },\n event,\n payload\n );\n\n if (!this.canStartReconnection()) {\n throw new ReconnectionNotStartedError();\n }\n\n try {\n this.status = RECONNECTION.STATE.IN_PROGRESS;\n\n triggerEvent(EVENT_TRIGGERS.MEETING_RECONNECTION_STARTING);\n\n if (!networkRetry) {\n // Only log START metrics on the initial reconnect\n LoggerProxy.logger.info(\n 'ReconnectionManager:index#reconnect --> Sending reconnect start metric.'\n );\n\n // @ts-ignore\n this.webex.internal.newMetrics.submitClientEvent({\n name: 'client.media.reconnecting',\n options: {\n meetingId: this.meeting.id,\n },\n });\n }\n\n try {\n await this.webex.meetings.startReachability('reconnection');\n } catch (err) {\n LoggerProxy.logger.info(\n 'ReconnectionManager:index#reconnect --> Reachability failed, continuing with reconnection attempt, err: ',\n err\n );\n }\n\n try {\n await this.executeReconnection({networkDisconnect});\n } catch (reconnectError) {\n if (reconnectError instanceof NeedsRetryError) {\n LoggerProxy.logger.info(\n 'ReconnectionManager:index#reconnect --> Reconnection not successful, retrying.'\n );\n // Reset our reconnect status since we are looping back to the beginning\n this.status = RECONNECTION.STATE.DEFAULT_STATUS;\n\n // This is a network retry, so we should not log START metrics again\n await this.reconnect({networkDisconnect: true, networkRetry: true}, completionCallback);\n\n return;\n }\n\n // Reconnect has failed\n LoggerProxy.logger.error(\n 'ReconnectionManager:index#reconnect --> Reconnection failed.',\n reconnectError.message\n );\n\n // send call aborted event with category as expected as we are trying to rejoin\n // @ts-ignore\n this.webex.internal.newMetrics.submitClientEvent({\n name: 'client.call.aborted',\n payload: {\n errors: [\n {\n category: 'expected',\n errorCode: 2008,\n fatal: true,\n name: 'media-engine',\n shownToUser: false,\n },\n ],\n },\n options: {\n meetingId: this.meeting.id,\n },\n });\n\n if (reconnectError instanceof NeedsRejoinError && this.autoRejoinEnabled) {\n await this.rejoinMeeting(reconnectError.wasSharing);\n\n return;\n }\n\n throw reconnectError;\n }\n\n // finalize the reconnection process by calling the completionCallback\n if (completionCallback) {\n await completionCallback();\n }\n\n triggerEvent(EVENT_TRIGGERS.MEETING_RECONNECTION_SUCCESS);\n\n // @ts-ignore\n this.webex.internal.newMetrics.submitClientEvent({\n name: 'client.media.recovered',\n payload: {\n recoveredBy: 'new',\n },\n options: {\n meetingId: this.meeting.id,\n },\n });\n } catch (error) {\n triggerEvent(EVENT_TRIGGERS.MEETING_RECONNECTION_FAILURE, {\n error: new ReconnectionError('Reconnection failure event', error),\n });\n\n Metrics.sendBehavioralMetric(BEHAVIORAL_METRICS.MEETING_RECONNECT_FAILURE, {\n correlation_id: this.meeting.correlationId,\n locus_id: this.meeting.locusUrl.split('/').pop(),\n reason: error.message,\n stack: error.stack,\n });\n\n throw new ReconnectionError('Reconnection failure event', error);\n } finally {\n this.reset();\n }\n }\n\n /**\n * @param {Object} reconnectOptions\n * @param {boolean} [reconnectOptions.networkDisconnect=false] indicates if a network disconnect event happened\n * @returns {Promise}\n * @throws {NeedsRetryError}\n * @private\n * @memberof ReconnectionManager\n */\n private async executeReconnection({networkDisconnect = false}: {networkDisconnect?: boolean}) {\n LoggerProxy.logger.info(\n 'ReconnectionManager:index#executeReconnection --> Attempting to reconnect to meeting.'\n );\n\n const wasSharing = this.meeting.shareStatus === SHARE_STATUS.LOCAL_SHARE_ACTIVE;\n\n if (wasSharing) {\n await this.stopLocalShareStream(SHARE_STOPPED_REASON.MEDIA_RECONNECTION);\n }\n\n if (networkDisconnect) {\n try {\n await this.reconnectMercuryWebSocket();\n LoggerProxy.logger.error(\n 'ReconnectionManager:index#executeReconnection --> Websocket reconnected.',\n this.webex.internal.device.url\n );\n } catch (error) {\n LoggerProxy.logger.error(\n 'ReconnectionManager:index#executeReconnection --> Unable to reconnect to websocket, giving up.'\n );\n this.status = RECONNECTION.STATE.FAILURE;\n throw error;\n }\n }\n\n try {\n LoggerProxy.logger.info(\n 'ReconnectionManager:index#executeReconnection --> Updating meeting data from server.'\n );\n await this.webex.meetings.syncMeetings({keepOnlyLocusMeetings: false});\n } catch (syncError) {\n LoggerProxy.logger.info(\n 'ReconnectionManager:index#executeReconnection --> Unable to sync meetings, reconnecting.',\n syncError\n );\n throw new NeedsRetryError(syncError);\n }\n\n // TODO: try to improve this logic as the reconnection manager saves the instance of deleted meeting object\n // So that on rejoin it known what parametrs it was using\n if (!this.meeting || !this.webex.meetings.getMeetingByType(_ID_, this.meeting.id)) {\n LoggerProxy.logger.info(\n 'ReconnectionManager:index#executeReconnection --> Meeting got deleted due to inactivity or ended remotely.'\n );\n\n throw new Error('Unable to rejoin a meeting already ended or inactive.');\n }\n\n LoggerProxy.logger.info(\n `ReconnectionManager:index#executeReconnection --> Current state of meeting is ${this.meeting.state}`\n );\n\n // If the meeting state was left, no longer reconnect media\n if (this.meeting.state === _LEFT_) {\n if (this.meeting.type === _CALL_) {\n throw new Error('Unable to rejoin a call in LEFT state.');\n }\n\n throw new NeedsRejoinError({wasSharing});\n }\n\n try {\n const media = await this.reconnectMedia();\n\n LoggerProxy.logger.log(\n 'ReconnectionManager:index#executeReconnection --> webRTC media connection renewed and local sdp offer sent'\n );\n\n return media;\n } catch (error) {\n LoggerProxy.logger.error(\n 'ReconnectionManager:index#executeReconnection --> failed to renew webRTC media connection or initiate offer'\n );\n this.status = RECONNECTION.STATE.FAILURE;\n\n throw error;\n }\n }\n\n /**\n * Rejoins a meeting after detecting the member was in a LEFT state\n *\n * @async\n * @param {boolean} wasSharing\n * @returns {Promise}\n */\n async rejoinMeeting(wasSharing = false) {\n try {\n LoggerProxy.logger.info(\n 'ReconnectionManager:index#rejoinMeeting --> attemping meeting rejoin'\n );\n\n await this.meeting.join({rejoin: true});\n LoggerProxy.logger.info('ReconnectionManager:index#rejoinMeeting --> meeting rejoined');\n\n if (wasSharing) {\n await this.stopLocalShareStream(SHARE_STOPPED_REASON.MEETING_REJOIN);\n }\n } catch (joinError) {\n this.rejoinAttempts += 1;\n if (this.rejoinAttempts <= this.maxRejoinAttempts) {\n LoggerProxy.logger.info(\n `ReconnectionManager:index#rejoinMeeting --> Unable to rejoin meeting, attempt #${this.rejoinAttempts}, retrying.`,\n joinError\n );\n this.rejoinMeeting();\n } else {\n LoggerProxy.logger.error(\n 'ReconnectionManager:index#rejoinMeeting --> Unable to rejoin meeting after max attempts.',\n joinError\n );\n Metrics.sendBehavioralMetric(BEHAVIORAL_METRICS.MEETING_MAX_REJOIN_FAILURE, {\n locus_id: this.meeting.locusUrl.split('/').pop(),\n reason: joinError.message,\n stack: joinError.stack,\n });\n this.status = RECONNECTION.STATE.FAILURE;\n throw joinError;\n }\n }\n\n try {\n await this.reconnectMedia();\n } catch (mediaError) {\n LoggerProxy.logger.error(\n 'ReconnectionManager:index#rejoinMeeting --> Unable to reestablish media after rejoining.',\n mediaError\n );\n throw mediaError;\n }\n }\n\n /**\n * @returns {Promise}\n * @private\n * @memberof ReconnectionManager\n */\n async reconnectMedia() {\n LoggerProxy.logger.log('ReconnectionManager:index#reconnectMedia --> do turn discovery');\n\n // do the TURN server discovery again and ignore reachability results since the TURN server might change\n const turnServerResult = await this.meeting.roap.doTurnDiscovery(this.meeting, true, true);\n\n const iceServers = [];\n\n if (turnServerResult.turnServerInfo?.urls.length > 0) {\n iceServers.push({\n urls: turnServerResult.turnServerInfo.urls,\n username: turnServerResult.turnServerInfo.username || '',\n credential: turnServerResult.turnServerInfo.password || '',\n });\n }\n\n LoggerProxy.logger.log(\n 'ReconnectionManager:index#reconnectMedia --> renew webRTC media connection and send local sdp offer'\n );\n\n await this.meeting.mediaProperties.webrtcMediaConnection.reconnect(iceServers);\n\n // resend media requests\n if (this.meeting.isMultistream) {\n Object.values(this.meeting.mediaRequestManagers).forEach(\n (mediaRequestManager: MediaRequestManager) => {\n mediaRequestManager.clearPreviousRequests();\n mediaRequestManager.commit();\n }\n );\n }\n }\n\n /**\n * Attempt to Reconnect Mercury Websocket\n * @returns {Promise}\n * @private\n * @memberof ReconnectionManager\n */\n private async reconnectMercuryWebSocket() {\n LoggerProxy.logger.info(\n 'ReconnectionManager:index#reconnectMercuryWebSocket --> Reconnecting websocket.'\n );\n // First, attempt to disconnect if we think we are already connected.\n if (this.webex.internal.mercury.connected) {\n LoggerProxy.logger.info(\n 'ReconnectionManager:index#reconnectMercuryWebSocket --> Disconnecting existing websocket.'\n );\n try {\n await this.webex.internal.mercury.disconnect();\n LoggerProxy.logger.info(\n 'ReconnectionManager:index#reconnectMercuryWebSocket --> Websocket disconnected successfully.'\n );\n } catch (disconnectError) {\n // If we can't disconnect, the sdk is in such a bad state that reconnecting is not going to happen.\n LoggerProxy.logger.error(\n 'ReconnectionManager:index#reconnectMercuryWebSocket --> Unable to disconnect from websocket, giving up.',\n disconnectError\n );\n throw disconnectError;\n }\n }\n\n try {\n LoggerProxy.logger.info(\n 'ReconnectionManager:index#reconnectMercuryWebSocket --> Connecting websocket.'\n );\n await this.webex.internal.mercury.connect();\n LoggerProxy.logger.info(\n 'ReconnectionManager:index#reconnectMercuryWebSocket --> Websocket connected successfully.'\n );\n } catch (connectError) {\n LoggerProxy.logger.error(\n 'ReconnectionManager:index#reconnectMercuryWebSocket --> Unable to connect to websocket, giving up.',\n connectError\n );\n\n throw connectError;\n }\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAMA,IAAAA,YAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,aAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,UAAA,GAAAF,OAAA;AAUA,IAAAG,WAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,aAAA,GAAAL,sBAAA,CAAAC,OAAA;AACA,IAAAK,uBAAA,GAAAN,sBAAA,CAAAC,OAAA;AACA,IAAAM,QAAA,GAAAP,sBAAA,CAAAC,OAAA;AAAiC,SAAAO,WAAAC,CAAA,EAAAC,CAAA,EAAAC,CAAA,WAAAD,CAAA,OAAAE,gBAAA,CAAAC,OAAA,EAAAH,CAAA,OAAAI,2BAAA,CAAAD,OAAA,EAAAJ,CAAA,EAAAM,yBAAA,KAAAC,kBAAA,CAAAN,CAAA,EAAAC,CAAA,YAAAC,gBAAA,CAAAC,OAAA,EAAAJ,CAAA,EAAAQ,WAAA,IAAAP,CAAA,CAAAQ,KAAA,CAAAT,CAAA,EAAAE,CAAA;AAAA,SAAAI,0BAAA,cAAAN,CAAA,IAAAU,OAAA,CAAAC,SAAA,CAAAC,OAAA,CAAAC,IAAA,CAAAN,kBAAA,CAAAG,OAAA,iCAAA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GAEtG,CAAC;cAAC,MAAAA,GAAA;YAAA;YAAA;cAAA,OAAAC,SAAA,CAAAhI,IAAA;UAAA;QAAA,GAAA6H,QAAA;MAAA,CAIL;MAAA,SAxCahD,yBAAyBA,CAAA;QAAA,OAAA+C,0BAAA,CAAA1M,KAAA,OAAAQ,SAAA;MAAA;MAAA,OAAzBmJ,yBAAyB;IAAA;EAAA;AAAA","ignoreList":[]}
1
+ {"version":3,"names":["_loggerProxy","_interopRequireDefault","require","_triggerProxy","_constants","_constants2","_reconnection","_reconnectionNotStarted","_metrics","_callSuper","t","o","e","_getPrototypeOf2","default","_possibleConstructorReturn2","_isNativeReflectConstruct","_Reflect$construct","constructor","apply","Boolean","prototype","valueOf","call","NeedsRetryError","_Error","_classCallCheck2","arguments","_inherits2","_createClass2","_wrapNativeSuper2","Error","NeedsRejoinError","_Error2","_ref","_this","wasSharing","_ref$error","error","_defineProperty2","ReconnectionManager","exports","meeting","iceState","disconnected","resolve","timer","undefined","timeoutDuration","config","reconnection","iceReconnectionTimeout","status","RECONNECTION","STATE","DEFAULT_STATUS","webex","maxRejoinAttempts","rejoinAttempts","autoRejoinEnabled","autoRejoin","reset","key","value","resetReconnectionTimer","clearTimeout","iceReconnected","LoggerProxy","logger","log","waitForIceReconnect","_this2","_promise","reject","setTimeout","concat","cleanUp","_stopLocalShareStream","_asyncToGenerator2","_regenerator","mark","_callee","reason","wrap","_context","prev","next","unpublishStreams","mediaProperties","shareVideoStream","shareAudioStream","Trigger","trigger","file","function","EVENT_TRIGGERS","MEETING_STOPPED_SHARING_LOCAL","stop","stopLocalShareStream","_x","isReconnectInProgress","IN_PROGRESS","canStartReconnection","enabled","info","_reconnect","_callee2","_this3","_ref2","_ref2$networkDisconne","networkDisconnect","_ref2$networkRetry","networkRetry","completionCallback","triggerEvent","_args2","_t","_t2","_t3","_context2","length","id","event","payload","ReconnectionNotStartedError","MEETING_RECONNECTION_STARTING","internal","newMetrics","submitClientEvent","name","options","meetingId","meetings","startReachability","executeReconnection","reconnect","abrupt","message","errors","category","errorCode","fatal","shownToUser","rejoinMeeting","MEETING_RECONNECTION_SUCCESS","recoveredBy","MEETING_RECONNECTION_FAILURE","ReconnectionError","Metrics","sendBehavioralMetric","BEHAVIORAL_METRICS","MEETING_RECONNECT_FAILURE","correlation_id","correlationId","locus_id","locusUrl","split","pop","stack","finish","_executeReconnection","_callee3","_ref3","_ref3$networkDisconne","media","_t4","_t5","_t6","_context3","shareStatus","SHARE_STATUS","LOCAL_SHARE_ACTIVE","SHARE_STOPPED_REASON","MEDIA_RECONNECTION","reconnectMercuryWebSocket","device","url","FAILURE","syncMeetings","keepOnlyLocusMeetings","getMeetingByType","_ID_","state","_LEFT_","type","_CALL_","reconnectMedia","sent","_x2","_rejoinMeeting","_callee4","_args4","_t7","_t8","_context4","join","rejoin","MEETING_REJOIN","MEETING_MAX_REJOIN_FAILURE","_reconnectMedia","_callee5","_turnServerResult$tur","turnServerResult","iceServers","_context5","roap","doTurnDiscovery","turnServerInfo","urls","push","username","credential","password","webrtcMediaConnection","isMultistream","_values","mediaRequestManagers","forEach","mediaRequestManager","commit","_reconnectMercuryWebSocket","_callee6","_t9","_t0","_context6","mercury","connected","disconnect","connect"],"sources":["index.ts"],"sourcesContent":["/*!\n * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.\n */\n\n/* eslint-disable no-warning-comments */\n\nimport LoggerProxy from '../common/logs/logger-proxy';\nimport Trigger from '../common/events/trigger-proxy';\nimport {\n EVENT_TRIGGERS,\n RECONNECTION,\n SHARE_STATUS,\n SHARE_STOPPED_REASON,\n _CALL_,\n _LEFT_,\n _ID_,\n RECONNECTION_STATE,\n} from '../constants';\nimport BEHAVIORAL_METRICS from '../metrics/constants';\nimport ReconnectionError from '../common/errors/reconnection';\nimport ReconnectionNotStartedError from '../common/errors/reconnection-not-started';\nimport Metrics from '../metrics';\nimport Meeting from '../meeting';\nimport {MediaRequestManager} from '../multistream/mediaRequestManager';\n\n/**\n * Used to indicate that the reconnect logic needs to be retried.\n *\n * @class NeedsRetryError\n * @extends {Error}\n */\nclass NeedsRetryError extends Error {}\n\n/**\n * Used to indicate that the meeting needs to be rejoined, not just media reconnected\n *\n * @class NeedsRejoinError\n * @extends {Error}\n */\nclass NeedsRejoinError extends Error {\n wasSharing: any;\n\n /**\n * Creates an instance of NeedsRejoinError.\n * @param {Object} params\n * @param {boolean} params.wasSharing\n * @param {Error} params.error\n * @memberof NeedsRejoinError\n */\n constructor({\n wasSharing,\n error = new Error('Meeting needs to be rejoined'),\n }: {\n wasSharing?: boolean;\n error?: Error;\n }) {\n // @ts-ignore\n super(error);\n\n this.wasSharing = wasSharing;\n }\n}\n\n/**\n * @export\n * @class ReconnectionManager\n */\nexport default class ReconnectionManager {\n autoRejoinEnabled: any;\n iceState: any;\n maxRejoinAttempts: any;\n meeting: any;\n rejoinAttempts: any;\n shareStatus: any;\n status: any;\n webex: any;\n /**\n * @param {Meeting} meeting\n */\n constructor(meeting: Meeting) {\n /**\n * Stores ICE reconnection state data.\n *\n * @instance\n * @type {Object}\n * @private\n * @memberof ReconnectionManager\n */\n this.iceState = {\n disconnected: false,\n resolve: () => {},\n timer: undefined,\n // @ts-ignore\n timeoutDuration: meeting.config.reconnection.iceReconnectionTimeout,\n };\n\n /**\n * @instance\n * @type {RECONNECTION_STATE}\n * @private\n * @memberof ReconnectionManager\n */\n this.status = RECONNECTION.STATE.DEFAULT_STATUS;\n /**\n * @instance\n * @type {Object}\n * @private\n * @memberof ReconnectionManager\n */\n // TODO : change this logic to not save the meeting instance\n // It gets complicated when meeting ends on remote side , We have a old meeting instance which is not up to date\n // @ts-ignore\n this.webex = meeting.webex;\n /**\n * @instance\n * @type {Meeting}\n * @private\n * @memberof ReconnectionManager\n */\n // TODO: try removing the circular dependency for meeting and reconnection manager\n // try moving this to meetings collection\n this.meeting = meeting;\n\n // @ts-ignore\n this.maxRejoinAttempts = meeting.config.reconnection.maxRejoinAttempts;\n this.rejoinAttempts = 0;\n // @ts-ignore\n this.autoRejoinEnabled = meeting.config.reconnection.autoRejoin;\n\n // Make sure reconnection state is in default\n this.reset();\n }\n\n /**\n * @public\n * @memberof ReconnectionManager\n * @returns {void}\n */\n resetReconnectionTimer() {\n this.iceState.resolve();\n this.iceState.resolve = () => {};\n\n if (this.iceState.timer) {\n clearTimeout(this.iceState.timer);\n delete this.iceState.timer;\n }\n }\n\n /**\n * Sets the iceState to connected and clears any disconnect timeouts and\n * related timeout data within the iceState.\n *\n * @returns {undefined}\n * @public\n * @memberof ReconnectionManager\n */\n public iceReconnected() {\n if (this.iceState.disconnected) {\n LoggerProxy.logger.log('ReconnectionManager:index#iceReconnected --> ice has reconnected');\n\n this.resetReconnectionTimer();\n\n this.iceState.disconnected = false;\n }\n }\n\n /**\n * Set the iceState to disconnected and generates a timeout that waits for the\n * iceState to reconnect and then resolves. If the ice state is already\n * processing a reconnect, it immediately resolves. Rejects if the timeout\n * duration is reached.\n *\n * @returns {Promise<undefined>}\n * @public\n * @memberof ReconnectionManager\n */\n public waitForIceReconnect() {\n if (!this.iceState.disconnected) {\n LoggerProxy.logger.log(\n 'ReconnectionManager:index#waitForIceReconnect --> waiting for ice reconnect'\n );\n\n this.iceState.disconnected = true;\n\n return new Promise<void>((resolve, reject) => {\n this.iceState.timer = setTimeout(() => {\n if (this.iceState.disconnected === false) {\n resolve();\n } else {\n this.iceState.disconnected = false;\n reject(\n new Error(`ice reconnection did not occur in ${this.iceState.timeoutDuration}ms`)\n );\n }\n }, this.iceState.timeoutDuration);\n\n this.iceState.resolve = resolve;\n });\n }\n\n // return a resolved promise to prevent multiple catch executions of reconnect\n return Promise.resolve();\n }\n\n /**\n * @returns {undefined}\n * @public\n * @memberof ReconnectionManager\n */\n public reset() {\n this.status = RECONNECTION.STATE.DEFAULT_STATUS;\n this.rejoinAttempts = 0;\n }\n\n /**\n * @returns {undefined}\n * @public\n * @memberof ReconnectionManager\n */\n public cleanUp() {\n this.reset();\n }\n\n /**\n * Stop the local share stream.\n *\n * @param {string} reason a {@link SHARE_STOPPED_REASON}\n * @returns {undefined}\n * @private\n * @memberof ReconnectionManager\n */\n private async stopLocalShareStream(reason: string) {\n await this.meeting.unpublishStreams([\n this.meeting.mediaProperties.shareVideoStream,\n this.meeting.mediaProperties.shareAudioStream,\n ]);\n Trigger.trigger(\n this.meeting,\n {\n file: 'reconnection-manager/index',\n function: 'stopLocalShareStream',\n },\n EVENT_TRIGGERS.MEETING_STOPPED_SHARING_LOCAL,\n {\n reason,\n }\n );\n }\n\n /**\n * @public\n * @memberof ReconnectionManager\n * @returns {Boolean} true if reconnection operation is in progress\n */\n isReconnectInProgress() {\n return this.status === RECONNECTION.STATE.IN_PROGRESS;\n }\n\n /**\n * @returns {Boolean}\n * @throws {ReconnectInProgress, ReconnectionDisabled}\n * @private\n * @memberof ReconnectionManager\n */\n private canStartReconnection() {\n if (this.meeting.config.reconnection.enabled) {\n if (this.status === RECONNECTION.STATE.DEFAULT_STATUS) {\n return true;\n }\n\n LoggerProxy.logger.info(\n 'ReconnectionManager:index#canStartReconnection --> Reconnection already in progress.'\n );\n\n return false;\n }\n\n LoggerProxy.logger.info(\n 'ReconnectionManager:index#canStartReconnection --> Reconnection is not enabled.'\n );\n\n return false;\n }\n\n /**\n * Initiates a media reconnect for the active meeting\n * @param {Object} reconnectOptions\n * @param {boolean} [reconnectOptions.networkDisconnect=false] indicates if a network disconnect event happened\n * @param {boolean} [reconnectOptions.networkRetry=false] indicates if we are retrying the reconnect\n * @param {Function} [completionCallback] callback that gets called when reconnection is started successfully\n * @returns {Promise}\n * @public\n * @memberof ReconnectionManager\n */\n public async reconnect(\n {\n networkDisconnect = false,\n networkRetry = false,\n }: {\n networkDisconnect?: boolean;\n networkRetry?: boolean;\n } = {},\n completionCallback: (() => Promise<void>) | undefined = undefined\n ) {\n LoggerProxy.logger.info(\n `ReconnectionManager:index#reconnect --> Reconnection start for meeting ${this.meeting.id}.`\n );\n\n const triggerEvent = (event, payload = undefined) =>\n Trigger.trigger(\n this.meeting,\n {\n file: 'reconnection-manager/index',\n function: 'reconnect',\n },\n event,\n payload\n );\n\n if (!this.canStartReconnection()) {\n throw new ReconnectionNotStartedError();\n }\n\n try {\n this.status = RECONNECTION.STATE.IN_PROGRESS;\n\n triggerEvent(EVENT_TRIGGERS.MEETING_RECONNECTION_STARTING);\n\n if (!networkRetry) {\n // Only log START metrics on the initial reconnect\n LoggerProxy.logger.info(\n 'ReconnectionManager:index#reconnect --> Sending reconnect start metric.'\n );\n\n // @ts-ignore\n this.webex.internal.newMetrics.submitClientEvent({\n name: 'client.media.reconnecting',\n options: {\n meetingId: this.meeting.id,\n },\n });\n }\n\n try {\n await this.webex.meetings.startReachability('reconnection');\n } catch (err) {\n LoggerProxy.logger.info(\n 'ReconnectionManager:index#reconnect --> Reachability failed, continuing with reconnection attempt, err: ',\n err\n );\n }\n\n try {\n await this.executeReconnection({networkDisconnect});\n } catch (reconnectError) {\n if (reconnectError instanceof NeedsRetryError) {\n LoggerProxy.logger.info(\n 'ReconnectionManager:index#reconnect --> Reconnection not successful, retrying.'\n );\n // Reset our reconnect status since we are looping back to the beginning\n this.status = RECONNECTION.STATE.DEFAULT_STATUS;\n\n // This is a network retry, so we should not log START metrics again\n await this.reconnect({networkDisconnect: true, networkRetry: true}, completionCallback);\n\n return;\n }\n\n // Reconnect has failed\n LoggerProxy.logger.error(\n 'ReconnectionManager:index#reconnect --> Reconnection failed.',\n reconnectError.message\n );\n\n // send call aborted event with category as expected as we are trying to rejoin\n // @ts-ignore\n this.webex.internal.newMetrics.submitClientEvent({\n name: 'client.call.aborted',\n payload: {\n errors: [\n {\n category: 'expected',\n errorCode: 2008,\n fatal: true,\n name: 'media-engine',\n shownToUser: false,\n },\n ],\n },\n options: {\n meetingId: this.meeting.id,\n },\n });\n\n if (reconnectError instanceof NeedsRejoinError && this.autoRejoinEnabled) {\n await this.rejoinMeeting(reconnectError.wasSharing);\n\n return;\n }\n\n throw reconnectError;\n }\n\n // finalize the reconnection process by calling the completionCallback\n if (completionCallback) {\n await completionCallback();\n }\n\n triggerEvent(EVENT_TRIGGERS.MEETING_RECONNECTION_SUCCESS);\n\n // @ts-ignore\n this.webex.internal.newMetrics.submitClientEvent({\n name: 'client.media.recovered',\n payload: {\n recoveredBy: 'new',\n },\n options: {\n meetingId: this.meeting.id,\n },\n });\n } catch (error) {\n triggerEvent(EVENT_TRIGGERS.MEETING_RECONNECTION_FAILURE, {\n error: new ReconnectionError('Reconnection failure event', error),\n });\n\n Metrics.sendBehavioralMetric(BEHAVIORAL_METRICS.MEETING_RECONNECT_FAILURE, {\n correlation_id: this.meeting.correlationId,\n locus_id: this.meeting.locusUrl.split('/').pop(),\n reason: error.message,\n stack: error.stack,\n });\n\n throw new ReconnectionError('Reconnection failure event', error);\n } finally {\n this.reset();\n }\n }\n\n /**\n * @param {Object} reconnectOptions\n * @param {boolean} [reconnectOptions.networkDisconnect=false] indicates if a network disconnect event happened\n * @returns {Promise}\n * @throws {NeedsRetryError}\n * @private\n * @memberof ReconnectionManager\n */\n private async executeReconnection({networkDisconnect = false}: {networkDisconnect?: boolean}) {\n LoggerProxy.logger.info(\n 'ReconnectionManager:index#executeReconnection --> Attempting to reconnect to meeting.'\n );\n\n const wasSharing = this.meeting.shareStatus === SHARE_STATUS.LOCAL_SHARE_ACTIVE;\n\n if (wasSharing) {\n await this.stopLocalShareStream(SHARE_STOPPED_REASON.MEDIA_RECONNECTION);\n }\n\n if (networkDisconnect) {\n try {\n await this.reconnectMercuryWebSocket();\n LoggerProxy.logger.error(\n 'ReconnectionManager:index#executeReconnection --> Websocket reconnected.',\n this.webex.internal.device.url\n );\n } catch (error) {\n LoggerProxy.logger.error(\n 'ReconnectionManager:index#executeReconnection --> Unable to reconnect to websocket, giving up.'\n );\n this.status = RECONNECTION.STATE.FAILURE;\n throw error;\n }\n }\n\n try {\n LoggerProxy.logger.info(\n 'ReconnectionManager:index#executeReconnection --> Updating meeting data from server.'\n );\n await this.webex.meetings.syncMeetings({keepOnlyLocusMeetings: false});\n } catch (syncError) {\n LoggerProxy.logger.info(\n 'ReconnectionManager:index#executeReconnection --> Unable to sync meetings, reconnecting.',\n syncError\n );\n throw new NeedsRetryError(syncError);\n }\n\n // TODO: try to improve this logic as the reconnection manager saves the instance of deleted meeting object\n // So that on rejoin it known what parametrs it was using\n if (!this.meeting || !this.webex.meetings.getMeetingByType(_ID_, this.meeting.id)) {\n LoggerProxy.logger.info(\n 'ReconnectionManager:index#executeReconnection --> Meeting got deleted due to inactivity or ended remotely.'\n );\n\n throw new Error('Unable to rejoin a meeting already ended or inactive.');\n }\n\n LoggerProxy.logger.info(\n `ReconnectionManager:index#executeReconnection --> Current state of meeting is ${this.meeting.state}`\n );\n\n // If the meeting state was left, no longer reconnect media\n if (this.meeting.state === _LEFT_) {\n if (this.meeting.type === _CALL_) {\n throw new Error('Unable to rejoin a call in LEFT state.');\n }\n\n throw new NeedsRejoinError({wasSharing});\n }\n\n try {\n const media = await this.reconnectMedia();\n\n LoggerProxy.logger.log(\n 'ReconnectionManager:index#executeReconnection --> webRTC media connection renewed and local sdp offer sent'\n );\n\n return media;\n } catch (error) {\n LoggerProxy.logger.error(\n 'ReconnectionManager:index#executeReconnection --> failed to renew webRTC media connection or initiate offer'\n );\n this.status = RECONNECTION.STATE.FAILURE;\n\n throw error;\n }\n }\n\n /**\n * Rejoins a meeting after detecting the member was in a LEFT state\n *\n * @async\n * @param {boolean} wasSharing\n * @returns {Promise}\n */\n async rejoinMeeting(wasSharing = false) {\n try {\n LoggerProxy.logger.info(\n 'ReconnectionManager:index#rejoinMeeting --> attemping meeting rejoin'\n );\n\n await this.meeting.join({rejoin: true});\n LoggerProxy.logger.info('ReconnectionManager:index#rejoinMeeting --> meeting rejoined');\n\n if (wasSharing) {\n await this.stopLocalShareStream(SHARE_STOPPED_REASON.MEETING_REJOIN);\n }\n } catch (joinError) {\n this.rejoinAttempts += 1;\n if (this.rejoinAttempts <= this.maxRejoinAttempts) {\n LoggerProxy.logger.info(\n `ReconnectionManager:index#rejoinMeeting --> Unable to rejoin meeting, attempt #${this.rejoinAttempts}, retrying.`,\n joinError\n );\n this.rejoinMeeting();\n } else {\n LoggerProxy.logger.error(\n 'ReconnectionManager:index#rejoinMeeting --> Unable to rejoin meeting after max attempts.',\n joinError\n );\n Metrics.sendBehavioralMetric(BEHAVIORAL_METRICS.MEETING_MAX_REJOIN_FAILURE, {\n locus_id: this.meeting.locusUrl.split('/').pop(),\n reason: joinError.message,\n stack: joinError.stack,\n });\n this.status = RECONNECTION.STATE.FAILURE;\n throw joinError;\n }\n }\n\n try {\n await this.reconnectMedia();\n } catch (mediaError) {\n LoggerProxy.logger.error(\n 'ReconnectionManager:index#rejoinMeeting --> Unable to reestablish media after rejoining.',\n mediaError\n );\n throw mediaError;\n }\n }\n\n /**\n * @returns {Promise}\n * @private\n * @memberof ReconnectionManager\n */\n async reconnectMedia() {\n LoggerProxy.logger.log('ReconnectionManager:index#reconnectMedia --> do turn discovery');\n\n // do the TURN server discovery again and ignore reachability results since the TURN server might change\n const turnServerResult = await this.meeting.roap.doTurnDiscovery(this.meeting, true, true);\n\n const iceServers = [];\n\n if (turnServerResult.turnServerInfo?.urls.length > 0) {\n iceServers.push({\n urls: turnServerResult.turnServerInfo.urls,\n username: turnServerResult.turnServerInfo.username || '',\n credential: turnServerResult.turnServerInfo.password || '',\n });\n }\n\n LoggerProxy.logger.log(\n 'ReconnectionManager:index#reconnectMedia --> renew webRTC media connection and send local sdp offer'\n );\n\n await this.meeting.mediaProperties.webrtcMediaConnection.reconnect(iceServers);\n\n // resend media requests\n if (this.meeting.isMultistream) {\n Object.values(this.meeting.mediaRequestManagers).forEach(\n (mediaRequestManager: MediaRequestManager) => {\n mediaRequestManager.commit();\n }\n );\n }\n }\n\n /**\n * Attempt to Reconnect Mercury Websocket\n * @returns {Promise}\n * @private\n * @memberof ReconnectionManager\n */\n private async reconnectMercuryWebSocket() {\n LoggerProxy.logger.info(\n 'ReconnectionManager:index#reconnectMercuryWebSocket --> Reconnecting websocket.'\n );\n // First, attempt to disconnect if we think we are already connected.\n if (this.webex.internal.mercury.connected) {\n LoggerProxy.logger.info(\n 'ReconnectionManager:index#reconnectMercuryWebSocket --> Disconnecting existing websocket.'\n );\n try {\n await this.webex.internal.mercury.disconnect();\n LoggerProxy.logger.info(\n 'ReconnectionManager:index#reconnectMercuryWebSocket --> Websocket disconnected successfully.'\n );\n } catch (disconnectError) {\n // If we can't disconnect, the sdk is in such a bad state that reconnecting is not going to happen.\n LoggerProxy.logger.error(\n 'ReconnectionManager:index#reconnectMercuryWebSocket --> Unable to disconnect from websocket, giving up.',\n disconnectError\n );\n throw disconnectError;\n }\n }\n\n try {\n LoggerProxy.logger.info(\n 'ReconnectionManager:index#reconnectMercuryWebSocket --> Connecting websocket.'\n );\n await this.webex.internal.mercury.connect();\n LoggerProxy.logger.info(\n 'ReconnectionManager:index#reconnectMercuryWebSocket --> Websocket connected successfully.'\n );\n } catch (connectError) {\n LoggerProxy.logger.error(\n 'ReconnectionManager:index#reconnectMercuryWebSocket --> Unable to connect to websocket, giving up.',\n connectError\n );\n\n throw connectError;\n }\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAMA,IAAAA,YAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,aAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,UAAA,GAAAF,OAAA;AAUA,IAAAG,WAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,aAAA,GAAAL,sBAAA,CAAAC,OAAA;AACA,IAAAK,uBAAA,GAAAN,sBAAA,CAAAC,OAAA;AACA,IAAAM,QAAA,GAAAP,sBAAA,CAAAC,OAAA;AAAiC,SAAAO,WAAAC,CAAA,EAAAC,CAAA,EAAAC,CAAA,WAAAD,CAAA,OAAAE,gBAAA,CAAAC,OAAA,EAAAH,CAAA,OAAAI,2BAAA,CAAAD,OAAA,EAAAJ,CAAA,EAAAM,yBAAA,KAAAC,kBAAA,CAAAN,CAAA,EAA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M,CAACoC,IAAI,CACrB,2FACF,CAAC;cAACwH,SAAA,CAAA1I,IAAA;cAAA;YAAA;cAAA0I,SAAA,CAAA3I,IAAA;cAAA0I,GAAA,GAAAC,SAAA;cAEF7J,oBAAW,CAACC,MAAM,CAAC9B,KAAK,CACtB,oGAAoG,EAAAyL,GAEtG,CAAC;cAAC,MAAAA,GAAA;YAAA;YAAA;cAAA,OAAAC,SAAA,CAAA/H,IAAA;UAAA;QAAA,GAAA4H,QAAA;MAAA,CAIL;MAAA,SAxCa/C,yBAAyBA,CAAA;QAAA,OAAA8C,0BAAA,CAAAzM,KAAA,OAAAQ,SAAA;MAAA;MAAA,OAAzBmJ,yBAAyB;IAAA;EAAA;AAAA","ignoreList":[]}
@@ -50,29 +50,12 @@ export declare class MediaRequestManager {
50
50
  private degradationPreferences;
51
51
  private sourceUpdateListener;
52
52
  private debouncedSourceUpdateListener;
53
- private previousStreamRequests;
54
53
  private trimRequestsToNumOfSources;
55
54
  private numTotalSources;
56
55
  private numLiveSources;
57
56
  constructor(sendMediaRequestsCallback: SendMediaRequestsCallback, options: Options);
58
57
  setDegradationPreferences(degradationPreferences: DegradationPreferences): void;
59
58
  private getDegradedClientRequests;
60
- /**
61
- * Returns true if two stream requests are the same, false otherwise.
62
- *
63
- * @param {StreamRequest} streamRequestA - Stream request A for comparison.
64
- * @param {StreamRequest} streamRequestB - Stream request B for comparison.
65
- * @returns {boolean} - Whether they are equal.
66
- */
67
- isEqual(streamRequestA: StreamRequest, streamRequestB: StreamRequest): boolean;
68
- /**
69
- * Compares new stream requests to previous ones and determines
70
- * if they are the same.
71
- *
72
- * @param {StreamRequest[]} newRequests - Array with new requests.
73
- * @returns {boolean} - True if they are equal, false otherwise.
74
- */
75
- private checkIsNewRequestsEqualToPrev;
76
59
  /**
77
60
  * Returns the maxPayloadBitsPerSecond per Stream
78
61
  *
@@ -94,12 +77,6 @@ export declare class MediaRequestManager {
94
77
  * @returns {number} maxMbps
95
78
  */
96
79
  private getH264MaxMbps;
97
- /**
98
- * Clears the previous stream requests.
99
- *
100
- * @returns {void}
101
- */
102
- clearPreviousRequests(): void;
103
80
  /** Modifies the passed in clientRequests and makes sure that in total they don't ask
104
81
  * for more streams than there are available.
105
82
  *
@@ -612,7 +612,7 @@ var Webinar = _webexCore.WebexPlugin.extend({
612
612
  }, _callee0);
613
613
  }))();
614
614
  },
615
- version: "3.11.0-next.45"
615
+ version: "3.11.0-next.47"
616
616
  });
617
617
  var _default = exports.default = Webinar;
618
618
  //# sourceMappingURL=index.js.map
package/package.json CHANGED
@@ -44,7 +44,7 @@
44
44
  "@webex/event-dictionary-ts": "^1.0.2073",
45
45
  "@webex/jest-config-legacy": "0.0.0",
46
46
  "@webex/legacy-tools": "0.0.0",
47
- "@webex/plugin-rooms": "3.11.0-next.10",
47
+ "@webex/plugin-rooms": "3.11.0-next.11",
48
48
  "@webex/test-helper-chai": "3.11.0-next.1",
49
49
  "@webex/test-helper-mocha": "3.11.0-next.1",
50
50
  "@webex/test-helper-mock-webex": "3.11.0-next.1",
@@ -63,20 +63,20 @@
63
63
  "dependencies": {
64
64
  "@webex/common": "3.11.0-next.1",
65
65
  "@webex/internal-media-core": "2.23.1",
66
- "@webex/internal-plugin-conversation": "3.11.0-next.10",
67
- "@webex/internal-plugin-device": "3.11.0-next.7",
68
- "@webex/internal-plugin-llm": "3.11.0-next.10",
69
- "@webex/internal-plugin-mercury": "3.11.0-next.9",
70
- "@webex/internal-plugin-metrics": "3.11.0-next.7",
71
- "@webex/internal-plugin-support": "3.11.0-next.10",
72
- "@webex/internal-plugin-user": "3.11.0-next.7",
73
- "@webex/internal-plugin-voicea": "3.11.0-next.11",
66
+ "@webex/internal-plugin-conversation": "3.11.0-next.11",
67
+ "@webex/internal-plugin-device": "3.11.0-next.8",
68
+ "@webex/internal-plugin-llm": "3.11.0-next.11",
69
+ "@webex/internal-plugin-mercury": "3.11.0-next.10",
70
+ "@webex/internal-plugin-metrics": "3.11.0-next.8",
71
+ "@webex/internal-plugin-support": "3.11.0-next.11",
72
+ "@webex/internal-plugin-user": "3.11.0-next.8",
73
+ "@webex/internal-plugin-voicea": "3.11.0-next.12",
74
74
  "@webex/media-helpers": "3.11.0-next.4",
75
- "@webex/plugin-people": "3.11.0-next.9",
76
- "@webex/plugin-rooms": "3.11.0-next.10",
75
+ "@webex/plugin-people": "3.11.0-next.10",
76
+ "@webex/plugin-rooms": "3.11.0-next.11",
77
77
  "@webex/ts-sdp": "^1.8.1",
78
78
  "@webex/web-capabilities": "^1.10.0",
79
- "@webex/webex-core": "3.11.0-next.7",
79
+ "@webex/webex-core": "3.11.0-next.8",
80
80
  "ampersand-collection": "^2.0.2",
81
81
  "bowser": "^2.11.0",
82
82
  "btoa": "^1.2.1",
@@ -93,5 +93,5 @@
93
93
  "//": [
94
94
  "TODO: upgrade jwt-decode when moving to node 18"
95
95
  ],
96
- "version": "3.11.0-next.45"
96
+ "version": "3.11.0-next.47"
97
97
  }
@@ -10,7 +10,7 @@ import {
10
10
  RecommendedOpusBitrates,
11
11
  NamedMediaGroup,
12
12
  } from '@webex/internal-media-core';
13
- import {cloneDeepWith, debounce, isEmpty} from 'lodash';
13
+ import {cloneDeepWith, debounce} from 'lodash';
14
14
 
15
15
  import LoggerProxy from '../common/logs/logger-proxy';
16
16
 
@@ -94,8 +94,6 @@ export class MediaRequestManager {
94
94
 
95
95
  private debouncedSourceUpdateListener: () => void;
96
96
 
97
- private previousStreamRequests: Array<StreamRequest> = [];
98
-
99
97
  private trimRequestsToNumOfSources: boolean;
100
98
  private numTotalSources: number;
101
99
  private numLiveSources: number;
@@ -161,36 +159,6 @@ export class MediaRequestManager {
161
159
  }
162
160
  }
163
161
 
164
- /**
165
- * Returns true if two stream requests are the same, false otherwise.
166
- *
167
- * @param {StreamRequest} streamRequestA - Stream request A for comparison.
168
- * @param {StreamRequest} streamRequestB - Stream request B for comparison.
169
- * @returns {boolean} - Whether they are equal.
170
- */
171
- // eslint-disable-next-line class-methods-use-this
172
- public isEqual(streamRequestA: StreamRequest, streamRequestB: StreamRequest) {
173
- return (
174
- JSON.stringify(streamRequestA._toJmpStreamRequest()) ===
175
- JSON.stringify(streamRequestB._toJmpStreamRequest())
176
- );
177
- }
178
-
179
- /**
180
- * Compares new stream requests to previous ones and determines
181
- * if they are the same.
182
- *
183
- * @param {StreamRequest[]} newRequests - Array with new requests.
184
- * @returns {boolean} - True if they are equal, false otherwise.
185
- */
186
- private checkIsNewRequestsEqualToPrev(newRequests: StreamRequest[]) {
187
- return (
188
- !isEmpty(this.previousStreamRequests) &&
189
- this.previousStreamRequests.length === newRequests.length &&
190
- this.previousStreamRequests.every((req, idx) => this.isEqual(req, newRequests[idx]))
191
- );
192
- }
193
-
194
162
  /**
195
163
  * Returns the maxPayloadBitsPerSecond per Stream
196
164
  *
@@ -230,15 +198,6 @@ export class MediaRequestManager {
230
198
  return (mediaRequest.codecInfo.maxFs * maxFps) / 100;
231
199
  }
232
200
 
233
- /**
234
- * Clears the previous stream requests.
235
- *
236
- * @returns {void}
237
- */
238
- public clearPreviousRequests(): void {
239
- this.previousStreamRequests = [];
240
- }
241
-
242
201
  /** Modifies the passed in clientRequests and makes sure that in total they don't ask
243
202
  * for more streams than there are available.
244
203
  *
@@ -372,17 +331,8 @@ export class MediaRequestManager {
372
331
  }
373
332
  });
374
333
 
375
- //! IMPORTANT: this is only a temporary fix. This will soon be done in the jmp layer (@webex/json-multistream)
376
- // https://jira-eng-gpk2.cisco.com/jira/browse/WEBEX-326713
377
- if (!this.checkIsNewRequestsEqualToPrev(streamRequests)) {
378
- this.sendMediaRequestsCallback(streamRequests);
379
- this.previousStreamRequests = streamRequests;
380
- LoggerProxy.logger.info(`multistream:sendRequests --> media requests sent. `);
381
- } else {
382
- LoggerProxy.logger.info(
383
- `multistream:sendRequests --> detected duplicate WCME requests, skipping them... `
384
- );
385
- }
334
+ this.sendMediaRequestsCallback(streamRequests);
335
+ LoggerProxy.logger.info(`multistream:sendRequests --> media requests sent. `);
386
336
  }
387
337
 
388
338
  public addRequest(mediaRequest: MediaRequest, commit = true): MediaRequestId {
@@ -609,7 +609,6 @@ export default class ReconnectionManager {
609
609
  if (this.meeting.isMultistream) {
610
610
  Object.values(this.meeting.mediaRequestManagers).forEach(
611
611
  (mediaRequestManager: MediaRequestManager) => {
612
- mediaRequestManager.clearPreviousRequests();
613
612
  mediaRequestManager.commit();
614
613
  }
615
614
  );
@@ -666,8 +666,8 @@ describe('MediaRequestManager', () => {
666
666
  ]);
667
667
  });
668
668
 
669
- it('avoids sending duplicate requests and clears all the requests on reset()', () => {
670
- // send some requests and commit them one by one
669
+ it('clears all the requests on reset()', () => {
670
+ // send some requests and commit them
671
671
  addReceiverSelectedRequest(1500, fakeReceiveSlots[0], MAX_FS_1080p, false);
672
672
  addReceiverSelectedRequest(1501, fakeReceiveSlots[1], MAX_FS_1080p, false);
673
673
  addActiveSpeakerRequest(
@@ -722,95 +722,12 @@ describe('MediaRequestManager', () => {
722
722
  },
723
723
  ]);
724
724
 
725
- // check that when calling commit()
726
- // all requests are not re-sent again (avoid duplicate requests)
727
- mediaRequestManager.commit();
728
-
729
- assert.notCalled(sendMediaRequestsCallback);
730
-
731
- // now reset everything
732
- mediaRequestManager.reset();
733
-
734
- // calling commit now should not cause any requests to be sent out
735
- mediaRequestManager.commit();
736
- checkMediaRequestsSent([]);
737
- });
738
-
739
- it('makes sure to call requests correctly after reset was called and another request was added', () => {
740
- addReceiverSelectedRequest(1500, fakeReceiveSlots[0], MAX_FS_1080p, false);
741
-
742
- assert.notCalled(sendMediaRequestsCallback);
743
-
744
- mediaRequestManager.commit();
745
- checkMediaRequestsSent([
746
- {
747
- policy: 'receiver-selected',
748
- csi: 1500,
749
- receiveSlot: fakeWcmeSlots[0],
750
- maxPayloadBitsPerSecond: MAX_PAYLOADBITSPS_1080p,
751
- maxFs: MAX_FS_1080p,
752
- maxMbps: MAX_MBPS_1080p,
753
- },
754
- ]);
755
-
756
725
  // now reset everything
757
726
  mediaRequestManager.reset();
758
727
 
759
728
  // calling commit now should not cause any requests to be sent out
760
729
  mediaRequestManager.commit();
761
730
  checkMediaRequestsSent([]);
762
-
763
- //add new request
764
- addReceiverSelectedRequest(1501, fakeReceiveSlots[1], MAX_FS_1080p, false);
765
-
766
- // commit
767
- mediaRequestManager.commit();
768
-
769
- // check the new request was sent
770
- checkMediaRequestsSent([
771
- {
772
- policy: 'receiver-selected',
773
- csi: 1501,
774
- receiveSlot: fakeWcmeSlots[1],
775
- maxPayloadBitsPerSecond: MAX_PAYLOADBITSPS_1080p,
776
- maxFs: MAX_FS_1080p,
777
- maxMbps: MAX_MBPS_1080p,
778
- },
779
- ]);
780
- });
781
-
782
- it('can send same media request after previous requests have been cleared', () => {
783
- // add a request and commit
784
- addReceiverSelectedRequest(1500, fakeReceiveSlots[0], MAX_FS_1080p, false);
785
- mediaRequestManager.commit();
786
- checkMediaRequestsSent([
787
- {
788
- policy: 'receiver-selected',
789
- csi: 1500,
790
- maxPayloadBitsPerSecond: MAX_PAYLOADBITSPS_1080p,
791
- receiveSlot: fakeWcmeSlots[0],
792
- maxFs: MAX_FS_1080p,
793
- maxMbps: MAX_MBPS_1080p,
794
- },
795
- ]);
796
-
797
- // clear previous requests
798
- mediaRequestManager.clearPreviousRequests();
799
-
800
- // commit same request
801
- mediaRequestManager.commit();
802
-
803
- // check the request was sent
804
- checkMediaRequestsSent([
805
- {
806
- policy: 'receiver-selected',
807
- csi: 1500,
808
- maxPayloadBitsPerSecond: MAX_PAYLOADBITSPS_1080p,
809
- receiveSlot: fakeWcmeSlots[0],
810
- maxFs: MAX_FS_1080p,
811
- maxMbps: MAX_MBPS_1080p,
812
- },
813
- ]);
814
731
  });
815
732
 
816
733
  it('re-sends media requests after degradation preferences are set', () => {
@@ -54,8 +54,8 @@ describe('plugin-meetings', () => {
54
54
  webrtcMediaConnection: fakeMediaConnection,
55
55
  },
56
56
  mediaRequestManagers: {
57
- audio: {commit: sinon.stub(), clearPreviousRequests: sinon.stub()},
58
- video: {commit: sinon.stub(), clearPreviousRequests: sinon.stub()},
57
+ audio: {commit: sinon.stub()},
58
+ video: {commit: sinon.stub()},
59
59
  },
60
60
  roap: {
61
61
  doTurnDiscovery: sinon.stub().resolves({
@@ -179,26 +179,22 @@ describe('plugin-meetings', () => {
179
179
  });
180
180
  });
181
181
 
182
- it('does not clear previous requests and re-request media for non-multistream meetings', async () => {
182
+ it('does not re-request media for non-multistream meetings', async () => {
183
183
  fakeMeeting.isMultistream = false;
184
184
  const rm = new ReconnectionManager(fakeMeeting);
185
185
 
186
186
  await rm.reconnect();
187
187
 
188
- assert.notCalled(fakeMeeting.mediaRequestManagers.audio.clearPreviousRequests);
189
- assert.notCalled(fakeMeeting.mediaRequestManagers.video.clearPreviousRequests);
190
188
  assert.notCalled(fakeMeeting.mediaRequestManagers.audio.commit);
191
189
  assert.notCalled(fakeMeeting.mediaRequestManagers.video.commit);
192
190
  });
193
191
 
194
- it('does clear previous requests and re-request media for multistream meetings', async () => {
192
+ it('does re-request media for multistream meetings', async () => {
195
193
  fakeMeeting.isMultistream = true;
196
194
  const rm = new ReconnectionManager(fakeMeeting);
197
195
 
198
196
  await rm.reconnect();
199
197
 
200
- assert.calledOnce(fakeMeeting.mediaRequestManagers.audio.clearPreviousRequests);
201
- assert.calledOnce(fakeMeeting.mediaRequestManagers.video.clearPreviousRequests);
202
198
  assert.calledOnce(fakeMeeting.mediaRequestManagers.audio.commit);
203
199
  assert.calledOnce(fakeMeeting.mediaRequestManagers.video.commit);
204
200
  });