@webex/plugin-meetings 3.8.1-web-workers-keepalive.1 → 3.9.0-next.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/breakouts/breakout.js +1 -1
- package/dist/breakouts/index.js +1 -1
- package/dist/constants.js +24 -2
- package/dist/constants.js.map +1 -1
- package/dist/interpretation/index.js +1 -1
- package/dist/interpretation/siLanguage.js +1 -1
- package/dist/locus-info/index.js +39 -85
- package/dist/locus-info/index.js.map +1 -1
- package/dist/meeting/brbState.js +14 -12
- package/dist/meeting/brbState.js.map +1 -1
- package/dist/meeting/in-meeting-actions.js +6 -0
- package/dist/meeting/in-meeting-actions.js.map +1 -1
- package/dist/meeting/index.js +274 -140
- package/dist/meeting/index.js.map +1 -1
- package/dist/meeting/request.js +19 -0
- package/dist/meeting/request.js.map +1 -1
- package/dist/meeting/request.type.js.map +1 -1
- package/dist/meeting/type.js +7 -0
- package/dist/meeting/type.js.map +1 -0
- package/dist/meeting/util.js +68 -2
- package/dist/meeting/util.js.map +1 -1
- package/dist/meetings/index.js +35 -33
- package/dist/meetings/index.js.map +1 -1
- package/dist/member/index.js.map +1 -1
- package/dist/members/index.js +11 -9
- package/dist/members/index.js.map +1 -1
- package/dist/members/request.js +3 -3
- package/dist/members/request.js.map +1 -1
- package/dist/members/util.js +18 -6
- package/dist/members/util.js.map +1 -1
- package/dist/multistream/mediaRequestManager.js +1 -1
- package/dist/multistream/mediaRequestManager.js.map +1 -1
- package/dist/multistream/remoteMedia.js +34 -5
- package/dist/multistream/remoteMedia.js.map +1 -1
- package/dist/multistream/remoteMediaGroup.js +42 -2
- package/dist/multistream/remoteMediaGroup.js.map +1 -1
- package/dist/multistream/sendSlotManager.js +32 -2
- package/dist/multistream/sendSlotManager.js.map +1 -1
- package/dist/types/constants.d.ts +22 -0
- package/dist/types/locus-info/index.d.ts +0 -9
- package/dist/types/meeting/brbState.d.ts +0 -1
- package/dist/types/meeting/in-meeting-actions.d.ts +6 -0
- package/dist/types/meeting/index.d.ts +40 -19
- package/dist/types/meeting/request.d.ts +9 -1
- package/dist/types/meeting/request.type.d.ts +74 -0
- package/dist/types/meeting/type.d.ts +9 -0
- package/dist/types/meeting/util.d.ts +3 -0
- package/dist/types/members/index.d.ts +10 -7
- package/dist/types/members/request.d.ts +1 -1
- package/dist/types/members/util.d.ts +7 -3
- package/dist/types/multistream/remoteMedia.d.ts +20 -1
- package/dist/types/multistream/remoteMediaGroup.d.ts +11 -0
- package/dist/types/multistream/sendSlotManager.d.ts +16 -0
- package/dist/webinar/index.js +1 -1
- package/package.json +22 -23
- package/src/constants.ts +23 -2
- package/src/locus-info/index.ts +48 -86
- package/src/meeting/brbState.ts +9 -7
- package/src/meeting/in-meeting-actions.ts +13 -0
- package/src/meeting/index.ts +165 -38
- package/src/meeting/request.ts +16 -0
- package/src/meeting/request.type.ts +64 -0
- package/src/meeting/type.ts +9 -0
- package/src/meeting/util.ts +73 -2
- package/src/meetings/index.ts +3 -2
- package/src/member/index.ts +1 -0
- package/src/members/index.ts +13 -10
- package/src/members/request.ts +2 -2
- package/src/members/util.ts +16 -4
- package/src/multistream/mediaRequestManager.ts +7 -7
- package/src/multistream/remoteMedia.ts +34 -4
- package/src/multistream/remoteMediaGroup.ts +37 -2
- package/src/multistream/sendSlotManager.ts +34 -2
- package/test/unit/spec/locus-info/index.js +199 -83
- package/test/unit/spec/meeting/brbState.ts +9 -9
- package/test/unit/spec/meeting/in-meeting-actions.ts +6 -0
- package/test/unit/spec/meeting/index.js +729 -80
- package/test/unit/spec/meeting/request.js +71 -0
- package/test/unit/spec/meeting/utils.js +122 -1
- package/test/unit/spec/meetings/index.js +2 -0
- package/test/unit/spec/members/index.js +68 -9
- package/test/unit/spec/members/request.js +2 -2
- package/test/unit/spec/members/utils.js +27 -7
- package/test/unit/spec/multistream/mediaRequestManager.ts +19 -6
- package/test/unit/spec/multistream/remoteMedia.ts +66 -2
- package/test/unit/spec/multistream/sendSlotManager.ts +59 -0
- package/test/unit/spec/reachability/index.ts +3 -1
@@ -192,6 +192,9 @@ var RemoteMediaGroup = exports.RemoteMediaGroup = /*#__PURE__*/function () {
|
|
192
192
|
value: function sendActiveSpeakerMediaRequest(commit) {
|
193
193
|
var _this$options, _this$options$namedMe, _this$options2;
|
194
194
|
this.cancelActiveSpeakerMediaRequest(false);
|
195
|
+
|
196
|
+
// Calculate the effective maxFs based on all unpinned RemoteMedia instances
|
197
|
+
var effectiveMaxFs = this.getEffectiveMaxFsForActiveSpeaker();
|
195
198
|
this.mediaRequestId = this.mediaRequestManager.addRequest({
|
196
199
|
policyInfo: {
|
197
200
|
policy: 'active-speaker',
|
@@ -204,9 +207,9 @@ var RemoteMediaGroup = exports.RemoteMediaGroup = /*#__PURE__*/function () {
|
|
204
207
|
receiveSlots: this.unpinnedRemoteMedia.map(function (remoteMedia) {
|
205
208
|
return remoteMedia.getUnderlyingReceiveSlot();
|
206
209
|
}),
|
207
|
-
codecInfo:
|
210
|
+
codecInfo: effectiveMaxFs && {
|
208
211
|
codec: 'h264',
|
209
|
-
maxFs:
|
212
|
+
maxFs: effectiveMaxFs
|
210
213
|
}
|
211
214
|
}, commit);
|
212
215
|
}
|
@@ -275,6 +278,43 @@ var RemoteMediaGroup = exports.RemoteMediaGroup = /*#__PURE__*/function () {
|
|
275
278
|
}
|
276
279
|
return this.unpinnedRemoteMedia.includes(remoteMedia) || this.pinnedRemoteMedia.includes(remoteMedia);
|
277
280
|
}
|
281
|
+
|
282
|
+
/**
|
283
|
+
* Calculate the effective maxFs for the active speaker media request based on unpinned RemoteMedia instances
|
284
|
+
* @returns {number | undefined} The calculated maxFs value, or undefined if no constraints
|
285
|
+
* @private
|
286
|
+
*/
|
287
|
+
}, {
|
288
|
+
key: "getEffectiveMaxFsForActiveSpeaker",
|
289
|
+
value: function getEffectiveMaxFsForActiveSpeaker() {
|
290
|
+
// Get all effective maxFs values from unpinned RemoteMedia instances
|
291
|
+
var maxFsValues = this.unpinnedRemoteMedia.map(function (remoteMedia) {
|
292
|
+
return remoteMedia.getEffectiveMaxFs();
|
293
|
+
}).filter(function (maxFs) {
|
294
|
+
return maxFs !== undefined;
|
295
|
+
});
|
296
|
+
|
297
|
+
// Use the highest maxFs value to ensure we don't under-request resolution for any instance
|
298
|
+
if (maxFsValues.length > 0) {
|
299
|
+
return Math.max.apply(Math, (0, _toConsumableArray2.default)(maxFsValues));
|
300
|
+
}
|
301
|
+
|
302
|
+
// Fall back to group's resolution option
|
303
|
+
if (this.options.resolution) {
|
304
|
+
return (0, _remoteMedia.getMaxFs)(this.options.resolution);
|
305
|
+
}
|
306
|
+
return undefined;
|
307
|
+
}
|
308
|
+
|
309
|
+
/**
|
310
|
+
* Get the current effective maxFs that would be used for the active speaker media request
|
311
|
+
* @returns {number | undefined} The effective maxFs value
|
312
|
+
*/
|
313
|
+
}, {
|
314
|
+
key: "getEffectiveMaxFs",
|
315
|
+
value: function getEffectiveMaxFs() {
|
316
|
+
return this.getEffectiveMaxFsForActiveSpeaker();
|
317
|
+
}
|
278
318
|
}]);
|
279
319
|
return RemoteMediaGroup;
|
280
320
|
}();
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_lodash","require","_loggerProxy","_interopRequireDefault","_remoteMedia","RemoteMediaGroup","exports","mediaRequestManager","receiveSlots","priority","commitMediaRequest","_this","options","arguments","length","undefined","_classCallCheck2","default","_defineProperty2","unpinnedRemoteMedia","map","slot","RemoteMedia","resolution","pinnedRemoteMedia","sendActiveSpeakerMediaRequest","_createClass2","key","value","getRemoteMedia","filter","_toConsumableArray2","concat","setActiveSpeakerCsis","remoteMediaCsis","_this2","commit","forEach","_ref","csi","remoteMedia","indexOf","unpinId","splice","push","Error","id","sendMediaRequest","pinId","cancelMediaRequest","cancelActiveSpeakerMediaRequest","pin","targetCsi","LoggerProxy","logger","log","idx","unpin","isPinned","setPreferLiveVideo","preferLiveVideo","_this$options","_this$options$namedMe","_this$options2","mediaRequestId","addRequest","policyInfo","policy","crossPriorityDuplication","crossPolicyDuplication","namedMediaGroups","namedMediaGroup","getUnderlyingReceiveSlot","codecInfo","codec","maxFs","getMaxFs","cancelRequest","setNamedMediaGroup","type","stop","includes"],"sources":["remoteMediaGroup.ts"],"sourcesContent":["/* eslint-disable valid-jsdoc */\n/* eslint-disable require-jsdoc */\n/* eslint-disable import/prefer-default-export */\nimport {forEach} from 'lodash';\nimport {NamedMediaGroup} from '@webex/internal-media-core';\nimport LoggerProxy from '../common/logs/logger-proxy';\n\nimport {getMaxFs, RemoteMedia, RemoteVideoResolution} from './remoteMedia';\nimport {MediaRequestId, MediaRequestManager} from './mediaRequestManager';\nimport {CSI, ReceiveSlot} from './receiveSlot';\n\ntype Options = {\n resolution?: RemoteVideoResolution; // applies only to groups of type MediaType.VideoMain and MediaType.VideoSlides\n preferLiveVideo?: boolean; // applies only to groups of type MediaType.VideoMain and MediaType.VideoSlides\n namedMediaGroup?: NamedMediaGroup; // applies only to named media groups for audio\n};\n\nexport class RemoteMediaGroup {\n private mediaRequestManager: MediaRequestManager;\n\n private priority: number;\n\n private options: Options;\n\n private unpinnedRemoteMedia: RemoteMedia[];\n\n private mediaRequestId?: MediaRequestId; // id of the \"active-speaker\" media request id\n\n private pinnedRemoteMedia: RemoteMedia[];\n\n constructor(\n mediaRequestManager: MediaRequestManager,\n receiveSlots: ReceiveSlot[],\n priority: number,\n commitMediaRequest: boolean,\n options: Options = {}\n ) {\n this.mediaRequestManager = mediaRequestManager;\n this.priority = priority;\n this.options = options;\n\n this.unpinnedRemoteMedia = receiveSlots.map(\n (slot) =>\n new RemoteMedia(slot, this.mediaRequestManager, {\n resolution: this.options.resolution,\n })\n );\n this.pinnedRemoteMedia = [];\n\n this.sendActiveSpeakerMediaRequest(commitMediaRequest);\n }\n\n /**\n * Gets the array of remote media elements from the group\n *\n * @param {string} filter - 'all' (default) returns both pinned and unpinned\n * @returns {Array<RemoteMedia>}\n */\n public getRemoteMedia(filter: 'all' | 'pinned' | 'unpinned' = 'all') {\n if (filter === 'unpinned') {\n // return a shallow copy so that the client cannot modify this.unpinnedRemoteMedia array\n return [...this.unpinnedRemoteMedia];\n }\n if (filter === 'pinned') {\n // return a shallow copy so that the client cannot modify this.pinnedRemoteMedia array\n return [...this.pinnedRemoteMedia];\n }\n\n return [...this.unpinnedRemoteMedia, ...this.pinnedRemoteMedia];\n }\n\n /**\n * Sets CSIs for multiple RemoteMedia instances belonging to this RemoteMediaGroup.\n * For each entry in the remoteMediaCsis array:\n * - if csi is specified, the RemoteMedia instance is pinned to that CSI\n * - if csi is undefined, the RemoteMedia instance is unpinned\n * @internal\n */\n public setActiveSpeakerCsis(\n remoteMediaCsis: {remoteMedia: RemoteMedia; csi?: number}[],\n commit = true\n ): void {\n forEach(remoteMediaCsis, ({csi, remoteMedia}) => {\n if (csi) {\n if (!(this.pinnedRemoteMedia.indexOf(remoteMedia) >= 0)) {\n const unpinId = this.unpinnedRemoteMedia.indexOf(remoteMedia);\n if (unpinId >= 0) {\n this.unpinnedRemoteMedia.splice(unpinId, 1);\n this.pinnedRemoteMedia.push(remoteMedia);\n } else {\n throw new Error(\n `failed to pin a remote media object ${remoteMedia.id}, because it is not found in this remote media group`\n );\n }\n }\n remoteMedia.sendMediaRequest(csi, false);\n } else {\n if (!(this.unpinnedRemoteMedia.indexOf(remoteMedia) >= 0)) {\n const pinId = this.pinnedRemoteMedia.indexOf(remoteMedia);\n if (pinId >= 0) {\n this.pinnedRemoteMedia.splice(pinId, 1);\n this.unpinnedRemoteMedia.push(remoteMedia);\n } else {\n throw new Error(\n `failed to unpin a remote media object ${remoteMedia.id}, because it is not found in this remote media group`\n );\n }\n }\n remoteMedia.cancelMediaRequest(false);\n }\n });\n this.cancelActiveSpeakerMediaRequest(false);\n this.sendActiveSpeakerMediaRequest(false);\n if (commit) {\n this.mediaRequestManager.commit();\n }\n }\n\n /**\n * Pins a specific remote media instance to a specfic CSI, so the media will\n * no longer come from active speaker, but from that CSI.\n * If no CSI is given, the current CSI value is used.\n *\n */\n public pin(remoteMedia: RemoteMedia, csi?: CSI): void {\n // if csi is not specified, use the current one\n const targetCsi = csi || remoteMedia.csi;\n\n if (!targetCsi) {\n throw new Error(\n `failed to pin a remote media object ${remoteMedia.id}, because it has no CSI set and no CSI value was given`\n );\n }\n\n if (this.pinnedRemoteMedia.indexOf(remoteMedia) >= 0) {\n if (targetCsi === remoteMedia.csi) {\n // remote media already pinned to target CSI, nothing to do\n LoggerProxy.logger.log(\n `RemoteMediaGroup#pin --> remote media ${remoteMedia.id} already pinned`\n );\n\n return;\n }\n } else {\n const idx = this.unpinnedRemoteMedia.indexOf(remoteMedia);\n\n if (idx < 0) {\n throw new Error(\n `failed to pin a remote media object ${remoteMedia.id}, because it is not found in this remote media group`\n );\n }\n\n this.unpinnedRemoteMedia.splice(idx, 1);\n this.pinnedRemoteMedia.push(remoteMedia);\n\n this.cancelActiveSpeakerMediaRequest(false);\n this.sendActiveSpeakerMediaRequest(false);\n }\n\n remoteMedia.sendMediaRequest(targetCsi, false);\n this.mediaRequestManager.commit();\n }\n\n /**\n * Unpins a remote media instance, so that it will again provide media from active speakers\n *\n */\n public unpin(remoteMedia: RemoteMedia) {\n if (this.unpinnedRemoteMedia.indexOf(remoteMedia) >= 0) {\n LoggerProxy.logger.log(\n `RemoteMediaGroup#pin --> remote media ${remoteMedia.id} already unpinned`\n );\n\n return;\n }\n const idx = this.pinnedRemoteMedia.indexOf(remoteMedia);\n\n if (idx < 0) {\n throw new Error(\n `failed to unpin a remote media object ${remoteMedia.id}, because it is not found in this remote media group`\n );\n }\n\n this.pinnedRemoteMedia.splice(idx, 1);\n this.unpinnedRemoteMedia.push(remoteMedia);\n\n remoteMedia.cancelMediaRequest(false);\n this.cancelActiveSpeakerMediaRequest(false);\n this.sendActiveSpeakerMediaRequest(false);\n this.mediaRequestManager.commit();\n }\n\n public isPinned(remoteMedia: RemoteMedia) {\n if (this.unpinnedRemoteMedia.indexOf(remoteMedia) >= 0) {\n return false;\n }\n if (this.pinnedRemoteMedia.indexOf(remoteMedia) >= 0) {\n return true;\n }\n\n throw new Error(`remote media object ${remoteMedia.id} not found in the group`);\n }\n\n /**\n * setPreferLiveVideo - sets preferLiveVideo to true/false\n * @internal\n */\n public setPreferLiveVideo(preferLiveVideo: boolean, commit: boolean) {\n if (this.options.preferLiveVideo !== preferLiveVideo) {\n this.options.preferLiveVideo = preferLiveVideo;\n this.sendActiveSpeakerMediaRequest(commit);\n }\n }\n\n private sendActiveSpeakerMediaRequest(commit: boolean) {\n this.cancelActiveSpeakerMediaRequest(false);\n\n this.mediaRequestId = this.mediaRequestManager.addRequest(\n {\n policyInfo: {\n policy: 'active-speaker',\n priority: this.priority,\n crossPriorityDuplication: false,\n crossPolicyDuplication: false,\n preferLiveVideo: !!this.options?.preferLiveVideo,\n namedMediaGroups: this.options.namedMediaGroup?.value\n ? [this.options?.namedMediaGroup]\n : undefined,\n },\n receiveSlots: this.unpinnedRemoteMedia.map((remoteMedia) =>\n remoteMedia.getUnderlyingReceiveSlot()\n ) as ReceiveSlot[],\n codecInfo: this.options.resolution && {\n codec: 'h264',\n maxFs: getMaxFs(this.options.resolution),\n },\n },\n commit\n );\n }\n\n private cancelActiveSpeakerMediaRequest(commit: boolean) {\n if (this.mediaRequestId) {\n this.mediaRequestManager.cancelRequest(this.mediaRequestId, commit);\n this.mediaRequestId = undefined;\n }\n }\n\n /**\n * setNamedMediaGroup - sets named media group type and value\n * @internal\n */\n public setNamedMediaGroup(namedMediaGroup: NamedMediaGroup, commit: boolean) {\n if (\n this.options.namedMediaGroup.value !== namedMediaGroup.value ||\n this.options.namedMediaGroup.type !== namedMediaGroup.type\n ) {\n this.options.namedMediaGroup = namedMediaGroup;\n this.sendActiveSpeakerMediaRequest(commit);\n }\n }\n\n /**\n * Invalidates the remote media group by clearing the references to the receive slots\n * used by all remote media from that group and cancelling all media requests.\n * After this call the remote media group is unusable.\n *\n * @param{boolean} commit whether to commit the cancellation of media requests\n * @internal\n */\n public stop(commit = true) {\n this.unpinnedRemoteMedia.forEach((remoteMedia) => remoteMedia.stop(false));\n this.pinnedRemoteMedia.forEach((remoteMedia) => remoteMedia.stop(false));\n this.cancelActiveSpeakerMediaRequest(false);\n\n if (commit) {\n this.mediaRequestManager.commit();\n }\n }\n\n /**\n * Checks if a given RemoteMedia instance belongs to this group.\n *\n * @param remoteMedia RemoteMedia instance to check\n * @param filter controls which remote media from the group to check\n * @returns true if remote media is found\n */\n public includes(\n remoteMedia: RemoteMedia,\n filter: 'all' | 'pinned' | 'unpinned' = 'all'\n ): boolean {\n if (filter === 'pinned') {\n return this.pinnedRemoteMedia.includes(remoteMedia);\n }\n if (filter === 'unpinned') {\n return this.unpinnedRemoteMedia.includes(remoteMedia);\n }\n\n return (\n this.unpinnedRemoteMedia.includes(remoteMedia) || this.pinnedRemoteMedia.includes(remoteMedia)\n );\n }\n}\n"],"mappings":";;;;;;;;;;;;AAGA,IAAAA,OAAA,GAAAC,OAAA;AAEA,IAAAC,YAAA,GAAAC,sBAAA,CAAAF,OAAA;AAEA,IAAAG,YAAA,GAAAH,OAAA;AAPA;AACA;AACA;AAAA,IAeaI,gBAAgB,GAAAC,OAAA,CAAAD,gBAAA;EAa3B,SAAAA,iBACEE,mBAAwC,EACxCC,YAA2B,EAC3BC,QAAgB,EAChBC,kBAA2B,EAE3B;IAAA,IAAAC,KAAA;IAAA,IADAC,OAAgB,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,CAAC,CAAC;IAAA,IAAAG,gBAAA,CAAAC,OAAA,QAAAZ,gBAAA;IAAA,IAAAa,gBAAA,CAAAD,OAAA;IAAA,IAAAC,gBAAA,CAAAD,OAAA;IAAA,IAAAC,gBAAA,CAAAD,OAAA;IAAA,IAAAC,gBAAA,CAAAD,OAAA;IAAA,IAAAC,gBAAA,CAAAD,OAAA;IATkB;IAAA,IAAAC,gBAAA,CAAAD,OAAA;IAWvC,IAAI,CAACV,mBAAmB,GAAGA,mBAAm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M,CAAC,CAAC;MACnC;IACF;;IAEA;AACF;AACA;AACA;AACA;AACA;AACA;EANE;IAAAT,GAAA;IAAAC,KAAA,EAOA,SAAAqD,SACEzC,WAAwB,EAEf;MAAA,IADTV,MAAqC,GAAAjB,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,KAAK;MAE7C,IAAIiB,MAAM,KAAK,QAAQ,EAAE;QACvB,OAAO,IAAI,CAACN,iBAAiB,CAACyD,QAAQ,CAACzC,WAAW,CAAC;MACrD;MACA,IAAIV,MAAM,KAAK,UAAU,EAAE;QACzB,OAAO,IAAI,CAACX,mBAAmB,CAAC8D,QAAQ,CAACzC,WAAW,CAAC;MACvD;MAEA,OACE,IAAI,CAACrB,mBAAmB,CAAC8D,QAAQ,CAACzC,WAAW,CAAC,IAAI,IAAI,CAAChB,iBAAiB,CAACyD,QAAQ,CAACzC,WAAW,CAAC;IAElG;EAAC;EAAA,OAAAnC,gBAAA;AAAA"}
|
1
|
+
{"version":3,"names":["_lodash","require","_loggerProxy","_interopRequireDefault","_remoteMedia","RemoteMediaGroup","exports","mediaRequestManager","receiveSlots","priority","commitMediaRequest","_this","options","arguments","length","undefined","_classCallCheck2","default","_defineProperty2","unpinnedRemoteMedia","map","slot","RemoteMedia","resolution","pinnedRemoteMedia","sendActiveSpeakerMediaRequest","_createClass2","key","value","getRemoteMedia","filter","_toConsumableArray2","concat","setActiveSpeakerCsis","remoteMediaCsis","_this2","commit","forEach","_ref","csi","remoteMedia","indexOf","unpinId","splice","push","Error","id","sendMediaRequest","pinId","cancelMediaRequest","cancelActiveSpeakerMediaRequest","pin","targetCsi","LoggerProxy","logger","log","idx","unpin","isPinned","setPreferLiveVideo","preferLiveVideo","_this$options","_this$options$namedMe","_this$options2","effectiveMaxFs","getEffectiveMaxFsForActiveSpeaker","mediaRequestId","addRequest","policyInfo","policy","crossPriorityDuplication","crossPolicyDuplication","namedMediaGroups","namedMediaGroup","getUnderlyingReceiveSlot","codecInfo","codec","maxFs","cancelRequest","setNamedMediaGroup","type","stop","includes","maxFsValues","getEffectiveMaxFs","Math","max","apply","getMaxFs"],"sources":["remoteMediaGroup.ts"],"sourcesContent":["/* eslint-disable valid-jsdoc */\n/* eslint-disable require-jsdoc */\n/* eslint-disable import/prefer-default-export */\nimport {forEach} from 'lodash';\nimport {NamedMediaGroup} from '@webex/internal-media-core';\nimport LoggerProxy from '../common/logs/logger-proxy';\n\nimport {getMaxFs, RemoteMedia, RemoteVideoResolution} from './remoteMedia';\nimport {MediaRequestId, MediaRequestManager} from './mediaRequestManager';\nimport {CSI, ReceiveSlot} from './receiveSlot';\n\ntype Options = {\n resolution?: RemoteVideoResolution; // applies only to groups of type MediaType.VideoMain and MediaType.VideoSlides\n preferLiveVideo?: boolean; // applies only to groups of type MediaType.VideoMain and MediaType.VideoSlides\n namedMediaGroup?: NamedMediaGroup; // applies only to named media groups for audio\n};\n\nexport class RemoteMediaGroup {\n private mediaRequestManager: MediaRequestManager;\n\n private priority: number;\n\n private options: Options;\n\n private unpinnedRemoteMedia: RemoteMedia[];\n\n private mediaRequestId?: MediaRequestId; // id of the \"active-speaker\" media request id\n\n private pinnedRemoteMedia: RemoteMedia[];\n\n constructor(\n mediaRequestManager: MediaRequestManager,\n receiveSlots: ReceiveSlot[],\n priority: number,\n commitMediaRequest: boolean,\n options: Options = {}\n ) {\n this.mediaRequestManager = mediaRequestManager;\n this.priority = priority;\n this.options = options;\n\n this.unpinnedRemoteMedia = receiveSlots.map(\n (slot) =>\n new RemoteMedia(slot, this.mediaRequestManager, {\n resolution: this.options.resolution,\n })\n );\n this.pinnedRemoteMedia = [];\n\n this.sendActiveSpeakerMediaRequest(commitMediaRequest);\n }\n\n /**\n * Gets the array of remote media elements from the group\n *\n * @param {string} filter - 'all' (default) returns both pinned and unpinned\n * @returns {Array<RemoteMedia>}\n */\n public getRemoteMedia(filter: 'all' | 'pinned' | 'unpinned' = 'all') {\n if (filter === 'unpinned') {\n // return a shallow copy so that the client cannot modify this.unpinnedRemoteMedia array\n return [...this.unpinnedRemoteMedia];\n }\n if (filter === 'pinned') {\n // return a shallow copy so that the client cannot modify this.pinnedRemoteMedia array\n return [...this.pinnedRemoteMedia];\n }\n\n return [...this.unpinnedRemoteMedia, ...this.pinnedRemoteMedia];\n }\n\n /**\n * Sets CSIs for multiple RemoteMedia instances belonging to this RemoteMediaGroup.\n * For each entry in the remoteMediaCsis array:\n * - if csi is specified, the RemoteMedia instance is pinned to that CSI\n * - if csi is undefined, the RemoteMedia instance is unpinned\n * @internal\n */\n public setActiveSpeakerCsis(\n remoteMediaCsis: {remoteMedia: RemoteMedia; csi?: number}[],\n commit = true\n ): void {\n forEach(remoteMediaCsis, ({csi, remoteMedia}) => {\n if (csi) {\n if (!(this.pinnedRemoteMedia.indexOf(remoteMedia) >= 0)) {\n const unpinId = this.unpinnedRemoteMedia.indexOf(remoteMedia);\n if (unpinId >= 0) {\n this.unpinnedRemoteMedia.splice(unpinId, 1);\n this.pinnedRemoteMedia.push(remoteMedia);\n } else {\n throw new Error(\n `failed to pin a remote media object ${remoteMedia.id}, because it is not found in this remote media group`\n );\n }\n }\n remoteMedia.sendMediaRequest(csi, false);\n } else {\n if (!(this.unpinnedRemoteMedia.indexOf(remoteMedia) >= 0)) {\n const pinId = this.pinnedRemoteMedia.indexOf(remoteMedia);\n if (pinId >= 0) {\n this.pinnedRemoteMedia.splice(pinId, 1);\n this.unpinnedRemoteMedia.push(remoteMedia);\n } else {\n throw new Error(\n `failed to unpin a remote media object ${remoteMedia.id}, because it is not found in this remote media group`\n );\n }\n }\n remoteMedia.cancelMediaRequest(false);\n }\n });\n this.cancelActiveSpeakerMediaRequest(false);\n this.sendActiveSpeakerMediaRequest(false);\n if (commit) {\n this.mediaRequestManager.commit();\n }\n }\n\n /**\n * Pins a specific remote media instance to a specfic CSI, so the media will\n * no longer come from active speaker, but from that CSI.\n * If no CSI is given, the current CSI value is used.\n *\n */\n public pin(remoteMedia: RemoteMedia, csi?: CSI): void {\n // if csi is not specified, use the current one\n const targetCsi = csi || remoteMedia.csi;\n\n if (!targetCsi) {\n throw new Error(\n `failed to pin a remote media object ${remoteMedia.id}, because it has no CSI set and no CSI value was given`\n );\n }\n\n if (this.pinnedRemoteMedia.indexOf(remoteMedia) >= 0) {\n if (targetCsi === remoteMedia.csi) {\n // remote media already pinned to target CSI, nothing to do\n LoggerProxy.logger.log(\n `RemoteMediaGroup#pin --> remote media ${remoteMedia.id} already pinned`\n );\n\n return;\n }\n } else {\n const idx = this.unpinnedRemoteMedia.indexOf(remoteMedia);\n\n if (idx < 0) {\n throw new Error(\n `failed to pin a remote media object ${remoteMedia.id}, because it is not found in this remote media group`\n );\n }\n\n this.unpinnedRemoteMedia.splice(idx, 1);\n this.pinnedRemoteMedia.push(remoteMedia);\n\n this.cancelActiveSpeakerMediaRequest(false);\n this.sendActiveSpeakerMediaRequest(false);\n }\n\n remoteMedia.sendMediaRequest(targetCsi, false);\n this.mediaRequestManager.commit();\n }\n\n /**\n * Unpins a remote media instance, so that it will again provide media from active speakers\n *\n */\n public unpin(remoteMedia: RemoteMedia) {\n if (this.unpinnedRemoteMedia.indexOf(remoteMedia) >= 0) {\n LoggerProxy.logger.log(\n `RemoteMediaGroup#pin --> remote media ${remoteMedia.id} already unpinned`\n );\n\n return;\n }\n const idx = this.pinnedRemoteMedia.indexOf(remoteMedia);\n\n if (idx < 0) {\n throw new Error(\n `failed to unpin a remote media object ${remoteMedia.id}, because it is not found in this remote media group`\n );\n }\n\n this.pinnedRemoteMedia.splice(idx, 1);\n this.unpinnedRemoteMedia.push(remoteMedia);\n\n remoteMedia.cancelMediaRequest(false);\n this.cancelActiveSpeakerMediaRequest(false);\n this.sendActiveSpeakerMediaRequest(false);\n this.mediaRequestManager.commit();\n }\n\n public isPinned(remoteMedia: RemoteMedia) {\n if (this.unpinnedRemoteMedia.indexOf(remoteMedia) >= 0) {\n return false;\n }\n if (this.pinnedRemoteMedia.indexOf(remoteMedia) >= 0) {\n return true;\n }\n\n throw new Error(`remote media object ${remoteMedia.id} not found in the group`);\n }\n\n /**\n * setPreferLiveVideo - sets preferLiveVideo to true/false\n * @internal\n */\n public setPreferLiveVideo(preferLiveVideo: boolean, commit: boolean) {\n if (this.options.preferLiveVideo !== preferLiveVideo) {\n this.options.preferLiveVideo = preferLiveVideo;\n this.sendActiveSpeakerMediaRequest(commit);\n }\n }\n\n private sendActiveSpeakerMediaRequest(commit: boolean) {\n this.cancelActiveSpeakerMediaRequest(false);\n\n // Calculate the effective maxFs based on all unpinned RemoteMedia instances\n const effectiveMaxFs = this.getEffectiveMaxFsForActiveSpeaker();\n\n this.mediaRequestId = this.mediaRequestManager.addRequest(\n {\n policyInfo: {\n policy: 'active-speaker',\n priority: this.priority,\n crossPriorityDuplication: false,\n crossPolicyDuplication: false,\n preferLiveVideo: !!this.options?.preferLiveVideo,\n namedMediaGroups: this.options.namedMediaGroup?.value\n ? [this.options?.namedMediaGroup]\n : undefined,\n },\n receiveSlots: this.unpinnedRemoteMedia.map((remoteMedia) =>\n remoteMedia.getUnderlyingReceiveSlot()\n ) as ReceiveSlot[],\n codecInfo: effectiveMaxFs && {\n codec: 'h264',\n maxFs: effectiveMaxFs,\n },\n },\n commit\n );\n }\n\n private cancelActiveSpeakerMediaRequest(commit: boolean) {\n if (this.mediaRequestId) {\n this.mediaRequestManager.cancelRequest(this.mediaRequestId, commit);\n this.mediaRequestId = undefined;\n }\n }\n\n /**\n * setNamedMediaGroup - sets named media group type and value\n * @internal\n */\n public setNamedMediaGroup(namedMediaGroup: NamedMediaGroup, commit: boolean) {\n if (\n this.options.namedMediaGroup.value !== namedMediaGroup.value ||\n this.options.namedMediaGroup.type !== namedMediaGroup.type\n ) {\n this.options.namedMediaGroup = namedMediaGroup;\n this.sendActiveSpeakerMediaRequest(commit);\n }\n }\n\n /**\n * Invalidates the remote media group by clearing the references to the receive slots\n * used by all remote media from that group and cancelling all media requests.\n * After this call the remote media group is unusable.\n *\n * @param{boolean} commit whether to commit the cancellation of media requests\n * @internal\n */\n public stop(commit = true) {\n this.unpinnedRemoteMedia.forEach((remoteMedia) => remoteMedia.stop(false));\n this.pinnedRemoteMedia.forEach((remoteMedia) => remoteMedia.stop(false));\n this.cancelActiveSpeakerMediaRequest(false);\n\n if (commit) {\n this.mediaRequestManager.commit();\n }\n }\n\n /**\n * Checks if a given RemoteMedia instance belongs to this group.\n *\n * @param remoteMedia RemoteMedia instance to check\n * @param filter controls which remote media from the group to check\n * @returns true if remote media is found\n */\n public includes(\n remoteMedia: RemoteMedia,\n filter: 'all' | 'pinned' | 'unpinned' = 'all'\n ): boolean {\n if (filter === 'pinned') {\n return this.pinnedRemoteMedia.includes(remoteMedia);\n }\n if (filter === 'unpinned') {\n return this.unpinnedRemoteMedia.includes(remoteMedia);\n }\n\n return (\n this.unpinnedRemoteMedia.includes(remoteMedia) || this.pinnedRemoteMedia.includes(remoteMedia)\n );\n }\n\n /**\n * Calculate the effective maxFs for the active speaker media request based on unpinned RemoteMedia instances\n * @returns {number | undefined} The calculated maxFs value, or undefined if no constraints\n * @private\n */\n private getEffectiveMaxFsForActiveSpeaker(): number | undefined {\n // Get all effective maxFs values from unpinned RemoteMedia instances\n const maxFsValues = this.unpinnedRemoteMedia\n .map((remoteMedia) => remoteMedia.getEffectiveMaxFs())\n .filter((maxFs) => maxFs !== undefined);\n\n // Use the highest maxFs value to ensure we don't under-request resolution for any instance\n if (maxFsValues.length > 0) {\n return Math.max(...maxFsValues);\n }\n\n // Fall back to group's resolution option\n if (this.options.resolution) {\n return getMaxFs(this.options.resolution);\n }\n\n return undefined;\n }\n\n /**\n * Get the current effective maxFs that would be used for the active speaker media request\n * @returns {number | undefined} The effective maxFs value\n */\n public getEffectiveMaxFs(): number | undefined {\n return this.getEffectiveMaxFsForActiveSpeaker();\n }\n}\n"],"mappings":";;;;;;;;;;;;AAGA,IAAAA,OAAA,GAAAC,OAAA;AAEA,IAAAC,YAAA,GAAAC,sBAAA,CAAAF,OAAA;AAE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,EAKA,SAAAqC,kCAAA,EAAgE;MAC9D;MACA,IAAMkB,WAAW,GAAG,IAAI,CAAChE,mBAAmB,CACzCC,GAAG,CAAC,UAACoB,WAAW;QAAA,OAAKA,WAAW,CAAC4C,iBAAiB,CAAC,CAAC;MAAA,EAAC,CACrDtD,MAAM,CAAC,UAAC+C,KAAK;QAAA,OAAKA,KAAK,KAAK9D,SAAS;MAAA,EAAC;;MAEzC;MACA,IAAIoE,WAAW,CAACrE,MAAM,GAAG,CAAC,EAAE;QAC1B,OAAOuE,IAAI,CAACC,GAAG,CAAAC,KAAA,CAARF,IAAI,MAAAtD,mBAAA,CAAAd,OAAA,EAAQkE,WAAW,EAAC;MACjC;;MAEA;MACA,IAAI,IAAI,CAACvE,OAAO,CAACW,UAAU,EAAE;QAC3B,OAAO,IAAAiE,qBAAQ,EAAC,IAAI,CAAC5E,OAAO,CAACW,UAAU,CAAC;MAC1C;MAEA,OAAOR,SAAS;IAClB;;IAEA;AACF;AACA;AACA;EAHE;IAAAY,GAAA;IAAAC,KAAA,EAIA,SAAAwD,kBAAA,EAA+C;MAC7C,OAAO,IAAI,CAACnB,iCAAiC,CAAC,CAAC;IACjD;EAAC;EAAA,OAAA5D,gBAAA;AAAA"}
|
@@ -13,11 +13,21 @@ var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime-corejs2/he
|
|
13
13
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/createClass"));
|
14
14
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/defineProperty"));
|
15
15
|
var _internalMediaCore = require("@webex/internal-media-core");
|
16
|
+
/**
|
17
|
+
* This class is used to manage the sendSlots for the given media types.
|
18
|
+
*/
|
16
19
|
var SendSlotManager = exports.default = /*#__PURE__*/function () {
|
20
|
+
/**
|
21
|
+
* Constructor for SendSlotManager
|
22
|
+
*
|
23
|
+
* @param {any} LoggerProxy is used to log the messages
|
24
|
+
* @constructor
|
25
|
+
*/
|
17
26
|
function SendSlotManager(LoggerProxy) {
|
18
27
|
(0, _classCallCheck2.default)(this, SendSlotManager);
|
19
28
|
(0, _defineProperty2.default)(this, "slots", new _map.default());
|
20
29
|
(0, _defineProperty2.default)(this, "LoggerProxy", void 0);
|
30
|
+
(0, _defineProperty2.default)(this, "sourceStateOverrides", new _map.default());
|
21
31
|
this.LoggerProxy = LoggerProxy;
|
22
32
|
}
|
23
33
|
|
@@ -87,18 +97,38 @@ var SendSlotManager = exports.default = /*#__PURE__*/function () {
|
|
87
97
|
key: "setSourceStateOverride",
|
88
98
|
value: function setSourceStateOverride(mediaType, state) {
|
89
99
|
if (mediaType !== _internalMediaCore.MediaType.VideoMain) {
|
90
|
-
throw new Error("
|
100
|
+
throw new Error("Invalid media type '".concat(mediaType, "'. Source state overrides are only applicable to ").concat(_internalMediaCore.MediaType.VideoMain, "."));
|
91
101
|
}
|
92
102
|
var slot = this.slots.get(mediaType);
|
93
103
|
if (!slot) {
|
94
104
|
throw new Error("Slot for ".concat(mediaType, " does not exist"));
|
95
105
|
}
|
106
|
+
var currentStateOverride = this.getSourceStateOverride(mediaType);
|
107
|
+
if (currentStateOverride === state) {
|
108
|
+
return;
|
109
|
+
}
|
96
110
|
if (state) {
|
97
111
|
slot.setSourceStateOverride(state);
|
112
|
+
this.sourceStateOverrides.set(mediaType, state);
|
98
113
|
} else {
|
99
114
|
slot.clearSourceStateOverride();
|
115
|
+
this.sourceStateOverrides.delete(mediaType);
|
116
|
+
}
|
117
|
+
this.LoggerProxy.logger.info("SendSlotManager->setSourceStateOverride#set source state override for ".concat(mediaType, " to ").concat(state));
|
118
|
+
}
|
119
|
+
|
120
|
+
/**
|
121
|
+
* Gets the source state override for the given media type.
|
122
|
+
* @param {MediaType} mediaType - The type of media to get the source state override for.
|
123
|
+
* @returns {StreamState | null} - The current source state override or null if not set.
|
124
|
+
*/
|
125
|
+
}, {
|
126
|
+
key: "getSourceStateOverride",
|
127
|
+
value: function getSourceStateOverride(mediaType) {
|
128
|
+
if (mediaType !== _internalMediaCore.MediaType.VideoMain) {
|
129
|
+
throw new Error("Invalid media type '".concat(mediaType, "'. Source state overrides are only applicable to ").concat(_internalMediaCore.MediaType.VideoMain, "."));
|
100
130
|
}
|
101
|
-
this.
|
131
|
+
return this.sourceStateOverrides.get(mediaType) || null;
|
102
132
|
}
|
103
133
|
|
104
134
|
/**
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_internalMediaCore","require","SendSlotManager","exports","default","LoggerProxy","_classCallCheck2","_defineProperty2","_map","_createClass2","key","value","createSlot","mediaConnection","mediaType","active","arguments","length","undefined","slots","has","Error","concat","slot","createSendSlot","set","logger","info","getSlot","get","setNamedMediaGroups","namedMediaGroups","MediaType","AudioMain","setSourceStateOverride","state","VideoMain","clearSourceStateOverride","_publishStream","_asyncToGenerator2","_regenerator","mark","_callee","stream","wrap","_callee$","_context","prev","next","publishStream","label","muted","stop","_x","_x2","apply","_unpublishStream","_callee2","_callee2$","_context2","unpublishStream","_x3","setActive","_setCodecParameters","_callee3","codecParameters","_callee3$","_context3","setCodecParameters","_x4","_x5","_deleteCodecParameters","_callee4","parameters","_callee4$","_context4","deleteCodecParameters","_x6","_x7","reset","clear"],"sources":["sendSlotManager.ts"],"sourcesContent":["import {\n SendSlot,\n MediaType,\n LocalStream,\n MultistreamRoapMediaConnection,\n NamedMediaGroup,\n StreamState,\n} from '@webex/internal-media-core';\n\nexport default class SendSlotManager {\n private readonly slots: Map<MediaType, SendSlot> = new Map();\n private readonly LoggerProxy: any;\n\n constructor(LoggerProxy: any) {\n this.LoggerProxy = LoggerProxy;\n }\n\n /**\n * This method is used to create a sendSlot for the given mediaType and returns the created sendSlot\n * @param {MultistreamRoapMediaConnection} mediaConnection MultistreamRoapMediaConnection for which a sendSlot needs to be created\n * @param {MediaType} mediaType MediaType for which a sendSlot needs to be created (AUDIO_MAIN/VIDEO_MAIN/AUDIO_SLIDES/VIDEO_SLIDES)\n * @param {boolean} active This is optional boolean to set the active state of the sendSlot. Default is true\n * @returns {SendSlot} slot The created sendSlot\n */\n public createSlot(\n mediaConnection: MultistreamRoapMediaConnection,\n mediaType: MediaType,\n active = true\n ): SendSlot {\n if (this.slots.has(mediaType)) {\n throw new Error(`Slot for ${mediaType} already exists`);\n }\n\n const slot: SendSlot = mediaConnection.createSendSlot(mediaType, active);\n\n this.slots.set(mediaType, slot);\n\n this.LoggerProxy.logger.info(\n `SendSlotsManager->createSlot#Created slot for ${mediaType} with active ${active}`\n );\n\n return slot;\n }\n\n /**\n * This method is used to retrieve the sendSlot for the given mediaType\n * @param {MediaType} mediaType of which the slot needs to be retrieved\n * @returns {SendSlot}\n */\n public getSlot(mediaType: MediaType): SendSlot {\n const slot = this.slots.get(mediaType);\n\n if (!slot) {\n throw new Error(`Slot for ${mediaType} does not exist`);\n }\n\n return slot;\n }\n\n /**\n * Allow users to specify 'namedMediaGroups' to indicate which named media group its audio should be sent to.\n * @param {MediaType} mediaType MediaType of the sendSlot to which the audio stream needs to be send to the media group\n * @param {[]}namedMediaGroups - Allow users to specify 'namedMediaGroups'.If the value of 'namedMediaGroups' is zero,\n * named media group will be canceled and the audio stream will be sent to the floor.\n * @returns {void}\n */\n public setNamedMediaGroups(mediaType: MediaType, namedMediaGroups: NamedMediaGroup[]) {\n if (mediaType !== MediaType.AudioMain) {\n throw new Error(\n `sendSlotManager cannot set named media group which media type is ${mediaType}`\n );\n }\n\n const slot = this.slots.get(mediaType);\n\n if (!slot) {\n throw new Error(`Slot for ${mediaType} does not exist`);\n }\n\n slot.setNamedMediaGroups(namedMediaGroups);\n\n this.LoggerProxy.logger.info(\n `SendSlotsManager->setNamedMediaGroups#set named media group ${namedMediaGroups}`\n );\n }\n\n /**\n * Sets the source state override for the given media type.\n * @param {MediaType} mediaType - The type of media (must be MediaType.VideoMain to apply source state changes).\n * @param {StreamState | null} state - The state to set or null to clear the override value.\n * @returns {void}\n */\n public setSourceStateOverride(mediaType: MediaType, state: StreamState | null) {\n if (mediaType !== MediaType.VideoMain) {\n throw new Error(\n `sendSlotManager cannot set source state override which media type is ${mediaType}`\n );\n }\n\n const slot = this.slots.get(mediaType);\n\n if (!slot) {\n throw new Error(`Slot for ${mediaType} does not exist`);\n }\n\n if (state) {\n slot.setSourceStateOverride(state);\n } else {\n slot.clearSourceStateOverride();\n }\n\n this.LoggerProxy.logger.info(\n `SendSlotsManager->setSourceStateOverride#set source state override for ${mediaType} to ${state}`\n );\n }\n\n /**\n * This method publishes the given stream to the sendSlot for the given mediaType\n * @param {MediaType} mediaType MediaType of the sendSlot to which a stream needs to be published (AUDIO_MAIN/VIDEO_MAIN/AUDIO_SLIDES/VIDEO_SLIDES)\n * @param {LocalStream} stream LocalStream to be published\n * @returns {Promise<void>}\n */\n public async publishStream(mediaType: MediaType, stream: LocalStream): Promise<void> {\n const slot = this.slots.get(mediaType);\n\n if (!slot) {\n throw new Error(`Slot for ${mediaType} does not exist`);\n }\n\n await slot.publishStream(stream);\n\n this.LoggerProxy.logger.info(\n `SendSlotsManager->publishStream#Published stream for ${mediaType} and stream with label ${stream.label} and muted ${stream.muted}`\n );\n }\n\n /**\n * This method unpublishes the stream from the sendSlot of the given mediaType\n * @param {MediaType} mediaType MediaType of the sendSlot from which a stream needs to be unpublished (AUDIO_MAIN/VIDEO_MAIN/AUDIO_SLIDES/VIDEO_SLIDES)\n * @returns {Promise<void>}\n */\n public async unpublishStream(mediaType: MediaType): Promise<void> {\n const slot = this.slots.get(mediaType);\n\n if (!slot) {\n throw new Error(`Slot for ${mediaType} does not exist`);\n }\n\n await slot.unpublishStream();\n\n this.LoggerProxy.logger.info(\n `SendSlotsManager->unpublishStream#Unpublished stream for ${mediaType}`\n );\n }\n\n /**\n * This method is used to set the active state of the sendSlot for the given mediaType\n * @param {MediaType} mediaType The MediaType of the sendSlot for which the active state needs to be set (AUDIO_MAIN/VIDEO_MAIN/AUDIO_SLIDES/VIDEO_SLIDES)\n * @param {boolean} active The boolean to set the active state of the sendSlot. Default is true\n * @returns {void}\n */\n public setActive(mediaType: MediaType, active = true): void {\n const slot = this.slots.get(mediaType);\n\n if (!slot) {\n throw new Error(`Slot for ${mediaType} does not exist`);\n }\n\n slot.active = active;\n\n this.LoggerProxy.logger.info(\n `SendSlotsManager->setActive#Set active for ${mediaType} to ${active}`\n );\n }\n\n /**\n * This method is used to set the codec parameters for the sendSlot of the given mediaType\n * @param {MediaType} mediaType MediaType of the sendSlot for which the codec parameters needs to be set (AUDIO_MAIN/VIDEO_MAIN/AUDIO_SLIDES/VIDEO_SLIDES)\n * @param {Object} codecParameters\n * @returns {Promise<void>}\n */\n public async setCodecParameters(\n mediaType: MediaType,\n codecParameters: {\n [key: string]: string | undefined; // As per ts-sdp undefined is considered as a valid value to be used for codec parameters\n }\n ): Promise<void> {\n // These codec parameter changes underneath are SDP value changes that are taken care by WCME automatically. So no need for any change in streams from the web sdk side\n const slot = this.slots.get(mediaType);\n\n if (!slot) {\n throw new Error(`Slot for ${mediaType} does not exist`);\n }\n\n await slot.setCodecParameters(codecParameters);\n\n this.LoggerProxy.logger.info(\n `SendSlotsManager->setCodecParameters#Set codec parameters for ${mediaType} to ${codecParameters}`\n );\n }\n\n /**\n * This method is used to delete the codec parameters for the sendSlot of the given mediaType\n * @param {MediaType} mediaType MediaType of the sendSlot for which the codec parameters needs to be deleted (AUDIO_MAIN/VIDEO_MAIN/AUDIO_SLIDES/VIDEO_SLIDES)\n * @param {Array<String>} parameters Array of keys of the codec parameters to be deleted\n * @returns {Promise<void>}\n */\n public async deleteCodecParameters(mediaType: MediaType, parameters: string[]): Promise<void> {\n const slot = this.slots.get(mediaType);\n\n if (!slot) {\n throw new Error(`Slot for ${mediaType} does not exist`);\n }\n\n await slot.deleteCodecParameters(parameters);\n\n this.LoggerProxy.logger.info(\n `SendSlotsManager->deleteCodecParameters#Deleted the following codec parameters -> ${parameters} for ${mediaType}`\n );\n }\n\n /**\n * This method is used to reset the SendSlotsManager by deleting all the sendSlots\n * @returns {undefined}\n */\n public reset(): void {\n this.slots.clear();\n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AAnC,OAAA,gBAAAoC,YAAA,CAAApC,OAAA,CAAAqC,IAAA,CAMA,SAAA+B,SAAmC1D,SAAoB,EAAE2D,UAAoB;QAAA,IAAAlD,IAAA;QAAA,OAAAiB,YAAA,CAAApC,OAAA,CAAAwC,IAAA,UAAA8B,UAAAC,SAAA;UAAA,kBAAAA,SAAA,CAAA5B,IAAA,GAAA4B,SAAA,CAAA3B,IAAA;YAAA;cACrEzB,IAAI,GAAG,IAAI,CAACJ,KAAK,CAACU,GAAG,CAACf,SAAS,CAAC;cAAA,IAEjCS,IAAI;gBAAAoD,SAAA,CAAA3B,IAAA;gBAAA;cAAA;cAAA,MACD,IAAI3B,KAAK,aAAAC,MAAA,CAAaR,SAAS,oBAAiB,CAAC;YAAA;cAAA6D,SAAA,CAAA3B,IAAA;cAAA,OAGnDzB,IAAI,CAACqD,qBAAqB,CAACH,UAAU,CAAC;YAAA;cAE5C,IAAI,CAACpE,WAAW,CAACqB,MAAM,CAACC,IAAI,sFAAAL,MAAA,CAC2DmD,UAAU,WAAAnD,MAAA,CAAQR,SAAS,CAClH,CAAC;YAAC;YAAA;cAAA,OAAA6D,SAAA,CAAAvB,IAAA;UAAA;QAAA,GAAAoB,QAAA;MAAA,CACH;MAAA,SAAAI,sBAAAC,GAAA,EAAAC,GAAA;QAAA,OAAAP,sBAAA,CAAAhB,KAAA,OAAAvC,SAAA;MAAA;MAAA,OAAA4D,qBAAA;IAAA;IAED;AACF;AACA;AACA;IAHE;EAAA;IAAAlE,GAAA;IAAAC,KAAA,EAIA,SAAAoE,MAAA,EAAqB;MACnB,IAAI,CAAC5D,KAAK,CAAC6D,KAAK,CAAC,CAAC;IACpB;EAAC;EAAA,OAAA9E,eAAA;AAAA"}
|
1
|
+
{"version":3,"names":["_internalMediaCore","require","SendSlotManager","exports","default","LoggerProxy","_classCallCheck2","_defineProperty2","_map","_createClass2","key","value","createSlot","mediaConnection","mediaType","active","arguments","length","undefined","slots","has","Error","concat","slot","createSendSlot","set","logger","info","getSlot","get","setNamedMediaGroups","namedMediaGroups","MediaType","AudioMain","setSourceStateOverride","state","VideoMain","currentStateOverride","getSourceStateOverride","sourceStateOverrides","clearSourceStateOverride","delete","_publishStream","_asyncToGenerator2","_regenerator","mark","_callee","stream","wrap","_callee$","_context","prev","next","publishStream","label","muted","stop","_x","_x2","apply","_unpublishStream","_callee2","_callee2$","_context2","unpublishStream","_x3","setActive","_setCodecParameters","_callee3","codecParameters","_callee3$","_context3","setCodecParameters","_x4","_x5","_deleteCodecParameters","_callee4","parameters","_callee4$","_context4","deleteCodecParameters","_x6","_x7","reset","clear"],"sources":["sendSlotManager.ts"],"sourcesContent":["import {\n SendSlot,\n MediaType,\n LocalStream,\n MultistreamRoapMediaConnection,\n NamedMediaGroup,\n StreamState,\n} from '@webex/internal-media-core';\n\n/**\n * This class is used to manage the sendSlots for the given media types.\n */\nexport default class SendSlotManager {\n private readonly slots: Map<MediaType, SendSlot> = new Map();\n private readonly LoggerProxy: any;\n private readonly sourceStateOverrides: Map<MediaType, StreamState> = new Map();\n\n /**\n * Constructor for SendSlotManager\n *\n * @param {any} LoggerProxy is used to log the messages\n * @constructor\n */\n constructor(LoggerProxy: any) {\n this.LoggerProxy = LoggerProxy;\n }\n\n /**\n * This method is used to create a sendSlot for the given mediaType and returns the created sendSlot\n * @param {MultistreamRoapMediaConnection} mediaConnection MultistreamRoapMediaConnection for which a sendSlot needs to be created\n * @param {MediaType} mediaType MediaType for which a sendSlot needs to be created (AUDIO_MAIN/VIDEO_MAIN/AUDIO_SLIDES/VIDEO_SLIDES)\n * @param {boolean} active This is optional boolean to set the active state of the sendSlot. Default is true\n * @returns {SendSlot} slot The created sendSlot\n */\n public createSlot(\n mediaConnection: MultistreamRoapMediaConnection,\n mediaType: MediaType,\n active = true\n ): SendSlot {\n if (this.slots.has(mediaType)) {\n throw new Error(`Slot for ${mediaType} already exists`);\n }\n\n const slot: SendSlot = mediaConnection.createSendSlot(mediaType, active);\n\n this.slots.set(mediaType, slot);\n\n this.LoggerProxy.logger.info(\n `SendSlotsManager->createSlot#Created slot for ${mediaType} with active ${active}`\n );\n\n return slot;\n }\n\n /**\n * This method is used to retrieve the sendSlot for the given mediaType\n * @param {MediaType} mediaType of which the slot needs to be retrieved\n * @returns {SendSlot}\n */\n public getSlot(mediaType: MediaType): SendSlot {\n const slot = this.slots.get(mediaType);\n\n if (!slot) {\n throw new Error(`Slot for ${mediaType} does not exist`);\n }\n\n return slot;\n }\n\n /**\n * Allow users to specify 'namedMediaGroups' to indicate which named media group its audio should be sent to.\n * @param {MediaType} mediaType MediaType of the sendSlot to which the audio stream needs to be send to the media group\n * @param {[]}namedMediaGroups - Allow users to specify 'namedMediaGroups'.If the value of 'namedMediaGroups' is zero,\n * named media group will be canceled and the audio stream will be sent to the floor.\n * @returns {void}\n */\n public setNamedMediaGroups(mediaType: MediaType, namedMediaGroups: NamedMediaGroup[]) {\n if (mediaType !== MediaType.AudioMain) {\n throw new Error(\n `sendSlotManager cannot set named media group which media type is ${mediaType}`\n );\n }\n\n const slot = this.slots.get(mediaType);\n\n if (!slot) {\n throw new Error(`Slot for ${mediaType} does not exist`);\n }\n\n slot.setNamedMediaGroups(namedMediaGroups);\n\n this.LoggerProxy.logger.info(\n `SendSlotsManager->setNamedMediaGroups#set named media group ${namedMediaGroups}`\n );\n }\n\n /**\n * Sets the source state override for the given media type.\n * @param {MediaType} mediaType - The type of media (must be MediaType.VideoMain to apply source state changes).\n * @param {StreamState | null} state - The state to set or null to clear the override value.\n * @returns {void}\n */\n public setSourceStateOverride(mediaType: MediaType, state: StreamState | null) {\n if (mediaType !== MediaType.VideoMain) {\n throw new Error(\n `Invalid media type '${mediaType}'. Source state overrides are only applicable to ${MediaType.VideoMain}.`\n );\n }\n\n const slot = this.slots.get(mediaType);\n\n if (!slot) {\n throw new Error(`Slot for ${mediaType} does not exist`);\n }\n\n const currentStateOverride = this.getSourceStateOverride(mediaType);\n if (currentStateOverride === state) {\n return;\n }\n\n if (state) {\n slot.setSourceStateOverride(state);\n this.sourceStateOverrides.set(mediaType, state);\n } else {\n slot.clearSourceStateOverride();\n this.sourceStateOverrides.delete(mediaType);\n }\n\n this.LoggerProxy.logger.info(\n `SendSlotManager->setSourceStateOverride#set source state override for ${mediaType} to ${state}`\n );\n }\n\n /**\n * Gets the source state override for the given media type.\n * @param {MediaType} mediaType - The type of media to get the source state override for.\n * @returns {StreamState | null} - The current source state override or null if not set.\n */\n private getSourceStateOverride(mediaType: MediaType): StreamState | null {\n if (mediaType !== MediaType.VideoMain) {\n throw new Error(\n `Invalid media type '${mediaType}'. Source state overrides are only applicable to ${MediaType.VideoMain}.`\n );\n }\n\n return this.sourceStateOverrides.get(mediaType) || null;\n }\n\n /**\n * This method publishes the given stream to the sendSlot for the given mediaType\n * @param {MediaType} mediaType MediaType of the sendSlot to which a stream needs to be published (AUDIO_MAIN/VIDEO_MAIN/AUDIO_SLIDES/VIDEO_SLIDES)\n * @param {LocalStream} stream LocalStream to be published\n * @returns {Promise<void>}\n */\n public async publishStream(mediaType: MediaType, stream: LocalStream): Promise<void> {\n const slot = this.slots.get(mediaType);\n\n if (!slot) {\n throw new Error(`Slot for ${mediaType} does not exist`);\n }\n\n await slot.publishStream(stream);\n\n this.LoggerProxy.logger.info(\n `SendSlotsManager->publishStream#Published stream for ${mediaType} and stream with label ${stream.label} and muted ${stream.muted}`\n );\n }\n\n /**\n * This method unpublishes the stream from the sendSlot of the given mediaType\n * @param {MediaType} mediaType MediaType of the sendSlot from which a stream needs to be unpublished (AUDIO_MAIN/VIDEO_MAIN/AUDIO_SLIDES/VIDEO_SLIDES)\n * @returns {Promise<void>}\n */\n public async unpublishStream(mediaType: MediaType): Promise<void> {\n const slot = this.slots.get(mediaType);\n\n if (!slot) {\n throw new Error(`Slot for ${mediaType} does not exist`);\n }\n\n await slot.unpublishStream();\n\n this.LoggerProxy.logger.info(\n `SendSlotsManager->unpublishStream#Unpublished stream for ${mediaType}`\n );\n }\n\n /**\n * This method is used to set the active state of the sendSlot for the given mediaType\n * @param {MediaType} mediaType The MediaType of the sendSlot for which the active state needs to be set (AUDIO_MAIN/VIDEO_MAIN/AUDIO_SLIDES/VIDEO_SLIDES)\n * @param {boolean} active The boolean to set the active state of the sendSlot. Default is true\n * @returns {void}\n */\n public setActive(mediaType: MediaType, active = true): void {\n const slot = this.slots.get(mediaType);\n\n if (!slot) {\n throw new Error(`Slot for ${mediaType} does not exist`);\n }\n\n slot.active = active;\n\n this.LoggerProxy.logger.info(\n `SendSlotsManager->setActive#Set active for ${mediaType} to ${active}`\n );\n }\n\n /**\n * This method is used to set the codec parameters for the sendSlot of the given mediaType\n * @param {MediaType} mediaType MediaType of the sendSlot for which the codec parameters needs to be set (AUDIO_MAIN/VIDEO_MAIN/AUDIO_SLIDES/VIDEO_SLIDES)\n * @param {Object} codecParameters\n * @returns {Promise<void>}\n */\n public async setCodecParameters(\n mediaType: MediaType,\n codecParameters: {\n [key: string]: string | undefined; // As per ts-sdp undefined is considered as a valid value to be used for codec parameters\n }\n ): Promise<void> {\n // These codec parameter changes underneath are SDP value changes that are taken care by WCME automatically. So no need for any change in streams from the web sdk side\n const slot = this.slots.get(mediaType);\n\n if (!slot) {\n throw new Error(`Slot for ${mediaType} does not exist`);\n }\n\n await slot.setCodecParameters(codecParameters);\n\n this.LoggerProxy.logger.info(\n `SendSlotsManager->setCodecParameters#Set codec parameters for ${mediaType} to ${codecParameters}`\n );\n }\n\n /**\n * This method is used to delete the codec parameters for the sendSlot of the given mediaType\n * @param {MediaType} mediaType MediaType of the sendSlot for which the codec parameters needs to be deleted (AUDIO_MAIN/VIDEO_MAIN/AUDIO_SLIDES/VIDEO_SLIDES)\n * @param {Array<String>} parameters Array of keys of the codec parameters to be deleted\n * @returns {Promise<void>}\n */\n public async deleteCodecParameters(mediaType: MediaType, parameters: string[]): Promise<void> {\n const slot = this.slots.get(mediaType);\n\n if (!slot) {\n throw new Error(`Slot for ${mediaType} does not exist`);\n }\n\n await slot.deleteCodecParameters(parameters);\n\n this.LoggerProxy.logger.info(\n `SendSlotsManager->deleteCodecParameters#Deleted the following codec parameters -> ${parameters} for ${mediaType}`\n );\n }\n\n /**\n * This method is used to reset the SendSlotsManager by deleting all the sendSlots\n * @returns {undefined}\n */\n public reset(): void {\n this.slots.clear();\n }\n}\n"],"mappings":";;;;;;;;;;;;;;AAAA,IAAAA,kBAAA,GAAAC,OAAA;AASA;AACA;AACA;AAFA,IAGqBC,eAAe,GAAAC,OAAA,CAAAC,OAAA;EAKlC;AACF;AACA;AACA;AACA;AACA;EACE,SAAAF,gBAAYG,WAAgB,EAAE;IAAA,IAAAC,gBAAA,CAAAF,OAAA,QAAAF,eAAA;IAAA,IAAAK,gBAAA,CAAAH,OAAA,iBAVqB,IAAAI,IAAA,CAAAJ,OAAA,CAAQ,CAAC;IAAA,IAAAG,gBAAA,CAAAH,OAAA;IAAA,IAAAG,gBAAA,CAAAH,OAAA,gCAES,IAAAI,IAAA,CAAAJ,OAAA,CAAQ,CAAC;IAS5E,IAAI,CAACC,WAAW,GAAGA,WAAW;EAChC;;EAEA;AACF;AACA;AACA;AACA;AACA;AACA;EANE,IAAAI,aAAA,CAAAL,OAAA,EAAAF,eAAA;IAAAQ,GAAA;IAAAC,KAAA,EAOA,SAAAC,WACEC,eAA+C,EAC/CC,SAAoB,EAEV;MAAA,IADVC,MAAM,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,IAAI;MAEb,IAAI,IAAI,CAACG,KAAK,CAACC,GAAG,CAACN,SAAS,CAAC,EAAE;QAC7B,MAAM,IAAIO,KAAK,aAAAC,MAAA,CAAaR,SAAS,oBAAiB,CAAC;MACzD;MAEA,IAAMS,IAAc,GAAGV,eAAe,CAACW,cAAc,CAACV,SAAS,EAAEC,MAAM,CAAC;MAExE,IAAI,CAACI,KAAK,CAACM,GAAG,CAACX,SAAS,EAAES,IAAI,CAAC;MAE/B,IAAI,CAAClB,WAAW,CAACqB,MAAM,CAACC,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AI,CAACJ,KAAK,CAACU,GAAG,CAACf,SAAS,CAAC;cAAA,IAEjCS,IAAI;gBAAAwD,SAAA,CAAA3B,IAAA;gBAAA;cAAA;cAAA,MACD,IAAI/B,KAAK,aAAAC,MAAA,CAAaR,SAAS,oBAAiB,CAAC;YAAA;cAAAiE,SAAA,CAAA3B,IAAA;cAAA,OAGnD7B,IAAI,CAACyD,qBAAqB,CAACH,UAAU,CAAC;YAAA;cAE5C,IAAI,CAACxE,WAAW,CAACqB,MAAM,CAACC,IAAI,sFAAAL,MAAA,CAC2DuD,UAAU,WAAAvD,MAAA,CAAQR,SAAS,CAClH,CAAC;YAAC;YAAA;cAAA,OAAAiE,SAAA,CAAAvB,IAAA;UAAA;QAAA,GAAAoB,QAAA;MAAA,CACH;MAAA,SAAAI,sBAAAC,GAAA,EAAAC,GAAA;QAAA,OAAAP,sBAAA,CAAAhB,KAAA,OAAA3C,SAAA;MAAA;MAAA,OAAAgE,qBAAA;IAAA;IAED;AACF;AACA;AACA;IAHE;EAAA;IAAAtE,GAAA;IAAAC,KAAA,EAIA,SAAAwE,MAAA,EAAqB;MACnB,IAAI,CAAChE,KAAK,CAACiE,KAAK,CAAC,CAAC;IACpB;EAAC;EAAA,OAAAlF,eAAA;AAAA"}
|
@@ -145,6 +145,7 @@ export declare const DIALER_REGEX: {
|
|
145
145
|
SIP_ADDRESS: RegExp;
|
146
146
|
PHONE_NUMBER: RegExp;
|
147
147
|
E164_FORMAT: RegExp;
|
148
|
+
INTERNAL_NUMBER: RegExp;
|
148
149
|
};
|
149
150
|
export declare const IPV4_REGEX: RegExp;
|
150
151
|
export declare const VALID_EMAIL_ADDRESS: RegExp;
|
@@ -778,6 +779,9 @@ export declare const DISPLAY_HINTS: {
|
|
778
779
|
PREMISE_RECORDING_CONTROL_PAUSE: string;
|
779
780
|
PREMISE_RECORDING_CONTROL_STOP: string;
|
780
781
|
PREMISE_RECORDING_CONTROL_RESUME: string;
|
782
|
+
LOCAL_RECORDING_STATUS_STARTED: string;
|
783
|
+
LOCAL_RECORDING_STATUS_STOPPED: string;
|
784
|
+
LOCAL_RECORDING_STATUS_PAUSED: string;
|
781
785
|
LOCK_CONTROL_UNLOCK: string;
|
782
786
|
LOCK_CONTROL_LOCK: string;
|
783
787
|
LOCK_STATUS_LOCKED: string;
|
@@ -972,6 +976,7 @@ export declare const QUALITY_LEVELS: {
|
|
972
976
|
HIGH: string;
|
973
977
|
'360p': string;
|
974
978
|
'480p': string;
|
979
|
+
'540p': string;
|
975
980
|
'720p': string;
|
976
981
|
'1080p': string;
|
977
982
|
};
|
@@ -1000,6 +1005,18 @@ export declare const AVAILABLE_RESOLUTIONS: {
|
|
1000
1005
|
};
|
1001
1006
|
};
|
1002
1007
|
};
|
1008
|
+
'540p': {
|
1009
|
+
video: {
|
1010
|
+
width: {
|
1011
|
+
max: number;
|
1012
|
+
ideal: number;
|
1013
|
+
};
|
1014
|
+
height: {
|
1015
|
+
max: number;
|
1016
|
+
ideal: number;
|
1017
|
+
};
|
1018
|
+
};
|
1019
|
+
};
|
1003
1020
|
'720p': {
|
1004
1021
|
video: {
|
1005
1022
|
width: {
|
@@ -1117,3 +1134,8 @@ export declare const INITIAL_REGISTRATION_STATUS: {
|
|
1117
1134
|
mercuryConnect: boolean;
|
1118
1135
|
checkH264Support: boolean;
|
1119
1136
|
};
|
1137
|
+
export declare const STAGE_MANAGER_TYPE: {
|
1138
|
+
LOGO: number;
|
1139
|
+
BACKGROUND: number;
|
1140
|
+
NAME_LABEL: number;
|
1141
|
+
};
|
@@ -16,7 +16,6 @@ export default class LocusInfo extends EventsScope {
|
|
16
16
|
aclUrl: any;
|
17
17
|
baseSequence: any;
|
18
18
|
created: any;
|
19
|
-
deltaParticipants: any;
|
20
19
|
identities: any;
|
21
20
|
membership: any;
|
22
21
|
participants: any;
|
@@ -148,14 +147,6 @@ export default class LocusInfo extends EventsScope {
|
|
148
147
|
* @memberof LocusInfo
|
149
148
|
*/
|
150
149
|
compareSelfAndHost(): void;
|
151
|
-
/**
|
152
|
-
* Update the deltaParticipants property of this object based on a list of
|
153
|
-
* provided participants.
|
154
|
-
*
|
155
|
-
* @param {Array} [participants] - The participants to update against.
|
156
|
-
* @returns {void}
|
157
|
-
*/
|
158
|
-
updateParticipantDeltas(participants?: Array<any>): void;
|
159
150
|
/**
|
160
151
|
* update meeting's members
|
161
152
|
* @param {Object} participants new participants object
|
@@ -34,6 +34,9 @@ interface IInMeetingActions {
|
|
34
34
|
isClosedCaptionActive?: boolean;
|
35
35
|
canStartManualCaption?: boolean;
|
36
36
|
canStopManualCaption?: boolean;
|
37
|
+
isLocalRecordingStarted?: boolean;
|
38
|
+
isLocalRecordingStopped?: boolean;
|
39
|
+
isLocalRecordingPaused?: boolean;
|
37
40
|
isManualCaptionActive?: boolean;
|
38
41
|
isSaveTranscriptsEnabled?: boolean;
|
39
42
|
isWebexAssistantActive?: boolean;
|
@@ -139,6 +142,9 @@ export default class InMeetingActions implements IInMeetingActions {
|
|
139
142
|
isClosedCaptionActive: any;
|
140
143
|
canStartManualCaption: any;
|
141
144
|
canStopManualCaption: any;
|
145
|
+
isLocalRecordingStopped: any;
|
146
|
+
isLocalRecordingStarted: any;
|
147
|
+
isLocalRecordingPaused: any;
|
142
148
|
isManualCaptionActive: any;
|
143
149
|
isSaveTranscriptsEnabled: any;
|
144
150
|
isWebexAssistantActive: any;
|
@@ -21,6 +21,8 @@ import RecordingController from '../recording-controller';
|
|
21
21
|
import ControlsOptionsManager from '../controls-options-manager';
|
22
22
|
import { LocusMediaRequest } from './locusMediaRequest';
|
23
23
|
import { BrbState } from './brbState';
|
24
|
+
import { SetStageOptions } from './request.type';
|
25
|
+
import { Invitee } from './type';
|
24
26
|
export type CaptionData = {
|
25
27
|
id: string;
|
26
28
|
isFinal: boolean;
|
@@ -81,6 +83,7 @@ export type CallStateForMetrics = {
|
|
81
83
|
loginType?: string;
|
82
84
|
userNameInput?: string;
|
83
85
|
emailInput?: string;
|
86
|
+
pstnCorrelationId?: string;
|
84
87
|
};
|
85
88
|
export declare const MEDIA_UPDATE_TYPE: {
|
86
89
|
TRANSCODED_MEDIA_CONNECTION: string;
|
@@ -486,10 +489,11 @@ export default class Meeting extends StatelessWebexPlugin {
|
|
486
489
|
/**
|
487
490
|
* @param {Object} attrs
|
488
491
|
* @param {Object} options
|
492
|
+
* @param {Function} callback - if provided, it will be called with the newly created meeting object as soon as the meeting.id is set
|
489
493
|
* @constructor
|
490
494
|
* @memberof Meeting
|
491
495
|
*/
|
492
|
-
constructor(attrs: any, options: object);
|
496
|
+
constructor(attrs: any, options: object, callback: (meeting: Meeting) => void);
|
493
497
|
/**
|
494
498
|
* returns meeting is joined
|
495
499
|
* @private
|
@@ -512,6 +516,16 @@ export default class Meeting extends StatelessWebexPlugin {
|
|
512
516
|
* @param {string} correlationId
|
513
517
|
*/
|
514
518
|
set correlationId(correlationId: string);
|
519
|
+
/**
|
520
|
+
* Getter - Returns callStateForMetrics.pstnCorrelationId
|
521
|
+
* @returns {string | undefined}
|
522
|
+
*/
|
523
|
+
get pstnCorrelationId(): string | undefined;
|
524
|
+
/**
|
525
|
+
* Setter - sets callStateForMetrics.pstnCorrelationId
|
526
|
+
* @param {string | undefined} correlationId
|
527
|
+
*/
|
528
|
+
set pstnCorrelationId(correlationId: string | undefined);
|
515
529
|
/**
|
516
530
|
* Getter - Returns callStateForMetrics.userNameInput
|
517
531
|
* @returns {string}
|
@@ -861,43 +875,37 @@ export default class Meeting extends StatelessWebexPlugin {
|
|
861
875
|
private updateMeetingObject;
|
862
876
|
/**
|
863
877
|
* Invite a guest to the call that isn't normally part of this call
|
864
|
-
* @param {
|
878
|
+
* @param {Invitee} invitee
|
865
879
|
* @param {String} invitee.emailAddress
|
866
880
|
* @param {String} invitee.email
|
867
881
|
* @param {String} invitee.phoneNumber
|
868
882
|
* @param {Boolean} [alertIfActive]
|
883
|
+
* @param {Boolean} [invitee.skipEmailValidation]
|
884
|
+
* @param {Boolean} [invitee.isInternalNumber]
|
869
885
|
* @returns {Promise} see #members.addMember
|
870
886
|
* @public
|
871
887
|
* @memberof Meeting
|
872
888
|
*/
|
873
|
-
invite(invitee:
|
874
|
-
emailAddress: string;
|
875
|
-
email: string;
|
876
|
-
phoneNumber: string;
|
877
|
-
roles: Array<string>;
|
878
|
-
}, alertIfActive?: boolean): any;
|
889
|
+
invite(invitee: Invitee, alertIfActive?: boolean): any;
|
879
890
|
/**
|
880
891
|
* Cancel an outgoing phone call invitation made during a meeting
|
881
|
-
* @param {
|
892
|
+
* @param {Invitee} invitee
|
882
893
|
* @param {String} invitee.phoneNumber
|
883
894
|
* @returns {Promise} see #members.cancelPhoneInvite
|
884
895
|
* @public
|
885
896
|
* @memberof Meeting
|
886
897
|
*/
|
887
|
-
cancelPhoneInvite(invitee:
|
888
|
-
phoneNumber: string;
|
889
|
-
}): any;
|
898
|
+
cancelPhoneInvite(invitee: Invitee): any;
|
890
899
|
/**
|
891
|
-
* Cancel an SIP call invitation made during a meeting
|
892
|
-
* @param {
|
900
|
+
* Cancel an SIP/phone call invitation made during a meeting
|
901
|
+
* @param {Invitee} invitee
|
893
902
|
* @param {String} invitee.memberId
|
894
|
-
* @
|
903
|
+
* @param {Boolean} [invitee.isInternalNumber] - When cancel phone invitation, if the number is internal
|
904
|
+
* @returns {Promise} see #members.cancelInviteByMemberId
|
895
905
|
* @public
|
896
906
|
* @memberof Meeting
|
897
907
|
*/
|
898
|
-
|
899
|
-
memberId: string;
|
900
|
-
}): any;
|
908
|
+
cancelInviteByMemberId(invitee: Invitee): any;
|
901
909
|
/**
|
902
910
|
* Admit the guest(s) to the call once they are waiting.
|
903
911
|
* If the host/cohost is in a breakout session, the locus url
|
@@ -1344,7 +1352,7 @@ export default class Meeting extends StatelessWebexPlugin {
|
|
1344
1352
|
* @memberof Meeting
|
1345
1353
|
* @returns {Promise}
|
1346
1354
|
*/
|
1347
|
-
disconnectPhoneAudio(): Promise<
|
1355
|
+
disconnectPhoneAudio(): Promise<void>;
|
1348
1356
|
/**
|
1349
1357
|
* Moves the call to the specified resourceId
|
1350
1358
|
* @param {String} resourceId
|
@@ -2000,5 +2008,18 @@ export default class Meeting extends StatelessWebexPlugin {
|
|
2000
2008
|
* @returns {Promise<MediaReachabilityMetrics>}
|
2001
2009
|
*/
|
2002
2010
|
private getMediaReachabilityMetricFields;
|
2011
|
+
/**
|
2012
|
+
* Set the stage for the meeting
|
2013
|
+
*
|
2014
|
+
* @param {SetStageOptions} options Options to use when setting the stage
|
2015
|
+
* @returns {Promise} The locus request
|
2016
|
+
*/
|
2017
|
+
setStage({ activeSpeakerProportion, customBackground, customLogo, customNameLabel, importantParticipants, lockAttendeeViewOnStage, showActiveSpeaker, }?: SetStageOptions): Promise<any>;
|
2018
|
+
/**
|
2019
|
+
* Unset the stage for the meeting
|
2020
|
+
*
|
2021
|
+
* @returns {Promise} The locus request
|
2022
|
+
*/
|
2023
|
+
unsetStage(): Promise<any>;
|
2003
2024
|
}
|
2004
2025
|
export {};
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { StatelessWebexPlugin } from '@webex/webex-core';
|
2
|
-
import { SendReactionOptions, BrbOptions, ToggleReactionsOptions, PostMeetingDataConsentOptions } from './request.type';
|
2
|
+
import { SendReactionOptions, BrbOptions, ToggleReactionsOptions, PostMeetingDataConsentOptions, SynchronizeVideoLayout } from './request.type';
|
3
3
|
import { AnnotationInfo } from '../annotation/annotation.types';
|
4
4
|
import { ClientMediaPreferences } from '../reachability/reachability.types';
|
5
5
|
/**
|
@@ -314,4 +314,12 @@ export default class MeetingRequest extends StatelessWebexPlugin {
|
|
314
314
|
* @returns {Promise}
|
315
315
|
*/
|
316
316
|
setPostMeetingDataConsent({ postMeetingDataConsent, locusUrl, deviceUrl, selfId, }: PostMeetingDataConsentOptions): Promise<any>;
|
317
|
+
/**
|
318
|
+
* Synchronize the stage for a meeting
|
319
|
+
*
|
320
|
+
* @param {LocusUrl} locusUrl The locus URL
|
321
|
+
* @param {SetStageVideoLayout} videoLayout The video layout to synchronize
|
322
|
+
* @returns {Promise} The locus request
|
323
|
+
*/
|
324
|
+
synchronizeStage(locusUrl: string, videoLayout: SynchronizeVideoLayout): Promise<any>;
|
317
325
|
}
|
@@ -21,3 +21,77 @@ export type PostMeetingDataConsentOptions = {
|
|
21
21
|
deviceUrl: string;
|
22
22
|
selfId: string;
|
23
23
|
};
|
24
|
+
export type StageCustomLogoPositions = 'LowerLeft' | 'LowerMiddle' | 'LowerRight' | 'UpperLeft' | 'UpperMiddle' | 'UpperRight';
|
25
|
+
export type StageNameLabelType = 'Primary' | 'PrimaryInverted' | 'Secondary' | 'SecondaryInverted';
|
26
|
+
export type StageCustomBackground = {
|
27
|
+
url: string;
|
28
|
+
[others: string]: unknown;
|
29
|
+
};
|
30
|
+
export type StageCustomLogo = {
|
31
|
+
url: string;
|
32
|
+
position: StageCustomLogoPositions;
|
33
|
+
[others: string]: unknown;
|
34
|
+
};
|
35
|
+
export type StageCustomNameLabel = {
|
36
|
+
accentColor: string;
|
37
|
+
background: {
|
38
|
+
color: string;
|
39
|
+
};
|
40
|
+
border: {
|
41
|
+
color: string;
|
42
|
+
};
|
43
|
+
content: {
|
44
|
+
displayName: {
|
45
|
+
color: string;
|
46
|
+
};
|
47
|
+
subtitle: {
|
48
|
+
color: string;
|
49
|
+
};
|
50
|
+
};
|
51
|
+
decoration: {
|
52
|
+
color: string;
|
53
|
+
};
|
54
|
+
fadeOut?: {
|
55
|
+
delay: number;
|
56
|
+
};
|
57
|
+
type: StageNameLabelType;
|
58
|
+
[others: string]: unknown;
|
59
|
+
};
|
60
|
+
export type SetStageOptions = {
|
61
|
+
activeSpeakerProportion?: number;
|
62
|
+
customBackground?: StageCustomBackground;
|
63
|
+
customLogo?: StageCustomLogo;
|
64
|
+
customNameLabel?: StageCustomNameLabel;
|
65
|
+
importantParticipants?: {
|
66
|
+
mainCsi: number;
|
67
|
+
participantId: string;
|
68
|
+
}[];
|
69
|
+
lockAttendeeViewOnStage?: boolean;
|
70
|
+
showActiveSpeaker?: boolean;
|
71
|
+
};
|
72
|
+
export type SetStageVideoLayout = {
|
73
|
+
overrideDefault: true;
|
74
|
+
lockAttendeeViewOnStageOnly: boolean;
|
75
|
+
stageParameters: {
|
76
|
+
importantParticipants?: {
|
77
|
+
participantId: string;
|
78
|
+
mainCsi: number;
|
79
|
+
order: number;
|
80
|
+
}[];
|
81
|
+
showActiveSpeaker: {
|
82
|
+
show: boolean;
|
83
|
+
order: number;
|
84
|
+
};
|
85
|
+
activeSpeakerProportion: number;
|
86
|
+
stageManagerType: number;
|
87
|
+
};
|
88
|
+
customLayouts?: {
|
89
|
+
background?: StageCustomBackground;
|
90
|
+
logo?: StageCustomLogo;
|
91
|
+
};
|
92
|
+
nameLabelStyle?: StageCustomNameLabel;
|
93
|
+
};
|
94
|
+
export type UnsetStageVideoLayout = {
|
95
|
+
overrideDefault: false;
|
96
|
+
};
|
97
|
+
export type SynchronizeVideoLayout = SetStageVideoLayout | UnsetStageVideoLayout;
|