@webex/plugin-meetings 3.0.0-beta.238 → 3.0.0-beta.239

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.
@@ -437,15 +437,16 @@ var RemoteMediaManager = /*#__PURE__*/function (_EventsScope) {
437
437
  }
438
438
  throw new Error('setLayout() called before start()');
439
439
  case 4:
440
+ _loggerProxy.default.logger.log("RemoteMediaManager#setLayout --> new layout selected: ".concat(layoutId));
440
441
  this.currentLayoutId = layoutId;
441
442
  this.currentLayout = (0, _cloneDeep2.default)(this.config.video.layouts[this.currentLayoutId]);
442
- _context3.next = 8;
443
+ _context3.next = 9;
443
444
  return this.updateVideoReceiveSlots();
444
- case 8:
445
+ case 9:
445
446
  this.updateVideoRemoteMediaObjects();
446
447
  this.updateScreenShareVideoRemoteMediaObject();
447
448
  this.emitVideoLayoutChangedEvent();
448
- case 11:
449
+ case 12:
449
450
  case "end":
450
451
  return _context3.stop();
451
452
  }
@@ -776,19 +777,55 @@ var RemoteMediaManager = /*#__PURE__*/function (_EventsScope) {
776
777
  * Logs the state of the receive slots
777
778
  */
778
779
  }, {
779
- key: "logReceieveSlots",
780
- value: function logReceieveSlots() {
780
+ key: "logMainVideoReceiveSlots",
781
+ value: function logMainVideoReceiveSlots() {
781
782
  var logMessage = '';
782
783
  (0, _forEach2.default)(this.receiveSlotAllocations.activeSpeaker, function (group, groupName) {
783
- logMessage += "group: ".concat(groupName, "\n").concat(group.slots.map(function (slot) {
784
+ logMessage += "\ngroup: ".concat(groupName, "\n").concat(group.slots.map(function (slot) {
784
785
  return slot.logString;
785
- }).join(' '));
786
+ }).join(', '));
786
787
  });
787
788
  logMessage += '\nreceiverSelected:\n';
788
789
  (0, _forEach2.default)(this.receiveSlotAllocations.receiverSelected, function (slot, key) {
789
790
  logMessage += " ".concat(key, ": ").concat(slot.logString, "\n");
790
791
  });
791
- _loggerProxy.default.logger.log("RemoteMediaManager#updateVideoReceiveSlots --> receive slots updated: unused=".concat(this.slots.video.unused.length, ", activeSpeaker=").concat(this.slots.video.activeSpeaker.length, ", receiverSelected=").concat(this.slots.video.receiverSelected.length, "\n").concat(logMessage));
792
+ _loggerProxy.default.logger.log("RemoteMediaManager#logMainVideoReceiveSlots --> MAIN VIDEO receive slots: unused=".concat(this.slots.video.unused.length, ", activeSpeaker=").concat(this.slots.video.activeSpeaker.length, ", receiverSelected=").concat(this.slots.video.receiverSelected.length).concat(logMessage));
793
+ }
794
+
795
+ /** logs main audio slots */
796
+ }, {
797
+ key: "logMainAudioReceiveSlots",
798
+ value: function logMainAudioReceiveSlots() {
799
+ _loggerProxy.default.logger.log("RemoteMediaManager#logMainAudioReceiveSlots --> MAIN AUDIO receive slots: ".concat(this.slots.audio.map(function (slot) {
800
+ return slot.logString;
801
+ }).join(', ')));
802
+ }
803
+
804
+ /** logs slides video slots */
805
+ }, {
806
+ key: "logSlidesVideoReceiveSlots",
807
+ value: function logSlidesVideoReceiveSlots() {
808
+ var _this$slots$screenSha;
809
+ _loggerProxy.default.logger.log("RemoteMediaManager#logSlidesVideoReceiveSlots --> SLIDES VIDEO receive slot: ".concat((_this$slots$screenSha = this.slots.screenShare.video) === null || _this$slots$screenSha === void 0 ? void 0 : _this$slots$screenSha.logString));
810
+ }
811
+
812
+ /** logs slides audio slots */
813
+ }, {
814
+ key: "logSlidesAudioReceiveSlots",
815
+ value: function logSlidesAudioReceiveSlots() {
816
+ _loggerProxy.default.logger.log("RemoteMediaManager#logSlidesAudioReceiveSlots --> SLIDES AUDIO receive slots: ".concat(this.slots.screenShare.audio.map(function (slot) {
817
+ return slot.logString;
818
+ }).join(', ')));
819
+ }
820
+
821
+ /** Logs all current receive slots */
822
+ }, {
823
+ key: "logAllReceiveSlots",
824
+ value: function logAllReceiveSlots() {
825
+ this.logMainVideoReceiveSlots();
826
+ this.logMainAudioReceiveSlots();
827
+ this.logSlidesVideoReceiveSlots();
828
+ this.logSlidesAudioReceiveSlots();
792
829
  }
793
830
 
794
831
  /**
@@ -824,7 +861,7 @@ var RemoteMediaManager = /*#__PURE__*/function (_EventsScope) {
824
861
  this.allocateSlotsToActiveSpeakerPaneGroups();
825
862
  // allocate receiver selected
826
863
  this.allocateSlotsToReceiverSelectedVideoPaneGroups();
827
- this.logReceieveSlots();
864
+ this.logMainVideoReceiveSlots();
828
865
 
829
866
  // If this is the initial layout, there may be some "unused" slots left because of the preallocation
830
867
  // done in this.preallocateVideoReceiveSlots(), so release them now
@@ -1 +1 @@
1
- {"version":3,"names":["AllEqualLayout","activeSpeakerVideoPaneGroups","id","numPanes","size","priority","SingleLayout","OnePlusFiveLayout","TwoMainPlusSixSmallLayout","RemoteScreenShareWithSmallThumbnailsLayout","screenShareVideo","Stage2x2With6ThumbnailsLayout","memberVideoPanes","csi","undefined","DefaultConfiguration","audio","numOfActiveSpeakerStreams","numOfScreenShareStreams","video","preferLiveVideo","initialLayoutId","layouts","AllEqual","OnePlusFive","Single","Stage","ScreenShareView","Event","RemoteMediaManager","receiveSlotManager","mediaRequestManagers","config","started","media","activeSpeakerGroups","memberPanes","screenShare","checkConfigValidity","slots","unused","activeSpeaker","receiverSelected","receiveSlotAllocations","LoggerProxy","logger","log","Error","forEach","layout","groupIds","paneIds","groupPriorites","group","pane","createAudioMedia","createScreenShareReceiveSlots","createScreenShareAudioMedia","preallocateVideoReceiveSlots","setLayout","invalidateCurrentRemoteMedia","screenShareAudio","commit","slot","releaseSlot","length","push","releaseUnusedVideoSlots","currentLayout","currentLayoutId","activeSpeakerCount","reduce","sum","paneGroup","receiverSelectedCount","maxNumVideoPanesRequired","maxValue","Math","max","getRequiredNumVideoSlotsForLayout","allocateSlot","MediaType","VideoMain","layoutId","updateVideoReceiveSlots","updateVideoRemoteMediaObjects","updateScreenShareVideoRemoteMediaObject","emitVideoLayoutChangedEvent","activeSpeakerGroup","setPreferLiveVideo","remoteMediaCsis","remoteMediaGroup","groupRemoteMediaCsis","filter","remoteMedia","includes","setActiveSpeakerCsis","i","AudioMain","RemoteMediaGroup","emit","file","function","AudioCreated","AudioSlides","isAnyLayoutContainingScreenShareVideo","some","VideoSlides","ScreenShareAudioCreated","requiredCsis","memberVideoPane","isCsiNeededByCurrentLayout","notNeededReceiverSelectedSlots","sort","a","b","paneIndex","freeSlot","shift","memberPane","existingSlot","find","isExistingSlotAlreadyAllocated","pop","requiredNumSlots","totalNumSlots","numSlotsToCreate","logMessage","groupName","map","logString","join","key","trimActiveSpeakerSlots","trimReceiverSelectedSlots","refillRequiredSlotsIfNeeded","allocateSlotsToActiveSpeakerPaneGroups","allocateSlotsToReceiverSelectedVideoPaneGroups","logReceieveSlots","groupId","paneGroupInCurrentLayout","groupInLayout","mediaGroup","resolution","warn","paneId","paneInCurrentLayout","paneInLayout","RemoteMedia","sendMediaRequest","options","stop","VideoLayoutChanged","activeSpeakerVideoPanes","getRemoteMedia","cancelMediaRequest","newPane","receiveSlot","reject","resolve","getUnderlyingReceiveSlot","index","indexOf","splice","pin","unpin","isPinned","EventsScope"],"sources":["remoteMediaManager.ts"],"sourcesContent":["/* eslint-disable valid-jsdoc */\nimport {cloneDeep, forEach, remove} from 'lodash';\nimport {EventMap} from 'typed-emitter';\nimport {MediaType} from '@webex/internal-media-core';\n\nimport LoggerProxy from '../common/logs/logger-proxy';\nimport EventsScope from '../common/events/events-scope';\n\nimport {RemoteMedia, RemoteVideoResolution} from './remoteMedia';\nimport {ReceiveSlot, CSI} from './receiveSlot';\nimport {ReceiveSlotManager} from './receiveSlotManager';\nimport {RemoteMediaGroup} from './remoteMediaGroup';\nimport {MediaRequestManager} from './mediaRequestManager';\n\nexport type PaneSize = RemoteVideoResolution;\nexport type LayoutId = string;\nexport type PaneId = string;\nexport type PaneGroupId = string;\n\nexport interface ActiveSpeakerVideoPaneGroup {\n id: PaneGroupId;\n numPanes: number; // maximum number of panes in the group (actual number may be lower, if there are not enough participants in the meeting)\n size: PaneSize; // preferred size for all panes in the group\n priority: number; // 0-255 (255 = highest priority), each group must have a different priority from all other groups\n}\n\nexport interface MemberVideoPane {\n id: PaneId;\n size: PaneSize;\n csi?: CSI;\n}\n\nexport interface VideoLayout {\n screenShareVideo?: {\n size: PaneSize;\n };\n activeSpeakerVideoPaneGroups?: ActiveSpeakerVideoPaneGroup[]; // list of active speaker video pane groups\n memberVideoPanes?: MemberVideoPane[]; // list of video panes for specific members, CSI values can be changed later via setVideoPaneCsi()\n}\n\nexport interface Configuration {\n audio: {\n numOfActiveSpeakerStreams: number; // number of audio streams we want to receive\n numOfScreenShareStreams: number; // 1 should be enough, because in webex only 1 person at a time can be presenting screen share\n };\n video: {\n preferLiveVideo: boolean; // applies to all pane groups with active speaker policy\n initialLayoutId: LayoutId;\n\n layouts: {[key: LayoutId]: VideoLayout}; // a map of all available layouts, a layout can be set via setLayout() method\n };\n}\n\n/* Predefined layouts: */\n\n// An \"all equal\" grid, with size up to 3 x 3 = 9:\nconst AllEqualLayout: VideoLayout = {\n activeSpeakerVideoPaneGroups: [\n {\n id: 'main',\n numPanes: 9,\n size: 'best',\n priority: 255,\n },\n ],\n};\n\n// A layout with just a single remote active speaker video pane:\nconst SingleLayout: VideoLayout = {\n activeSpeakerVideoPaneGroups: [\n {\n id: 'main',\n numPanes: 1,\n size: 'best',\n priority: 255,\n },\n ],\n};\n\n// A layout with 1 big pane for the highest priority active speaker and 5 small panes for other active speakers:\nconst OnePlusFiveLayout: VideoLayout = {\n activeSpeakerVideoPaneGroups: [\n {\n id: 'mainBigOne',\n numPanes: 1,\n size: 'large',\n priority: 255,\n },\n {\n id: 'secondarySetOfSmallPanes',\n numPanes: 5,\n size: 'very small',\n priority: 254,\n },\n ],\n};\n\n// A layout with 2 big panes for 2 main active speakers and a strip of 6 small panes for other active speakers:\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nconst TwoMainPlusSixSmallLayout: VideoLayout = {\n activeSpeakerVideoPaneGroups: [\n {\n id: 'mainGroupWith2BigPanes',\n numPanes: 2,\n size: 'large',\n priority: 255,\n },\n {\n id: 'secondaryGroupOfSmallPanes',\n numPanes: 6,\n size: 'small',\n priority: 254,\n },\n ],\n};\n\n// A strip of 8 small video panes (thumbnails) displayed at the top of a remote screenshare:\nconst RemoteScreenShareWithSmallThumbnailsLayout: VideoLayout = {\n screenShareVideo: {size: 'best'},\n activeSpeakerVideoPaneGroups: [\n {\n id: 'thumbnails',\n numPanes: 8,\n size: 'thumbnail',\n priority: 255,\n },\n ],\n};\n\n// A staged layout with 4 pre-selected meeting participants in the main 2x2 grid and 6 small panes for other active speakers at the top:\nconst Stage2x2With6ThumbnailsLayout: VideoLayout = {\n activeSpeakerVideoPaneGroups: [\n {\n id: 'thumbnails',\n numPanes: 6,\n size: 'thumbnail',\n priority: 255,\n },\n ],\n memberVideoPanes: [\n {id: 'stage-1', size: 'medium', csi: undefined},\n {id: 'stage-2', size: 'medium', csi: undefined},\n {id: 'stage-3', size: 'medium', csi: undefined},\n {id: 'stage-4', size: 'medium', csi: undefined},\n ],\n};\n\n/**\n * Default configuration:\n * - uses 3 audio streams\n * - prefers active speakers with live video (e.g. are not audio only or video muted) over active speakers without live video\n * - has a few layouts defined, including 1 that contains remote screen share (ScreenShareView)\n */\nexport const DefaultConfiguration: Configuration = {\n audio: {\n numOfActiveSpeakerStreams: 3,\n numOfScreenShareStreams: 1,\n },\n video: {\n preferLiveVideo: true,\n initialLayoutId: 'AllEqual',\n\n layouts: {\n AllEqual: AllEqualLayout,\n OnePlusFive: OnePlusFiveLayout,\n Single: SingleLayout,\n Stage: Stage2x2With6ThumbnailsLayout,\n ScreenShareView: RemoteScreenShareWithSmallThumbnailsLayout,\n },\n },\n};\n\nexport enum Event {\n // events for audio streams\n AudioCreated = 'AudioCreated',\n ScreenShareAudioCreated = 'ScreenShareAudioCreated',\n\n // events for video streams\n VideoLayoutChanged = 'VideoLayoutChanged',\n}\n\nexport interface VideoLayoutChangedEventData {\n layoutId: LayoutId;\n activeSpeakerVideoPanes: {\n [key: PaneGroupId]: RemoteMediaGroup;\n };\n memberVideoPanes: {[key: PaneId]: RemoteMedia};\n screenShareVideo?: RemoteMedia;\n}\nexport interface Events extends EventMap {\n // audio\n [Event.AudioCreated]: (audio: RemoteMediaGroup) => void;\n [Event.ScreenShareAudioCreated]: (screenShareAudio: RemoteMediaGroup) => void;\n\n // video\n [Event.VideoLayoutChanged]: (data: VideoLayoutChangedEventData) => void;\n}\n\n/**\n * A helper class that manages all remote audio/video streams in order to achieve a predefined set of layouts.\n * It also creates a fixed number of audio streams and these don't change during the meeting.\n *\n * Things that RemoteMediaManager does:\n * - owns the receive slots (creates them when needed, and re-uses them when switching layouts)\n * - constructs appropriate RemoteMedia and RemoteMediaGroup objects and sends appropriate mediaRequests\n */\nexport class RemoteMediaManager extends EventsScope {\n private config: Configuration;\n\n private started: boolean;\n\n private receiveSlotManager: ReceiveSlotManager;\n\n private mediaRequestManagers: {\n audio: MediaRequestManager;\n video: MediaRequestManager;\n screenShareAudio: MediaRequestManager;\n screenShareVideo: MediaRequestManager;\n };\n\n private currentLayout?: VideoLayout;\n\n private slots: {\n audio: ReceiveSlot[];\n screenShare: {\n audio: ReceiveSlot[];\n video?: ReceiveSlot;\n };\n video: {\n unused: ReceiveSlot[];\n activeSpeaker: ReceiveSlot[];\n receiverSelected: ReceiveSlot[];\n };\n };\n\n private media: {\n audio?: RemoteMediaGroup;\n video: {\n activeSpeakerGroups: {\n [key: PaneGroupId]: RemoteMediaGroup;\n };\n memberPanes: {[key: PaneId]: RemoteMedia};\n };\n screenShare: {\n audio?: RemoteMediaGroup;\n video?: RemoteMediaGroup;\n };\n };\n\n private receiveSlotAllocations: {\n activeSpeaker: {[key: PaneGroupId]: {slots: ReceiveSlot[]}};\n receiverSelected: {[key: PaneId]: ReceiveSlot};\n };\n\n private currentLayoutId?: LayoutId;\n\n /**\n * Constructor\n *\n * @param {ReceiveSlotManager} receiveSlotManager\n * @param {{audio: MediaRequestManager, video: mediaRequestManagers}} mediaRequestManagers\n * @param {Configuration} config Configuration describing what video layouts to use during the meeting\n */\n constructor(\n receiveSlotManager: ReceiveSlotManager,\n mediaRequestManagers: {\n audio: MediaRequestManager;\n video: MediaRequestManager;\n screenShareAudio: MediaRequestManager;\n screenShareVideo: MediaRequestManager;\n },\n config: Configuration = DefaultConfiguration\n ) {\n super();\n this.started = false;\n this.config = config;\n this.receiveSlotManager = receiveSlotManager;\n this.mediaRequestManagers = mediaRequestManagers;\n this.media = {\n audio: undefined,\n video: {\n activeSpeakerGroups: {},\n memberPanes: {},\n },\n screenShare: {\n audio: undefined,\n video: undefined,\n },\n };\n\n this.checkConfigValidity();\n\n this.slots = {\n audio: [],\n screenShare: {\n audio: [],\n video: undefined,\n },\n video: {\n unused: [],\n activeSpeaker: [],\n receiverSelected: [],\n },\n };\n\n this.receiveSlotAllocations = {activeSpeaker: {}, receiverSelected: {}};\n\n LoggerProxy.logger.log(\n `RemoteMediaManager#constructor --> RemoteMediaManager created with config: ${JSON.stringify(\n this.config\n )}`\n );\n }\n\n /**\n * Checks if configuration is valid, throws an error if it's not\n */\n private checkConfigValidity() {\n if (!(this.config.video.initialLayoutId in this.config.video.layouts)) {\n throw new Error(\n `invalid config: initialLayoutId \"${this.config.video.initialLayoutId}\" doesn't match any of the layouts`\n );\n }\n\n // check if each layout is valid\n Object.values(this.config.video.layouts).forEach((layout) => {\n const groupIds = {};\n const paneIds = {};\n const groupPriorites = {};\n\n layout.activeSpeakerVideoPaneGroups?.forEach((group) => {\n if (groupIds[group.id]) {\n throw new Error(\n `invalid config: duplicate active speaker video pane group id: ${group.id}`\n );\n }\n groupIds[group.id] = true;\n\n if (groupPriorites[group.priority]) {\n throw new Error(\n `invalid config: multiple active speaker video pane groups have same priority: ${group.priority}`\n );\n }\n groupPriorites[group.priority] = true;\n });\n\n layout.memberVideoPanes?.forEach((pane) => {\n if (paneIds[pane.id]) {\n throw new Error(`invalid config: duplicate member video pane id: ${pane.id}`);\n }\n paneIds[pane.id] = true;\n });\n });\n }\n\n /**\n * Starts the RemoteMediaManager.\n *\n * @returns {Promise}\n */\n public async start() {\n if (this.started) {\n throw new Error('start() failure: already started');\n }\n this.started = true;\n\n await this.createAudioMedia();\n\n await this.createScreenShareReceiveSlots();\n this.createScreenShareAudioMedia();\n\n await this.preallocateVideoReceiveSlots();\n\n await this.setLayout(this.config.video.initialLayoutId);\n }\n\n /**\n * Releases all the used resources (like allocated receive slots). This function needs\n * to be called when we leave the meeting, etc.\n */\n public stop() {\n // invalidate all remoteMedia objects\n this.invalidateCurrentRemoteMedia({\n audio: true,\n video: true,\n screenShareAudio: true,\n screenShareVideo: true,\n commit: true,\n });\n\n // release all audio receive slots\n this.slots.audio.forEach((slot) => this.receiveSlotManager.releaseSlot(slot));\n this.slots.audio.length = 0;\n\n // release screen share slots\n this.slots.screenShare.audio.forEach((slot) => this.receiveSlotManager.releaseSlot(slot));\n this.slots.screenShare.audio.length = 0;\n if (this.slots.screenShare.video) {\n this.receiveSlotManager.releaseSlot(this.slots.screenShare.video);\n this.slots.screenShare.video = undefined;\n }\n\n // release video slots\n this.receiveSlotAllocations = {activeSpeaker: {}, receiverSelected: {}};\n\n this.slots.video.unused.push(...this.slots.video.activeSpeaker);\n this.slots.video.activeSpeaker.length = 0;\n\n this.slots.video.unused.push(...this.slots.video.receiverSelected);\n this.slots.video.receiverSelected.length = 0;\n\n this.releaseUnusedVideoSlots();\n\n this.currentLayout = undefined;\n this.currentLayoutId = undefined;\n this.started = false;\n }\n\n /**\n * Returns the total number of main video panes required for a given layout\n *\n * @param {VideoLayout} layout\n * @returns {number}\n */\n private getRequiredNumVideoSlotsForLayout(layout?: VideoLayout) {\n if (!layout) {\n return 0;\n }\n\n const activeSpeakerCount =\n layout.activeSpeakerVideoPaneGroups?.reduce(\n (sum, paneGroup) => sum + paneGroup.numPanes,\n 0\n ) || 0;\n\n const receiverSelectedCount = layout.memberVideoPanes?.length || 0;\n\n return activeSpeakerCount + receiverSelectedCount;\n }\n\n /**\n * Allocates the maximum number of panes that any of the configured layouts will require.\n * We do this at the beginning, because it's more efficient (much faster) then allocating receive slots\n * later, after the SDP exchange was done.\n */\n private async preallocateVideoReceiveSlots() {\n const maxNumVideoPanesRequired = Object.values(this.config.video.layouts).reduce(\n (maxValue, layout) => Math.max(maxValue, this.getRequiredNumVideoSlotsForLayout(layout)),\n 0\n );\n\n while (this.slots.video.unused.length < maxNumVideoPanesRequired) {\n // eslint-disable-next-line no-await-in-loop\n this.slots.video.unused.push(\n // eslint-disable-next-line no-await-in-loop\n await this.receiveSlotManager.allocateSlot(MediaType.VideoMain)\n );\n }\n }\n\n /**\n * Changes the layout (triggers Event.VideoLayoutChanged)\n *\n * @param {LayoutId} layoutId new layout id\n * @returns {Promise}\n */\n public async setLayout(layoutId: LayoutId) {\n if (!(layoutId in this.config.video.layouts)) {\n throw new Error(\n `invalid layoutId: \"${layoutId}\" doesn't match any of the configured layouts`\n );\n }\n if (!this.started) {\n throw new Error('setLayout() called before start()');\n }\n this.currentLayoutId = layoutId;\n this.currentLayout = cloneDeep(this.config.video.layouts[this.currentLayoutId]);\n\n await this.updateVideoReceiveSlots();\n this.updateVideoRemoteMediaObjects();\n this.updateScreenShareVideoRemoteMediaObject();\n this.emitVideoLayoutChangedEvent();\n }\n\n /**\n * Returns the currently selected layout id\n *\n * @returns {LayoutId}\n */\n public getLayoutId(): LayoutId | undefined {\n return this.currentLayoutId;\n }\n\n /**\n * sets the preferLiveVideo\n */\n public setPreferLiveVideo(preferLiveVideo: boolean) {\n LoggerProxy.logger.log(\n `RemoteMediaManager#setPreferLiveVideo --> setPreferLiveVideo is called to set preferLiveVideo to ${preferLiveVideo}`\n );\n this.config.video.preferLiveVideo = preferLiveVideo;\n Object.values(this.media.video.activeSpeakerGroups).forEach((activeSpeakerGroup) => {\n activeSpeakerGroup.setPreferLiveVideo(preferLiveVideo, false);\n });\n this.mediaRequestManagers.video.commit();\n }\n\n /**\n * Sets CSIs for multiple RemoteMedia instances belonging to 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 */\n public setActiveSpeakerCsis(remoteMediaCsis: {remoteMedia: RemoteMedia; csi?: number}[]) {\n Object.values(this.media.video.activeSpeakerGroups).forEach((remoteMediaGroup) => {\n const groupRemoteMediaCsis = remoteMediaCsis.filter(({remoteMedia}) =>\n remoteMediaGroup.includes(remoteMedia)\n );\n if (groupRemoteMediaCsis.length > 0) {\n remoteMediaGroup.setActiveSpeakerCsis(groupRemoteMediaCsis, false);\n }\n });\n this.mediaRequestManagers.video.commit();\n }\n\n /**\n * Creates the audio slots\n */\n private async createAudioMedia() {\n // create the audio receive slots\n for (let i = 0; i < this.config.audio.numOfActiveSpeakerStreams; i += 1) {\n // eslint-disable-next-line no-await-in-loop\n const slot = await this.receiveSlotManager.allocateSlot(MediaType.AudioMain);\n\n this.slots.audio.push(slot);\n }\n\n // create a remote media group\n this.media.audio = new RemoteMediaGroup(\n this.mediaRequestManagers.audio,\n this.slots.audio,\n 255,\n true\n );\n\n this.emit(\n {file: 'multistream/remoteMediaManager', function: 'createAudioMedia'},\n Event.AudioCreated,\n this.media.audio\n );\n }\n\n /**\n * Creates receive slots required for receiving screen share audio and video\n */\n private async createScreenShareReceiveSlots() {\n // audio\n for (let i = 0; i < this.config.audio.numOfScreenShareStreams; i += 1) {\n // eslint-disable-next-line no-await-in-loop\n const slot = await this.receiveSlotManager.allocateSlot(MediaType.AudioSlides);\n\n this.slots.screenShare.audio.push(slot);\n }\n\n // video\n const isAnyLayoutContainingScreenShareVideo = Object.values(this.config.video.layouts).some(\n (layout) => !!layout.screenShareVideo\n );\n\n if (isAnyLayoutContainingScreenShareVideo) {\n this.slots.screenShare.video = await this.receiveSlotManager.allocateSlot(\n MediaType.VideoSlides\n );\n }\n }\n\n /**\n * Creates RemoteMedia objects for screen share\n */\n private createScreenShareAudioMedia() {\n if (this.slots.screenShare.audio.length > 0) {\n this.media.screenShare.audio = new RemoteMediaGroup(\n this.mediaRequestManagers.screenShareAudio,\n this.slots.screenShare.audio,\n 255,\n true\n );\n\n this.emit(\n {file: 'multistream/remoteMediaManager', function: 'createScreenShareAudioMedia'},\n Event.ScreenShareAudioCreated,\n this.media.screenShare.audio\n );\n }\n }\n\n /**\n * Goes over all receiver-selected slots and keeps only the ones that are required by a given layout,\n * the rest are all moved to the \"unused\" list\n */\n private trimReceiverSelectedSlots() {\n const requiredCsis = {};\n\n // fill requiredCsis with all the CSIs that the given layout requires\n this.currentLayout?.memberVideoPanes?.forEach((memberVideoPane) => {\n if (memberVideoPane.csi !== undefined) {\n requiredCsis[memberVideoPane.csi] = true;\n }\n });\n\n const isCsiNeededByCurrentLayout = (csi?: CSI): boolean => {\n if (csi === undefined) {\n return false;\n }\n\n return !!requiredCsis[csi];\n };\n\n // keep receiverSelected slots that match our new requiredCsis, move the rest of receiverSelected slots to unused\n const notNeededReceiverSelectedSlots = remove(\n this.slots.video.receiverSelected,\n (slot) => isCsiNeededByCurrentLayout(slot.csi) === false\n );\n\n this.slots.video.unused.push(...notNeededReceiverSelectedSlots);\n }\n\n /**\n * Releases all the \"unused\" video slots.\n */\n private releaseUnusedVideoSlots() {\n this.slots.video.unused.forEach((slot) => this.receiveSlotManager.releaseSlot(slot));\n this.slots.video.unused.length = 0;\n }\n\n /**\n * Allocates receive slots to all active speaker video panes\n * in the current selected layout.\n *\n * Allocation tries to keep the same order of the slots between the previous\n * layout and the new one. Sorting helps making sure that highest priority slots\n * go in the same order in the new layout.\n */\n private allocateSlotsToActiveSpeakerPaneGroups() {\n this.currentLayout?.activeSpeakerVideoPaneGroups\n // sorting in descending order based on group priority\n ?.sort((a, b) => (a.priority < b.priority ? 1 : -1))\n ?.forEach((group) => {\n this.receiveSlotAllocations.activeSpeaker[group.id] = {slots: []};\n\n for (let paneIndex = 0; paneIndex < group.numPanes; paneIndex += 1) {\n // allocate a slot from the \"unused\" list, by grabbing in same order (shift) as previous layout\n const freeSlot = this.slots.video.unused.shift();\n\n if (freeSlot) {\n this.slots.video.activeSpeaker.push(freeSlot);\n this.receiveSlotAllocations.activeSpeaker[group.id].slots.push(freeSlot);\n }\n }\n });\n }\n\n /**\n * Allocates receive slots to all receiver selected video panes\n * in the current selected layout\n */\n private allocateSlotsToReceiverSelectedVideoPaneGroups() {\n this.currentLayout?.memberVideoPanes?.forEach((memberPane) => {\n // check if there is existing slot for this csi\n const existingSlot = this.slots.video.receiverSelected.find(\n (slot) => slot.csi === memberPane.csi\n );\n\n const isExistingSlotAlreadyAllocated = Object.values(\n this.receiveSlotAllocations.receiverSelected\n ).includes(existingSlot);\n\n if (memberPane.csi !== undefined && existingSlot && !isExistingSlotAlreadyAllocated) {\n // found it, so use it\n this.receiveSlotAllocations.receiverSelected[memberPane.id] = existingSlot;\n } else {\n // allocate a slot from the \"unused\" list\n const freeSlot = this.slots.video.unused.pop();\n\n if (freeSlot) {\n this.slots.video.receiverSelected.push(freeSlot);\n this.receiveSlotAllocations.receiverSelected[memberPane.id] = freeSlot;\n }\n }\n });\n }\n\n /**\n * Ensures that we have enough slots for the current layout.\n */\n private async refillRequiredSlotsIfNeeded() {\n const requiredNumSlots = this.getRequiredNumVideoSlotsForLayout(this.currentLayout);\n const totalNumSlots =\n this.slots.video.unused.length +\n this.slots.video.activeSpeaker.length +\n this.slots.video.receiverSelected.length;\n\n if (totalNumSlots < requiredNumSlots) {\n let numSlotsToCreate = requiredNumSlots - totalNumSlots;\n\n while (numSlotsToCreate > 0) {\n // eslint-disable-next-line no-await-in-loop\n this.slots.video.unused.push(\n // eslint-disable-next-line no-await-in-loop\n await this.receiveSlotManager.allocateSlot(MediaType.VideoMain)\n );\n numSlotsToCreate -= 1;\n }\n }\n }\n\n /**\n * Move all active speaker slots to \"unused\"\n */\n private trimActiveSpeakerSlots() {\n this.slots.video.unused.push(...this.slots.video.activeSpeaker);\n this.slots.video.activeSpeaker.length = 0;\n }\n\n /**\n * Logs the state of the receive slots\n */\n private logReceieveSlots() {\n let logMessage = '';\n forEach(this.receiveSlotAllocations.activeSpeaker, (group, groupName) => {\n logMessage += `group: ${groupName}\\n${group.slots.map((slot) => slot.logString).join(' ')}`;\n });\n\n logMessage += '\\nreceiverSelected:\\n';\n forEach(this.receiveSlotAllocations.receiverSelected, (slot, key) => {\n logMessage += ` ${key}: ${slot.logString}\\n`;\n });\n\n LoggerProxy.logger.log(\n `RemoteMediaManager#updateVideoReceiveSlots --> receive slots updated: unused=${this.slots.video.unused.length}, activeSpeaker=${this.slots.video.activeSpeaker.length}, receiverSelected=${this.slots.video.receiverSelected.length}\\n${logMessage}`\n );\n }\n\n /**\n * Makes sure we have the right number of receive slots created for the current layout\n * and allocates them to the right video panes / pane groups\n *\n * @returns {Promise}\n */\n private async updateVideoReceiveSlots() {\n // move all active speaker slots to \"unused\"\n this.trimActiveSpeakerSlots();\n\n // move all no longer needed receiver-selected slots to \"unused\"\n this.trimReceiverSelectedSlots();\n\n // ensure we have enough total slots for current layout\n await this.refillRequiredSlotsIfNeeded();\n\n // allocate the slots to the right panes / pane groups\n // reset allocations\n this.receiveSlotAllocations = {activeSpeaker: {}, receiverSelected: {}};\n // allocate active speaker\n this.allocateSlotsToActiveSpeakerPaneGroups();\n // allocate receiver selected\n this.allocateSlotsToReceiverSelectedVideoPaneGroups();\n\n this.logReceieveSlots();\n\n // If this is the initial layout, there may be some \"unused\" slots left because of the preallocation\n // done in this.preallocateVideoReceiveSlots(), so release them now\n this.releaseUnusedVideoSlots();\n }\n\n /**\n * Creates new RemoteMedia and RemoteMediaGroup objects for the current layout\n * and sends the media requests for all of them.\n */\n private updateVideoRemoteMediaObjects() {\n // invalidate all the previous remote media objects and cancel their media requests\n this.invalidateCurrentRemoteMedia({\n audio: false,\n video: true,\n screenShareAudio: false,\n screenShareVideo: false,\n commit: false,\n });\n\n // create new remoteMediaGroup objects\n this.media.video.activeSpeakerGroups = {};\n this.media.video.memberPanes = {};\n\n for (const [groupId, group] of Object.entries(this.receiveSlotAllocations.activeSpeaker)) {\n const paneGroupInCurrentLayout = this.currentLayout?.activeSpeakerVideoPaneGroups?.find(\n (groupInLayout) => groupInLayout.id === groupId\n );\n\n if (paneGroupInCurrentLayout) {\n const mediaGroup = new RemoteMediaGroup(\n this.mediaRequestManagers.video,\n group.slots,\n paneGroupInCurrentLayout.priority,\n false,\n {\n preferLiveVideo: this.config.video.preferLiveVideo,\n resolution: paneGroupInCurrentLayout.size,\n }\n );\n\n this.media.video.activeSpeakerGroups[groupId] = mediaGroup;\n } else {\n // this should never happen, because this.receiveSlotAllocations are created based on current layout configuration\n LoggerProxy.logger.warn(\n `a group id ${groupId} from this.receiveSlotAllocations.activeSpeaker cannot be found in the current layout configuration`\n );\n }\n }\n\n // create new remoteMedia objects\n for (const [paneId, slot] of Object.entries(this.receiveSlotAllocations.receiverSelected)) {\n const paneInCurrentLayout = this.currentLayout?.memberVideoPanes?.find(\n (paneInLayout) => paneInLayout.id === paneId\n );\n\n if (paneInCurrentLayout) {\n const remoteMedia = new RemoteMedia(slot, this.mediaRequestManagers.video, {\n resolution: paneInCurrentLayout.size,\n });\n\n if (paneInCurrentLayout.csi) {\n remoteMedia.sendMediaRequest(paneInCurrentLayout.csi, false);\n }\n\n this.media.video.memberPanes[paneId] = remoteMedia;\n } else {\n // this should never happen, because this.receiveSlotAllocations are created based on current layout configuration\n LoggerProxy.logger.warn(\n `a pane id ${paneId} from this.receiveSlotAllocations.receiverSelected cannot be found in the current layout configuration`\n );\n }\n }\n\n this.mediaRequestManagers.video.commit();\n }\n\n /**\n * Checks if current layout requires a screen share.\n * If it does, it creates new RemoteMediaGroup object for screen share\n * and sends the media requests for it.\n * If it doesn't, it makes sure we clean up any RemoteMediaGroup objects\n * created earlier for screen share (for previous layout).\n */\n private updateScreenShareVideoRemoteMediaObject() {\n this.invalidateCurrentRemoteMedia({\n audio: false,\n video: false,\n screenShareAudio: false,\n screenShareVideo: true,\n commit: false,\n });\n\n this.media.screenShare.video = undefined;\n\n if (this.currentLayout?.screenShareVideo) {\n // we create a group of 1, because for screen share we need to use the \"active speaker\" policy\n this.media.screenShare.video = new RemoteMediaGroup(\n this.mediaRequestManagers.screenShareVideo,\n [this.slots.screenShare.video],\n 255,\n false,\n {resolution: this.currentLayout.screenShareVideo.size}\n );\n }\n\n this.mediaRequestManagers.screenShareVideo.commit();\n }\n\n /**\n * Invalidates all remote media objects belonging to currently selected layout\n */\n private invalidateCurrentRemoteMedia(options: {\n audio: boolean;\n video: boolean;\n screenShareAudio: boolean;\n screenShareVideo: boolean;\n commit: boolean;\n }) {\n const {audio, video, screenShareAudio, screenShareVideo, commit} = options;\n\n if (audio && this.media.audio) {\n this.media.audio.stop(commit);\n }\n if (video) {\n Object.values(this.media.video.activeSpeakerGroups).forEach((remoteMediaGroup) => {\n remoteMediaGroup.stop(false);\n });\n Object.values(this.media.video.memberPanes).forEach((remoteMedia) => {\n remoteMedia.stop(false);\n });\n if (commit) {\n this.mediaRequestManagers.video.commit();\n }\n }\n\n if (screenShareAudio && this.media.screenShare.audio) {\n this.media.screenShare.audio.stop(commit);\n }\n if (screenShareVideo && this.media.screenShare.video) {\n this.media.screenShare.video.stop(commit);\n }\n }\n\n /** emits Event.VideoLayoutChanged */\n private emitVideoLayoutChangedEvent() {\n // todo: at this point the receive slots might still be showing a participant from previous layout, we should\n // wait for our media requests to be fulfilled, but there is no API for that right now (we could wait for source updates\n // but in some cases they might never come, or would need to always make sure to use a new set of receiver slots)\n // for now it's fine to have it like this, we will re-evaluate if it needs improving after more testing\n\n this.emit(\n {\n file: 'multistream/remoteMediaManager',\n function: 'emitVideoLayoutChangedEvent',\n },\n Event.VideoLayoutChanged,\n {\n layoutId: this.currentLayoutId,\n activeSpeakerVideoPanes: this.media.video.activeSpeakerGroups,\n memberVideoPanes: this.media.video.memberPanes,\n screenShareVideo: this.media.screenShare.video?.getRemoteMedia()[0],\n }\n );\n }\n\n /**\n * Sets a new CSI on a given remote media object\n *\n * @param {RemoteMedia} remoteMedia remote Media object to modify\n * @param {CSI} csi new CSI value, can be null if we want to stop receiving media\n */\n public setRemoteVideoCsi(remoteMedia: RemoteMedia, csi: CSI | null) {\n if (!Object.values(this.media.video.memberPanes).includes(remoteMedia)) {\n throw new Error('remoteMedia not found');\n }\n\n if (csi) {\n remoteMedia.sendMediaRequest(csi, true);\n } else {\n remoteMedia.cancelMediaRequest(true);\n }\n }\n\n /**\n * Adds a new member video pane to the currently selected layout.\n *\n * Changes to the layout are lost after a layout change.\n *\n * @param {MemberVideoPane} newPane\n * @returns {Promise<RemoteMedia>}\n */\n public async addMemberVideoPane(newPane: MemberVideoPane): Promise<RemoteMedia> {\n if (!this.currentLayout) {\n throw new Error('There is no current layout selected, call start() first');\n }\n\n if (!this.currentLayout?.memberVideoPanes) {\n this.currentLayout.memberVideoPanes = [];\n }\n\n if (newPane.id in this.currentLayout.memberVideoPanes) {\n throw new Error(\n `duplicate pane id ${newPane.id} - this pane already exists in current layout's memberVideoPanes`\n );\n }\n\n this.currentLayout.memberVideoPanes.push(newPane);\n\n const receiveSlot = await this.receiveSlotManager.allocateSlot(MediaType.VideoMain);\n\n this.slots.video.receiverSelected.push(receiveSlot);\n\n const remoteMedia = new RemoteMedia(receiveSlot, this.mediaRequestManagers.video, {\n resolution: newPane.size,\n });\n\n if (newPane.csi) {\n remoteMedia.sendMediaRequest(newPane.csi, true);\n }\n\n this.media.video.memberPanes[newPane.id] = remoteMedia;\n\n return remoteMedia;\n }\n\n /**\n * Removes a member video pane from the currently selected layout.\n *\n * Changes to the layout are lost after a layout change.\n *\n * @param {PaneId} paneId pane id of the pane to remove\n * @returns {Promise<void>}\n */\n public removeMemberVideoPane(paneId: PaneId): Promise<void> {\n if (!this.currentLayout) {\n return Promise.reject(new Error('There is no current layout selected, call start() first'));\n }\n\n if (!this.currentLayout.memberVideoPanes?.find((pane) => pane.id === paneId)) {\n // pane id doesn't exist, so nothing to do\n LoggerProxy.logger.log(\n `RemoteMediaManager#removeMemberVideoPane --> removeMemberVideoPane() called for a non-existent paneId: ${paneId} (pane not found in currentLayout.memberVideoPanes)`\n );\n\n return Promise.resolve();\n }\n\n if (!this.media.video.memberPanes[paneId]) {\n // pane id doesn't exist, so nothing to do\n LoggerProxy.logger.log(\n `RemoteMediaManager#removeMemberVideoPane --> removeMemberVideoPane() called for a non-existent paneId: ${paneId} (pane not found in this.media.video.memberPanes)`\n );\n\n return Promise.resolve();\n }\n\n const remoteMedia = this.media.video.memberPanes[paneId];\n\n const receiveSlot = remoteMedia.getUnderlyingReceiveSlot();\n\n if (receiveSlot) {\n this.receiveSlotManager.releaseSlot(receiveSlot);\n\n const index = this.slots.video.receiverSelected.indexOf(receiveSlot);\n\n if (index >= 0) {\n this.slots.video.receiverSelected.splice(index, 1);\n }\n }\n remoteMedia.stop();\n\n delete this.media.video.memberPanes[paneId];\n delete this.currentLayout.memberVideoPanes?.[paneId];\n\n return Promise.resolve();\n }\n\n /**\n * Pins an active speaker remote media object to the given CSI value. From that moment\n * onwards the remote media will only play audio/video from that specific CSI until\n * unpinActiveSpeakerVideoPane() is called or current layout is changed.\n *\n * @param {RemoteMedia} remoteMedia remote media object reference\n * @param {CSI} csi CSI value to pin to, if undefined, then current CSI value is used\n */\n public pinActiveSpeakerVideoPane(remoteMedia: RemoteMedia, csi?: CSI): void {\n const remoteMediaGroup = Object.values(this.media.video.activeSpeakerGroups).find((group) =>\n group.includes(remoteMedia, 'unpinned')\n );\n\n if (!remoteMediaGroup) {\n throw new Error(\n 'remoteMedia not found among the unpinned remote media from any active speaker group'\n );\n }\n\n remoteMediaGroup.pin(remoteMedia, csi);\n }\n\n /**\n * Unpins a remote media object from the fixed CSI value it was pinned to.\n *\n * @param {RemoteMedia} remoteMedia remote media object reference\n */\n public unpinActiveSpeakerVideoPane(remoteMedia: RemoteMedia) {\n const remoteMediaGroup = Object.values(this.media.video.activeSpeakerGroups).find((group) =>\n group.includes(remoteMedia, 'pinned')\n );\n\n if (!remoteMediaGroup) {\n throw new Error(\n 'remoteMedia not found among the pinned remote media from any active speaker group'\n );\n }\n\n remoteMediaGroup.unpin(remoteMedia);\n }\n\n /**\n * Returns true if a given remote media object belongs to an active speaker group and has been pinned.\n * Throws an error if the remote media object doesn't belong to any active speaker remote media group.\n *\n * @param {RemoteMedia} remoteMedia remote media object\n * @returns {boolean}\n */\n public isPinned(remoteMedia: RemoteMedia) {\n const remoteMediaGroup = Object.values(this.media.video.activeSpeakerGroups).find((group) =>\n group.includes(remoteMedia)\n );\n\n if (!remoteMediaGroup) {\n throw new Error(\n 'remoteMedia not found among any remote media (pinned or unpinned) from any active speaker group'\n );\n }\n\n return remoteMediaGroup.isPinned(remoteMedia);\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA;AAEA;AACA;AAEA;AAGA;AAAoD;AAAA;AA0CpD;;AAEA;AACA,IAAMA,cAA2B,GAAG;EAClCC,4BAA4B,EAAE,CAC5B;IACEC,EAAE,EAAE,MAAM;IACVC,QAAQ,EAAE,CAAC;IACXC,IAAI,EAAE,MAAM;IACZC,QAAQ,EAAE;EACZ,CAAC;AAEL,CAAC;;AAED;AACA,IAAMC,YAAyB,GAAG;EAChCL,4BAA4B,EAAE,CAC5B;IACEC,EAAE,EAAE,MAAM;IACVC,QAAQ,EAAE,CAAC;IACXC,IAAI,EAAE,MAAM;IACZC,QAAQ,EAAE;EACZ,CAAC;AAEL,CAAC;;AAED;AACA,IAAME,iBAA8B,GAAG;EACrCN,4BAA4B,EAAE,CAC5B;IACEC,EAAE,EAAE,YAAY;IAChBC,QAAQ,EAAE,CAAC;IACXC,IAAI,EAAE,OAAO;IACbC,QAAQ,EAAE;EACZ,CAAC,EACD;IACEH,EAAE,EAAE,0BAA0B;IAC9BC,QAAQ,EAAE,CAAC;IACXC,IAAI,EAAE,YAAY;IAClBC,QAAQ,EAAE;EACZ,CAAC;AAEL,CAAC;;AAED;AACA;AACA,IAAMG,yBAAsC,GAAG;EAC7CP,4BAA4B,EAAE,CAC5B;IACEC,EAAE,EAAE,wBAAwB;IAC5BC,QAAQ,EAAE,CAAC;IACXC,IAAI,EAAE,OAAO;IACbC,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mB,CAAC,CAACsF,IAAI,CAAC,UAACpE,KAAK;QAAA,OACtFA,KAAK,CAAC0C,QAAQ,CAACD,WAAW,EAAE,UAAU,CAAC;MAAA,EACxC;MAED,IAAI,CAACH,gBAAgB,EAAE;QACrB,MAAM,IAAI5C,KAAK,CACb,qFAAqF,CACtF;MACH;MAEA4C,gBAAgB,CAACyE,GAAG,CAACtE,WAAW,EAAEjF,GAAG,CAAC;IACxC;;IAEA;AACF;AACA;AACA;AACA;EAJE;IAAA;IAAA,OAKA,qCAAmCiF,WAAwB,EAAE;MAC3D,IAAMH,gBAAgB,GAAG,qBAAc,IAAI,CAACzD,KAAK,CAACf,KAAK,CAACgB,mBAAmB,CAAC,CAACsF,IAAI,CAAC,UAACpE,KAAK;QAAA,OACtFA,KAAK,CAAC0C,QAAQ,CAACD,WAAW,EAAE,QAAQ,CAAC;MAAA,EACtC;MAED,IAAI,CAACH,gBAAgB,EAAE;QACrB,MAAM,IAAI5C,KAAK,CACb,mFAAmF,CACpF;MACH;MAEA4C,gBAAgB,CAAC0E,KAAK,CAACvE,WAAW,CAAC;IACrC;;IAEA;AACF;AACA;AACA;AACA;AACA;AACA;EANE;IAAA;IAAA,OAOA,kBAAgBA,WAAwB,EAAE;MACxC,IAAMH,gBAAgB,GAAG,qBAAc,IAAI,CAACzD,KAAK,CAACf,KAAK,CAACgB,mBAAmB,CAAC,CAACsF,IAAI,CAAC,UAACpE,KAAK;QAAA,OACtFA,KAAK,CAAC0C,QAAQ,CAACD,WAAW,CAAC;MAAA,EAC5B;MAED,IAAI,CAACH,gBAAgB,EAAE;QACrB,MAAM,IAAI5C,KAAK,CACb,iGAAiG,CAClG;MACH;MAEA,OAAO4C,gBAAgB,CAAC2E,QAAQ,CAACxE,WAAW,CAAC;IAC/C;EAAC;EAAA;AAAA,EAp4BqCyE,oBAAW;AAAA"}
1
+ {"version":3,"names":["AllEqualLayout","activeSpeakerVideoPaneGroups","id","numPanes","size","priority","SingleLayout","OnePlusFiveLayout","TwoMainPlusSixSmallLayout","RemoteScreenShareWithSmallThumbnailsLayout","screenShareVideo","Stage2x2With6ThumbnailsLayout","memberVideoPanes","csi","undefined","DefaultConfiguration","audio","numOfActiveSpeakerStreams","numOfScreenShareStreams","video","preferLiveVideo","initialLayoutId","layouts","AllEqual","OnePlusFive","Single","Stage","ScreenShareView","Event","RemoteMediaManager","receiveSlotManager","mediaRequestManagers","config","started","media","activeSpeakerGroups","memberPanes","screenShare","checkConfigValidity","slots","unused","activeSpeaker","receiverSelected","receiveSlotAllocations","LoggerProxy","logger","log","Error","forEach","layout","groupIds","paneIds","groupPriorites","group","pane","createAudioMedia","createScreenShareReceiveSlots","createScreenShareAudioMedia","preallocateVideoReceiveSlots","setLayout","invalidateCurrentRemoteMedia","screenShareAudio","commit","slot","releaseSlot","length","push","releaseUnusedVideoSlots","currentLayout","currentLayoutId","activeSpeakerCount","reduce","sum","paneGroup","receiverSelectedCount","maxNumVideoPanesRequired","maxValue","Math","max","getRequiredNumVideoSlotsForLayout","allocateSlot","MediaType","VideoMain","layoutId","updateVideoReceiveSlots","updateVideoRemoteMediaObjects","updateScreenShareVideoRemoteMediaObject","emitVideoLayoutChangedEvent","activeSpeakerGroup","setPreferLiveVideo","remoteMediaCsis","remoteMediaGroup","groupRemoteMediaCsis","filter","remoteMedia","includes","setActiveSpeakerCsis","i","AudioMain","RemoteMediaGroup","emit","file","function","AudioCreated","AudioSlides","isAnyLayoutContainingScreenShareVideo","some","VideoSlides","ScreenShareAudioCreated","requiredCsis","memberVideoPane","isCsiNeededByCurrentLayout","notNeededReceiverSelectedSlots","sort","a","b","paneIndex","freeSlot","shift","memberPane","existingSlot","find","isExistingSlotAlreadyAllocated","pop","requiredNumSlots","totalNumSlots","numSlotsToCreate","logMessage","groupName","map","logString","join","key","logMainVideoReceiveSlots","logMainAudioReceiveSlots","logSlidesVideoReceiveSlots","logSlidesAudioReceiveSlots","trimActiveSpeakerSlots","trimReceiverSelectedSlots","refillRequiredSlotsIfNeeded","allocateSlotsToActiveSpeakerPaneGroups","allocateSlotsToReceiverSelectedVideoPaneGroups","groupId","paneGroupInCurrentLayout","groupInLayout","mediaGroup","resolution","warn","paneId","paneInCurrentLayout","paneInLayout","RemoteMedia","sendMediaRequest","options","stop","VideoLayoutChanged","activeSpeakerVideoPanes","getRemoteMedia","cancelMediaRequest","newPane","receiveSlot","reject","resolve","getUnderlyingReceiveSlot","index","indexOf","splice","pin","unpin","isPinned","EventsScope"],"sources":["remoteMediaManager.ts"],"sourcesContent":["/* eslint-disable valid-jsdoc */\nimport {cloneDeep, forEach, remove} from 'lodash';\nimport {EventMap} from 'typed-emitter';\nimport {MediaType} from '@webex/internal-media-core';\n\nimport LoggerProxy from '../common/logs/logger-proxy';\nimport EventsScope from '../common/events/events-scope';\n\nimport {RemoteMedia, RemoteVideoResolution} from './remoteMedia';\nimport {ReceiveSlot, CSI} from './receiveSlot';\nimport {ReceiveSlotManager} from './receiveSlotManager';\nimport {RemoteMediaGroup} from './remoteMediaGroup';\nimport {MediaRequestManager} from './mediaRequestManager';\n\nexport type PaneSize = RemoteVideoResolution;\nexport type LayoutId = string;\nexport type PaneId = string;\nexport type PaneGroupId = string;\n\nexport interface ActiveSpeakerVideoPaneGroup {\n id: PaneGroupId;\n numPanes: number; // maximum number of panes in the group (actual number may be lower, if there are not enough participants in the meeting)\n size: PaneSize; // preferred size for all panes in the group\n priority: number; // 0-255 (255 = highest priority), each group must have a different priority from all other groups\n}\n\nexport interface MemberVideoPane {\n id: PaneId;\n size: PaneSize;\n csi?: CSI;\n}\n\nexport interface VideoLayout {\n screenShareVideo?: {\n size: PaneSize;\n };\n activeSpeakerVideoPaneGroups?: ActiveSpeakerVideoPaneGroup[]; // list of active speaker video pane groups\n memberVideoPanes?: MemberVideoPane[]; // list of video panes for specific members, CSI values can be changed later via setVideoPaneCsi()\n}\n\nexport interface Configuration {\n audio: {\n numOfActiveSpeakerStreams: number; // number of audio streams we want to receive\n numOfScreenShareStreams: number; // 1 should be enough, because in webex only 1 person at a time can be presenting screen share\n };\n video: {\n preferLiveVideo: boolean; // applies to all pane groups with active speaker policy\n initialLayoutId: LayoutId;\n\n layouts: {[key: LayoutId]: VideoLayout}; // a map of all available layouts, a layout can be set via setLayout() method\n };\n}\n\n/* Predefined layouts: */\n\n// An \"all equal\" grid, with size up to 3 x 3 = 9:\nconst AllEqualLayout: VideoLayout = {\n activeSpeakerVideoPaneGroups: [\n {\n id: 'main',\n numPanes: 9,\n size: 'best',\n priority: 255,\n },\n ],\n};\n\n// A layout with just a single remote active speaker video pane:\nconst SingleLayout: VideoLayout = {\n activeSpeakerVideoPaneGroups: [\n {\n id: 'main',\n numPanes: 1,\n size: 'best',\n priority: 255,\n },\n ],\n};\n\n// A layout with 1 big pane for the highest priority active speaker and 5 small panes for other active speakers:\nconst OnePlusFiveLayout: VideoLayout = {\n activeSpeakerVideoPaneGroups: [\n {\n id: 'mainBigOne',\n numPanes: 1,\n size: 'large',\n priority: 255,\n },\n {\n id: 'secondarySetOfSmallPanes',\n numPanes: 5,\n size: 'very small',\n priority: 254,\n },\n ],\n};\n\n// A layout with 2 big panes for 2 main active speakers and a strip of 6 small panes for other active speakers:\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nconst TwoMainPlusSixSmallLayout: VideoLayout = {\n activeSpeakerVideoPaneGroups: [\n {\n id: 'mainGroupWith2BigPanes',\n numPanes: 2,\n size: 'large',\n priority: 255,\n },\n {\n id: 'secondaryGroupOfSmallPanes',\n numPanes: 6,\n size: 'small',\n priority: 254,\n },\n ],\n};\n\n// A strip of 8 small video panes (thumbnails) displayed at the top of a remote screenshare:\nconst RemoteScreenShareWithSmallThumbnailsLayout: VideoLayout = {\n screenShareVideo: {size: 'best'},\n activeSpeakerVideoPaneGroups: [\n {\n id: 'thumbnails',\n numPanes: 8,\n size: 'thumbnail',\n priority: 255,\n },\n ],\n};\n\n// A staged layout with 4 pre-selected meeting participants in the main 2x2 grid and 6 small panes for other active speakers at the top:\nconst Stage2x2With6ThumbnailsLayout: VideoLayout = {\n activeSpeakerVideoPaneGroups: [\n {\n id: 'thumbnails',\n numPanes: 6,\n size: 'thumbnail',\n priority: 255,\n },\n ],\n memberVideoPanes: [\n {id: 'stage-1', size: 'medium', csi: undefined},\n {id: 'stage-2', size: 'medium', csi: undefined},\n {id: 'stage-3', size: 'medium', csi: undefined},\n {id: 'stage-4', size: 'medium', csi: undefined},\n ],\n};\n\n/**\n * Default configuration:\n * - uses 3 audio streams\n * - prefers active speakers with live video (e.g. are not audio only or video muted) over active speakers without live video\n * - has a few layouts defined, including 1 that contains remote screen share (ScreenShareView)\n */\nexport const DefaultConfiguration: Configuration = {\n audio: {\n numOfActiveSpeakerStreams: 3,\n numOfScreenShareStreams: 1,\n },\n video: {\n preferLiveVideo: true,\n initialLayoutId: 'AllEqual',\n\n layouts: {\n AllEqual: AllEqualLayout,\n OnePlusFive: OnePlusFiveLayout,\n Single: SingleLayout,\n Stage: Stage2x2With6ThumbnailsLayout,\n ScreenShareView: RemoteScreenShareWithSmallThumbnailsLayout,\n },\n },\n};\n\nexport enum Event {\n // events for audio streams\n AudioCreated = 'AudioCreated',\n ScreenShareAudioCreated = 'ScreenShareAudioCreated',\n\n // events for video streams\n VideoLayoutChanged = 'VideoLayoutChanged',\n}\n\nexport interface VideoLayoutChangedEventData {\n layoutId: LayoutId;\n activeSpeakerVideoPanes: {\n [key: PaneGroupId]: RemoteMediaGroup;\n };\n memberVideoPanes: {[key: PaneId]: RemoteMedia};\n screenShareVideo?: RemoteMedia;\n}\nexport interface Events extends EventMap {\n // audio\n [Event.AudioCreated]: (audio: RemoteMediaGroup) => void;\n [Event.ScreenShareAudioCreated]: (screenShareAudio: RemoteMediaGroup) => void;\n\n // video\n [Event.VideoLayoutChanged]: (data: VideoLayoutChangedEventData) => void;\n}\n\n/**\n * A helper class that manages all remote audio/video streams in order to achieve a predefined set of layouts.\n * It also creates a fixed number of audio streams and these don't change during the meeting.\n *\n * Things that RemoteMediaManager does:\n * - owns the receive slots (creates them when needed, and re-uses them when switching layouts)\n * - constructs appropriate RemoteMedia and RemoteMediaGroup objects and sends appropriate mediaRequests\n */\nexport class RemoteMediaManager extends EventsScope {\n private config: Configuration;\n\n private started: boolean;\n\n private receiveSlotManager: ReceiveSlotManager;\n\n private mediaRequestManagers: {\n audio: MediaRequestManager;\n video: MediaRequestManager;\n screenShareAudio: MediaRequestManager;\n screenShareVideo: MediaRequestManager;\n };\n\n private currentLayout?: VideoLayout;\n\n private slots: {\n audio: ReceiveSlot[];\n screenShare: {\n audio: ReceiveSlot[];\n video?: ReceiveSlot;\n };\n video: {\n unused: ReceiveSlot[];\n activeSpeaker: ReceiveSlot[];\n receiverSelected: ReceiveSlot[];\n };\n };\n\n private media: {\n audio?: RemoteMediaGroup;\n video: {\n activeSpeakerGroups: {\n [key: PaneGroupId]: RemoteMediaGroup;\n };\n memberPanes: {[key: PaneId]: RemoteMedia};\n };\n screenShare: {\n audio?: RemoteMediaGroup;\n video?: RemoteMediaGroup;\n };\n };\n\n private receiveSlotAllocations: {\n activeSpeaker: {[key: PaneGroupId]: {slots: ReceiveSlot[]}};\n receiverSelected: {[key: PaneId]: ReceiveSlot};\n };\n\n private currentLayoutId?: LayoutId;\n\n /**\n * Constructor\n *\n * @param {ReceiveSlotManager} receiveSlotManager\n * @param {{audio: MediaRequestManager, video: mediaRequestManagers}} mediaRequestManagers\n * @param {Configuration} config Configuration describing what video layouts to use during the meeting\n */\n constructor(\n receiveSlotManager: ReceiveSlotManager,\n mediaRequestManagers: {\n audio: MediaRequestManager;\n video: MediaRequestManager;\n screenShareAudio: MediaRequestManager;\n screenShareVideo: MediaRequestManager;\n },\n config: Configuration = DefaultConfiguration\n ) {\n super();\n this.started = false;\n this.config = config;\n this.receiveSlotManager = receiveSlotManager;\n this.mediaRequestManagers = mediaRequestManagers;\n this.media = {\n audio: undefined,\n video: {\n activeSpeakerGroups: {},\n memberPanes: {},\n },\n screenShare: {\n audio: undefined,\n video: undefined,\n },\n };\n\n this.checkConfigValidity();\n\n this.slots = {\n audio: [],\n screenShare: {\n audio: [],\n video: undefined,\n },\n video: {\n unused: [],\n activeSpeaker: [],\n receiverSelected: [],\n },\n };\n\n this.receiveSlotAllocations = {activeSpeaker: {}, receiverSelected: {}};\n\n LoggerProxy.logger.log(\n `RemoteMediaManager#constructor --> RemoteMediaManager created with config: ${JSON.stringify(\n this.config\n )}`\n );\n }\n\n /**\n * Checks if configuration is valid, throws an error if it's not\n */\n private checkConfigValidity() {\n if (!(this.config.video.initialLayoutId in this.config.video.layouts)) {\n throw new Error(\n `invalid config: initialLayoutId \"${this.config.video.initialLayoutId}\" doesn't match any of the layouts`\n );\n }\n\n // check if each layout is valid\n Object.values(this.config.video.layouts).forEach((layout) => {\n const groupIds = {};\n const paneIds = {};\n const groupPriorites = {};\n\n layout.activeSpeakerVideoPaneGroups?.forEach((group) => {\n if (groupIds[group.id]) {\n throw new Error(\n `invalid config: duplicate active speaker video pane group id: ${group.id}`\n );\n }\n groupIds[group.id] = true;\n\n if (groupPriorites[group.priority]) {\n throw new Error(\n `invalid config: multiple active speaker video pane groups have same priority: ${group.priority}`\n );\n }\n groupPriorites[group.priority] = true;\n });\n\n layout.memberVideoPanes?.forEach((pane) => {\n if (paneIds[pane.id]) {\n throw new Error(`invalid config: duplicate member video pane id: ${pane.id}`);\n }\n paneIds[pane.id] = true;\n });\n });\n }\n\n /**\n * Starts the RemoteMediaManager.\n *\n * @returns {Promise}\n */\n public async start() {\n if (this.started) {\n throw new Error('start() failure: already started');\n }\n this.started = true;\n\n await this.createAudioMedia();\n\n await this.createScreenShareReceiveSlots();\n this.createScreenShareAudioMedia();\n\n await this.preallocateVideoReceiveSlots();\n\n await this.setLayout(this.config.video.initialLayoutId);\n }\n\n /**\n * Releases all the used resources (like allocated receive slots). This function needs\n * to be called when we leave the meeting, etc.\n */\n public stop() {\n // invalidate all remoteMedia objects\n this.invalidateCurrentRemoteMedia({\n audio: true,\n video: true,\n screenShareAudio: true,\n screenShareVideo: true,\n commit: true,\n });\n\n // release all audio receive slots\n this.slots.audio.forEach((slot) => this.receiveSlotManager.releaseSlot(slot));\n this.slots.audio.length = 0;\n\n // release screen share slots\n this.slots.screenShare.audio.forEach((slot) => this.receiveSlotManager.releaseSlot(slot));\n this.slots.screenShare.audio.length = 0;\n if (this.slots.screenShare.video) {\n this.receiveSlotManager.releaseSlot(this.slots.screenShare.video);\n this.slots.screenShare.video = undefined;\n }\n\n // release video slots\n this.receiveSlotAllocations = {activeSpeaker: {}, receiverSelected: {}};\n\n this.slots.video.unused.push(...this.slots.video.activeSpeaker);\n this.slots.video.activeSpeaker.length = 0;\n\n this.slots.video.unused.push(...this.slots.video.receiverSelected);\n this.slots.video.receiverSelected.length = 0;\n\n this.releaseUnusedVideoSlots();\n\n this.currentLayout = undefined;\n this.currentLayoutId = undefined;\n this.started = false;\n }\n\n /**\n * Returns the total number of main video panes required for a given layout\n *\n * @param {VideoLayout} layout\n * @returns {number}\n */\n private getRequiredNumVideoSlotsForLayout(layout?: VideoLayout) {\n if (!layout) {\n return 0;\n }\n\n const activeSpeakerCount =\n layout.activeSpeakerVideoPaneGroups?.reduce(\n (sum, paneGroup) => sum + paneGroup.numPanes,\n 0\n ) || 0;\n\n const receiverSelectedCount = layout.memberVideoPanes?.length || 0;\n\n return activeSpeakerCount + receiverSelectedCount;\n }\n\n /**\n * Allocates the maximum number of panes that any of the configured layouts will require.\n * We do this at the beginning, because it's more efficient (much faster) then allocating receive slots\n * later, after the SDP exchange was done.\n */\n private async preallocateVideoReceiveSlots() {\n const maxNumVideoPanesRequired = Object.values(this.config.video.layouts).reduce(\n (maxValue, layout) => Math.max(maxValue, this.getRequiredNumVideoSlotsForLayout(layout)),\n 0\n );\n\n while (this.slots.video.unused.length < maxNumVideoPanesRequired) {\n // eslint-disable-next-line no-await-in-loop\n this.slots.video.unused.push(\n // eslint-disable-next-line no-await-in-loop\n await this.receiveSlotManager.allocateSlot(MediaType.VideoMain)\n );\n }\n }\n\n /**\n * Changes the layout (triggers Event.VideoLayoutChanged)\n *\n * @param {LayoutId} layoutId new layout id\n * @returns {Promise}\n */\n public async setLayout(layoutId: LayoutId) {\n if (!(layoutId in this.config.video.layouts)) {\n throw new Error(\n `invalid layoutId: \"${layoutId}\" doesn't match any of the configured layouts`\n );\n }\n if (!this.started) {\n throw new Error('setLayout() called before start()');\n }\n LoggerProxy.logger.log(`RemoteMediaManager#setLayout --> new layout selected: ${layoutId}`);\n\n this.currentLayoutId = layoutId;\n this.currentLayout = cloneDeep(this.config.video.layouts[this.currentLayoutId]);\n\n await this.updateVideoReceiveSlots();\n this.updateVideoRemoteMediaObjects();\n this.updateScreenShareVideoRemoteMediaObject();\n this.emitVideoLayoutChangedEvent();\n }\n\n /**\n * Returns the currently selected layout id\n *\n * @returns {LayoutId}\n */\n public getLayoutId(): LayoutId | undefined {\n return this.currentLayoutId;\n }\n\n /**\n * sets the preferLiveVideo\n */\n public setPreferLiveVideo(preferLiveVideo: boolean) {\n LoggerProxy.logger.log(\n `RemoteMediaManager#setPreferLiveVideo --> setPreferLiveVideo is called to set preferLiveVideo to ${preferLiveVideo}`\n );\n this.config.video.preferLiveVideo = preferLiveVideo;\n Object.values(this.media.video.activeSpeakerGroups).forEach((activeSpeakerGroup) => {\n activeSpeakerGroup.setPreferLiveVideo(preferLiveVideo, false);\n });\n this.mediaRequestManagers.video.commit();\n }\n\n /**\n * Sets CSIs for multiple RemoteMedia instances belonging to 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 */\n public setActiveSpeakerCsis(remoteMediaCsis: {remoteMedia: RemoteMedia; csi?: number}[]) {\n Object.values(this.media.video.activeSpeakerGroups).forEach((remoteMediaGroup) => {\n const groupRemoteMediaCsis = remoteMediaCsis.filter(({remoteMedia}) =>\n remoteMediaGroup.includes(remoteMedia)\n );\n if (groupRemoteMediaCsis.length > 0) {\n remoteMediaGroup.setActiveSpeakerCsis(groupRemoteMediaCsis, false);\n }\n });\n this.mediaRequestManagers.video.commit();\n }\n\n /**\n * Creates the audio slots\n */\n private async createAudioMedia() {\n // create the audio receive slots\n for (let i = 0; i < this.config.audio.numOfActiveSpeakerStreams; i += 1) {\n // eslint-disable-next-line no-await-in-loop\n const slot = await this.receiveSlotManager.allocateSlot(MediaType.AudioMain);\n\n this.slots.audio.push(slot);\n }\n\n // create a remote media group\n this.media.audio = new RemoteMediaGroup(\n this.mediaRequestManagers.audio,\n this.slots.audio,\n 255,\n true\n );\n\n this.emit(\n {file: 'multistream/remoteMediaManager', function: 'createAudioMedia'},\n Event.AudioCreated,\n this.media.audio\n );\n }\n\n /**\n * Creates receive slots required for receiving screen share audio and video\n */\n private async createScreenShareReceiveSlots() {\n // audio\n for (let i = 0; i < this.config.audio.numOfScreenShareStreams; i += 1) {\n // eslint-disable-next-line no-await-in-loop\n const slot = await this.receiveSlotManager.allocateSlot(MediaType.AudioSlides);\n\n this.slots.screenShare.audio.push(slot);\n }\n\n // video\n const isAnyLayoutContainingScreenShareVideo = Object.values(this.config.video.layouts).some(\n (layout) => !!layout.screenShareVideo\n );\n\n if (isAnyLayoutContainingScreenShareVideo) {\n this.slots.screenShare.video = await this.receiveSlotManager.allocateSlot(\n MediaType.VideoSlides\n );\n }\n }\n\n /**\n * Creates RemoteMedia objects for screen share\n */\n private createScreenShareAudioMedia() {\n if (this.slots.screenShare.audio.length > 0) {\n this.media.screenShare.audio = new RemoteMediaGroup(\n this.mediaRequestManagers.screenShareAudio,\n this.slots.screenShare.audio,\n 255,\n true\n );\n\n this.emit(\n {file: 'multistream/remoteMediaManager', function: 'createScreenShareAudioMedia'},\n Event.ScreenShareAudioCreated,\n this.media.screenShare.audio\n );\n }\n }\n\n /**\n * Goes over all receiver-selected slots and keeps only the ones that are required by a given layout,\n * the rest are all moved to the \"unused\" list\n */\n private trimReceiverSelectedSlots() {\n const requiredCsis = {};\n\n // fill requiredCsis with all the CSIs that the given layout requires\n this.currentLayout?.memberVideoPanes?.forEach((memberVideoPane) => {\n if (memberVideoPane.csi !== undefined) {\n requiredCsis[memberVideoPane.csi] = true;\n }\n });\n\n const isCsiNeededByCurrentLayout = (csi?: CSI): boolean => {\n if (csi === undefined) {\n return false;\n }\n\n return !!requiredCsis[csi];\n };\n\n // keep receiverSelected slots that match our new requiredCsis, move the rest of receiverSelected slots to unused\n const notNeededReceiverSelectedSlots = remove(\n this.slots.video.receiverSelected,\n (slot) => isCsiNeededByCurrentLayout(slot.csi) === false\n );\n\n this.slots.video.unused.push(...notNeededReceiverSelectedSlots);\n }\n\n /**\n * Releases all the \"unused\" video slots.\n */\n private releaseUnusedVideoSlots() {\n this.slots.video.unused.forEach((slot) => this.receiveSlotManager.releaseSlot(slot));\n this.slots.video.unused.length = 0;\n }\n\n /**\n * Allocates receive slots to all active speaker video panes\n * in the current selected layout.\n *\n * Allocation tries to keep the same order of the slots between the previous\n * layout and the new one. Sorting helps making sure that highest priority slots\n * go in the same order in the new layout.\n */\n private allocateSlotsToActiveSpeakerPaneGroups() {\n this.currentLayout?.activeSpeakerVideoPaneGroups\n // sorting in descending order based on group priority\n ?.sort((a, b) => (a.priority < b.priority ? 1 : -1))\n ?.forEach((group) => {\n this.receiveSlotAllocations.activeSpeaker[group.id] = {slots: []};\n\n for (let paneIndex = 0; paneIndex < group.numPanes; paneIndex += 1) {\n // allocate a slot from the \"unused\" list, by grabbing in same order (shift) as previous layout\n const freeSlot = this.slots.video.unused.shift();\n\n if (freeSlot) {\n this.slots.video.activeSpeaker.push(freeSlot);\n this.receiveSlotAllocations.activeSpeaker[group.id].slots.push(freeSlot);\n }\n }\n });\n }\n\n /**\n * Allocates receive slots to all receiver selected video panes\n * in the current selected layout\n */\n private allocateSlotsToReceiverSelectedVideoPaneGroups() {\n this.currentLayout?.memberVideoPanes?.forEach((memberPane) => {\n // check if there is existing slot for this csi\n const existingSlot = this.slots.video.receiverSelected.find(\n (slot) => slot.csi === memberPane.csi\n );\n\n const isExistingSlotAlreadyAllocated = Object.values(\n this.receiveSlotAllocations.receiverSelected\n ).includes(existingSlot);\n\n if (memberPane.csi !== undefined && existingSlot && !isExistingSlotAlreadyAllocated) {\n // found it, so use it\n this.receiveSlotAllocations.receiverSelected[memberPane.id] = existingSlot;\n } else {\n // allocate a slot from the \"unused\" list\n const freeSlot = this.slots.video.unused.pop();\n\n if (freeSlot) {\n this.slots.video.receiverSelected.push(freeSlot);\n this.receiveSlotAllocations.receiverSelected[memberPane.id] = freeSlot;\n }\n }\n });\n }\n\n /**\n * Ensures that we have enough slots for the current layout.\n */\n private async refillRequiredSlotsIfNeeded() {\n const requiredNumSlots = this.getRequiredNumVideoSlotsForLayout(this.currentLayout);\n const totalNumSlots =\n this.slots.video.unused.length +\n this.slots.video.activeSpeaker.length +\n this.slots.video.receiverSelected.length;\n\n if (totalNumSlots < requiredNumSlots) {\n let numSlotsToCreate = requiredNumSlots - totalNumSlots;\n\n while (numSlotsToCreate > 0) {\n // eslint-disable-next-line no-await-in-loop\n this.slots.video.unused.push(\n // eslint-disable-next-line no-await-in-loop\n await this.receiveSlotManager.allocateSlot(MediaType.VideoMain)\n );\n numSlotsToCreate -= 1;\n }\n }\n }\n\n /**\n * Move all active speaker slots to \"unused\"\n */\n private trimActiveSpeakerSlots() {\n this.slots.video.unused.push(...this.slots.video.activeSpeaker);\n this.slots.video.activeSpeaker.length = 0;\n }\n\n /**\n * Logs the state of the receive slots\n */\n private logMainVideoReceiveSlots() {\n let logMessage = '';\n forEach(this.receiveSlotAllocations.activeSpeaker, (group, groupName) => {\n logMessage += `\\ngroup: ${groupName}\\n${group.slots\n .map((slot) => slot.logString)\n .join(', ')}`;\n });\n\n logMessage += '\\nreceiverSelected:\\n';\n forEach(this.receiveSlotAllocations.receiverSelected, (slot, key) => {\n logMessage += ` ${key}: ${slot.logString}\\n`;\n });\n\n LoggerProxy.logger.log(\n `RemoteMediaManager#logMainVideoReceiveSlots --> MAIN VIDEO receive slots: unused=${this.slots.video.unused.length}, activeSpeaker=${this.slots.video.activeSpeaker.length}, receiverSelected=${this.slots.video.receiverSelected.length}${logMessage}`\n );\n }\n\n /** logs main audio slots */\n private logMainAudioReceiveSlots() {\n LoggerProxy.logger.log(\n `RemoteMediaManager#logMainAudioReceiveSlots --> MAIN AUDIO receive slots: ${this.slots.audio\n .map((slot) => slot.logString)\n .join(', ')}`\n );\n }\n\n /** logs slides video slots */\n private logSlidesVideoReceiveSlots() {\n LoggerProxy.logger.log(\n `RemoteMediaManager#logSlidesVideoReceiveSlots --> SLIDES VIDEO receive slot: ${this.slots.screenShare.video?.logString}`\n );\n }\n\n /** logs slides audio slots */\n private logSlidesAudioReceiveSlots() {\n LoggerProxy.logger.log(\n `RemoteMediaManager#logSlidesAudioReceiveSlots --> SLIDES AUDIO receive slots: ${this.slots.screenShare.audio\n .map((slot) => slot.logString)\n .join(', ')}`\n );\n }\n\n /** Logs all current receive slots */\n public logAllReceiveSlots() {\n this.logMainVideoReceiveSlots();\n this.logMainAudioReceiveSlots();\n this.logSlidesVideoReceiveSlots();\n this.logSlidesAudioReceiveSlots();\n }\n\n /**\n * Makes sure we have the right number of receive slots created for the current layout\n * and allocates them to the right video panes / pane groups\n *\n * @returns {Promise}\n */\n private async updateVideoReceiveSlots() {\n // move all active speaker slots to \"unused\"\n this.trimActiveSpeakerSlots();\n\n // move all no longer needed receiver-selected slots to \"unused\"\n this.trimReceiverSelectedSlots();\n\n // ensure we have enough total slots for current layout\n await this.refillRequiredSlotsIfNeeded();\n\n // allocate the slots to the right panes / pane groups\n // reset allocations\n this.receiveSlotAllocations = {activeSpeaker: {}, receiverSelected: {}};\n // allocate active speaker\n this.allocateSlotsToActiveSpeakerPaneGroups();\n // allocate receiver selected\n this.allocateSlotsToReceiverSelectedVideoPaneGroups();\n\n this.logMainVideoReceiveSlots();\n\n // If this is the initial layout, there may be some \"unused\" slots left because of the preallocation\n // done in this.preallocateVideoReceiveSlots(), so release them now\n this.releaseUnusedVideoSlots();\n }\n\n /**\n * Creates new RemoteMedia and RemoteMediaGroup objects for the current layout\n * and sends the media requests for all of them.\n */\n private updateVideoRemoteMediaObjects() {\n // invalidate all the previous remote media objects and cancel their media requests\n this.invalidateCurrentRemoteMedia({\n audio: false,\n video: true,\n screenShareAudio: false,\n screenShareVideo: false,\n commit: false,\n });\n\n // create new remoteMediaGroup objects\n this.media.video.activeSpeakerGroups = {};\n this.media.video.memberPanes = {};\n\n for (const [groupId, group] of Object.entries(this.receiveSlotAllocations.activeSpeaker)) {\n const paneGroupInCurrentLayout = this.currentLayout?.activeSpeakerVideoPaneGroups?.find(\n (groupInLayout) => groupInLayout.id === groupId\n );\n\n if (paneGroupInCurrentLayout) {\n const mediaGroup = new RemoteMediaGroup(\n this.mediaRequestManagers.video,\n group.slots,\n paneGroupInCurrentLayout.priority,\n false,\n {\n preferLiveVideo: this.config.video.preferLiveVideo,\n resolution: paneGroupInCurrentLayout.size,\n }\n );\n\n this.media.video.activeSpeakerGroups[groupId] = mediaGroup;\n } else {\n // this should never happen, because this.receiveSlotAllocations are created based on current layout configuration\n LoggerProxy.logger.warn(\n `a group id ${groupId} from this.receiveSlotAllocations.activeSpeaker cannot be found in the current layout configuration`\n );\n }\n }\n\n // create new remoteMedia objects\n for (const [paneId, slot] of Object.entries(this.receiveSlotAllocations.receiverSelected)) {\n const paneInCurrentLayout = this.currentLayout?.memberVideoPanes?.find(\n (paneInLayout) => paneInLayout.id === paneId\n );\n\n if (paneInCurrentLayout) {\n const remoteMedia = new RemoteMedia(slot, this.mediaRequestManagers.video, {\n resolution: paneInCurrentLayout.size,\n });\n\n if (paneInCurrentLayout.csi) {\n remoteMedia.sendMediaRequest(paneInCurrentLayout.csi, false);\n }\n\n this.media.video.memberPanes[paneId] = remoteMedia;\n } else {\n // this should never happen, because this.receiveSlotAllocations are created based on current layout configuration\n LoggerProxy.logger.warn(\n `a pane id ${paneId} from this.receiveSlotAllocations.receiverSelected cannot be found in the current layout configuration`\n );\n }\n }\n\n this.mediaRequestManagers.video.commit();\n }\n\n /**\n * Checks if current layout requires a screen share.\n * If it does, it creates new RemoteMediaGroup object for screen share\n * and sends the media requests for it.\n * If it doesn't, it makes sure we clean up any RemoteMediaGroup objects\n * created earlier for screen share (for previous layout).\n */\n private updateScreenShareVideoRemoteMediaObject() {\n this.invalidateCurrentRemoteMedia({\n audio: false,\n video: false,\n screenShareAudio: false,\n screenShareVideo: true,\n commit: false,\n });\n\n this.media.screenShare.video = undefined;\n\n if (this.currentLayout?.screenShareVideo) {\n // we create a group of 1, because for screen share we need to use the \"active speaker\" policy\n this.media.screenShare.video = new RemoteMediaGroup(\n this.mediaRequestManagers.screenShareVideo,\n [this.slots.screenShare.video],\n 255,\n false,\n {resolution: this.currentLayout.screenShareVideo.size}\n );\n }\n\n this.mediaRequestManagers.screenShareVideo.commit();\n }\n\n /**\n * Invalidates all remote media objects belonging to currently selected layout\n */\n private invalidateCurrentRemoteMedia(options: {\n audio: boolean;\n video: boolean;\n screenShareAudio: boolean;\n screenShareVideo: boolean;\n commit: boolean;\n }) {\n const {audio, video, screenShareAudio, screenShareVideo, commit} = options;\n\n if (audio && this.media.audio) {\n this.media.audio.stop(commit);\n }\n if (video) {\n Object.values(this.media.video.activeSpeakerGroups).forEach((remoteMediaGroup) => {\n remoteMediaGroup.stop(false);\n });\n Object.values(this.media.video.memberPanes).forEach((remoteMedia) => {\n remoteMedia.stop(false);\n });\n if (commit) {\n this.mediaRequestManagers.video.commit();\n }\n }\n\n if (screenShareAudio && this.media.screenShare.audio) {\n this.media.screenShare.audio.stop(commit);\n }\n if (screenShareVideo && this.media.screenShare.video) {\n this.media.screenShare.video.stop(commit);\n }\n }\n\n /** emits Event.VideoLayoutChanged */\n private emitVideoLayoutChangedEvent() {\n // todo: at this point the receive slots might still be showing a participant from previous layout, we should\n // wait for our media requests to be fulfilled, but there is no API for that right now (we could wait for source updates\n // but in some cases they might never come, or would need to always make sure to use a new set of receiver slots)\n // for now it's fine to have it like this, we will re-evaluate if it needs improving after more testing\n\n this.emit(\n {\n file: 'multistream/remoteMediaManager',\n function: 'emitVideoLayoutChangedEvent',\n },\n Event.VideoLayoutChanged,\n {\n layoutId: this.currentLayoutId,\n activeSpeakerVideoPanes: this.media.video.activeSpeakerGroups,\n memberVideoPanes: this.media.video.memberPanes,\n screenShareVideo: this.media.screenShare.video?.getRemoteMedia()[0],\n }\n );\n }\n\n /**\n * Sets a new CSI on a given remote media object\n *\n * @param {RemoteMedia} remoteMedia remote Media object to modify\n * @param {CSI} csi new CSI value, can be null if we want to stop receiving media\n */\n public setRemoteVideoCsi(remoteMedia: RemoteMedia, csi: CSI | null) {\n if (!Object.values(this.media.video.memberPanes).includes(remoteMedia)) {\n throw new Error('remoteMedia not found');\n }\n\n if (csi) {\n remoteMedia.sendMediaRequest(csi, true);\n } else {\n remoteMedia.cancelMediaRequest(true);\n }\n }\n\n /**\n * Adds a new member video pane to the currently selected layout.\n *\n * Changes to the layout are lost after a layout change.\n *\n * @param {MemberVideoPane} newPane\n * @returns {Promise<RemoteMedia>}\n */\n public async addMemberVideoPane(newPane: MemberVideoPane): Promise<RemoteMedia> {\n if (!this.currentLayout) {\n throw new Error('There is no current layout selected, call start() first');\n }\n\n if (!this.currentLayout?.memberVideoPanes) {\n this.currentLayout.memberVideoPanes = [];\n }\n\n if (newPane.id in this.currentLayout.memberVideoPanes) {\n throw new Error(\n `duplicate pane id ${newPane.id} - this pane already exists in current layout's memberVideoPanes`\n );\n }\n\n this.currentLayout.memberVideoPanes.push(newPane);\n\n const receiveSlot = await this.receiveSlotManager.allocateSlot(MediaType.VideoMain);\n\n this.slots.video.receiverSelected.push(receiveSlot);\n\n const remoteMedia = new RemoteMedia(receiveSlot, this.mediaRequestManagers.video, {\n resolution: newPane.size,\n });\n\n if (newPane.csi) {\n remoteMedia.sendMediaRequest(newPane.csi, true);\n }\n\n this.media.video.memberPanes[newPane.id] = remoteMedia;\n\n return remoteMedia;\n }\n\n /**\n * Removes a member video pane from the currently selected layout.\n *\n * Changes to the layout are lost after a layout change.\n *\n * @param {PaneId} paneId pane id of the pane to remove\n * @returns {Promise<void>}\n */\n public removeMemberVideoPane(paneId: PaneId): Promise<void> {\n if (!this.currentLayout) {\n return Promise.reject(new Error('There is no current layout selected, call start() first'));\n }\n\n if (!this.currentLayout.memberVideoPanes?.find((pane) => pane.id === paneId)) {\n // pane id doesn't exist, so nothing to do\n LoggerProxy.logger.log(\n `RemoteMediaManager#removeMemberVideoPane --> removeMemberVideoPane() called for a non-existent paneId: ${paneId} (pane not found in currentLayout.memberVideoPanes)`\n );\n\n return Promise.resolve();\n }\n\n if (!this.media.video.memberPanes[paneId]) {\n // pane id doesn't exist, so nothing to do\n LoggerProxy.logger.log(\n `RemoteMediaManager#removeMemberVideoPane --> removeMemberVideoPane() called for a non-existent paneId: ${paneId} (pane not found in this.media.video.memberPanes)`\n );\n\n return Promise.resolve();\n }\n\n const remoteMedia = this.media.video.memberPanes[paneId];\n\n const receiveSlot = remoteMedia.getUnderlyingReceiveSlot();\n\n if (receiveSlot) {\n this.receiveSlotManager.releaseSlot(receiveSlot);\n\n const index = this.slots.video.receiverSelected.indexOf(receiveSlot);\n\n if (index >= 0) {\n this.slots.video.receiverSelected.splice(index, 1);\n }\n }\n remoteMedia.stop();\n\n delete this.media.video.memberPanes[paneId];\n delete this.currentLayout.memberVideoPanes?.[paneId];\n\n return Promise.resolve();\n }\n\n /**\n * Pins an active speaker remote media object to the given CSI value. From that moment\n * onwards the remote media will only play audio/video from that specific CSI until\n * unpinActiveSpeakerVideoPane() is called or current layout is changed.\n *\n * @param {RemoteMedia} remoteMedia remote media object reference\n * @param {CSI} csi CSI value to pin to, if undefined, then current CSI value is used\n */\n public pinActiveSpeakerVideoPane(remoteMedia: RemoteMedia, csi?: CSI): void {\n const remoteMediaGroup = Object.values(this.media.video.activeSpeakerGroups).find((group) =>\n group.includes(remoteMedia, 'unpinned')\n );\n\n if (!remoteMediaGroup) {\n throw new Error(\n 'remoteMedia not found among the unpinned remote media from any active speaker group'\n );\n }\n\n remoteMediaGroup.pin(remoteMedia, csi);\n }\n\n /**\n * Unpins a remote media object from the fixed CSI value it was pinned to.\n *\n * @param {RemoteMedia} remoteMedia remote media object reference\n */\n public unpinActiveSpeakerVideoPane(remoteMedia: RemoteMedia) {\n const remoteMediaGroup = Object.values(this.media.video.activeSpeakerGroups).find((group) =>\n group.includes(remoteMedia, 'pinned')\n );\n\n if (!remoteMediaGroup) {\n throw new Error(\n 'remoteMedia not found among the pinned remote media from any active speaker group'\n );\n }\n\n remoteMediaGroup.unpin(remoteMedia);\n }\n\n /**\n * Returns true if a given remote media object belongs to an active speaker group and has been pinned.\n * Throws an error if the remote media object doesn't belong to any active speaker remote media group.\n *\n * @param {RemoteMedia} remoteMedia remote media object\n * @returns {boolean}\n */\n public isPinned(remoteMedia: RemoteMedia) {\n const remoteMediaGroup = Object.values(this.media.video.activeSpeakerGroups).find((group) =>\n group.includes(remoteMedia)\n );\n\n if (!remoteMediaGroup) {\n throw new Error(\n 'remoteMedia not found among any remote media (pinned or unpinned) from any active speaker group'\n );\n }\n\n return remoteMediaGroup.isPinned(remoteMedia);\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA;AAEA;AACA;AAEA;AAGA;AAAoD;AAAA;AA0CpD;;AAEA;AACA,IAAMA,cAA2B,GAAG;EAClCC,4BAA4B,EAAE,CAC5B;IACEC,EAAE,EAAE,MAAM;IACVC,QAAQ,EAAE,CAAC;IACXC,IAAI,EAAE,MAAM;IACZC,QAAQ,EAAE;EACZ,CAAC;AAEL,CAAC;;AAED;AACA,IAAMC,YAAyB,GAAG;EAChCL,4BAA4B,EAAE,CAC5B;IACEC,EAAE,EAAE,MAAM;IACVC,QAAQ,EAAE,CAAC;IACXC,IAAI,EAAE,MAAM;IACZC,QAAQ,EAAE;EACZ,CAAC;AAEL,CAAC;;AAED;AACA,IAAME,iBAA8B,GAAG;EACrCN,4BAA4B,EAAE,CAC5B;IACEC,EAAE,EAAE,Y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ventsScope {
199
199
  /**
200
200
  * Logs the state of the receive slots
201
201
  */
202
- private logReceieveSlots;
202
+ private logMainVideoReceiveSlots;
203
+ /** logs main audio slots */
204
+ private logMainAudioReceiveSlots;
205
+ /** logs slides video slots */
206
+ private logSlidesVideoReceiveSlots;
207
+ /** logs slides audio slots */
208
+ private logSlidesAudioReceiveSlots;
209
+ /** Logs all current receive slots */
210
+ logAllReceiveSlots(): void;
203
211
  /**
204
212
  * Makes sure we have the right number of receive slots created for the current layout
205
213
  * and allocates them to the right video panes / pane groups
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webex/plugin-meetings",
3
- "version": "3.0.0-beta.238",
3
+ "version": "3.0.0-beta.239",
4
4
  "description": "",
5
5
  "license": "Cisco EULA (https://www.cisco.com/c/en/us/products/end-user-license-agreement.html)",
6
6
  "contributors": [
@@ -32,12 +32,12 @@
32
32
  "build": "yarn run -T tsc --declaration true --declarationDir ./dist/types"
33
33
  },
34
34
  "devDependencies": {
35
- "@webex/plugin-meetings": "3.0.0-beta.238",
36
- "@webex/test-helper-chai": "3.0.0-beta.238",
37
- "@webex/test-helper-mocha": "3.0.0-beta.238",
38
- "@webex/test-helper-mock-webex": "3.0.0-beta.238",
39
- "@webex/test-helper-retry": "3.0.0-beta.238",
40
- "@webex/test-helper-test-users": "3.0.0-beta.238",
35
+ "@webex/plugin-meetings": "3.0.0-beta.239",
36
+ "@webex/test-helper-chai": "3.0.0-beta.239",
37
+ "@webex/test-helper-mocha": "3.0.0-beta.239",
38
+ "@webex/test-helper-mock-webex": "3.0.0-beta.239",
39
+ "@webex/test-helper-retry": "3.0.0-beta.239",
40
+ "@webex/test-helper-test-users": "3.0.0-beta.239",
41
41
  "chai": "^4.3.4",
42
42
  "chai-as-promised": "^7.1.1",
43
43
  "jsdom-global": "3.0.2",
@@ -46,19 +46,19 @@
46
46
  "typescript": "^4.7.4"
47
47
  },
48
48
  "dependencies": {
49
- "@webex/common": "3.0.0-beta.238",
49
+ "@webex/common": "3.0.0-beta.239",
50
50
  "@webex/internal-media-core": "1.39.3",
51
- "@webex/internal-plugin-conversation": "3.0.0-beta.238",
52
- "@webex/internal-plugin-device": "3.0.0-beta.238",
53
- "@webex/internal-plugin-llm": "3.0.0-beta.238",
54
- "@webex/internal-plugin-mercury": "3.0.0-beta.238",
55
- "@webex/internal-plugin-metrics": "3.0.0-beta.238",
56
- "@webex/internal-plugin-support": "3.0.0-beta.238",
57
- "@webex/internal-plugin-user": "3.0.0-beta.238",
58
- "@webex/media-helpers": "3.0.0-beta.238",
59
- "@webex/plugin-people": "3.0.0-beta.238",
60
- "@webex/plugin-rooms": "3.0.0-beta.238",
61
- "@webex/webex-core": "3.0.0-beta.238",
51
+ "@webex/internal-plugin-conversation": "3.0.0-beta.239",
52
+ "@webex/internal-plugin-device": "3.0.0-beta.239",
53
+ "@webex/internal-plugin-llm": "3.0.0-beta.239",
54
+ "@webex/internal-plugin-mercury": "3.0.0-beta.239",
55
+ "@webex/internal-plugin-metrics": "3.0.0-beta.239",
56
+ "@webex/internal-plugin-support": "3.0.0-beta.239",
57
+ "@webex/internal-plugin-user": "3.0.0-beta.239",
58
+ "@webex/media-helpers": "3.0.0-beta.239",
59
+ "@webex/plugin-people": "3.0.0-beta.239",
60
+ "@webex/plugin-rooms": "3.0.0-beta.239",
61
+ "@webex/webex-core": "3.0.0-beta.239",
62
62
  "ampersand-collection": "^2.0.2",
63
63
  "bowser": "^2.11.0",
64
64
  "btoa": "^1.2.1",
@@ -5601,8 +5601,16 @@ export default class Meeting extends StatelessWebexPlugin {
5601
5601
  meetingId: this.id,
5602
5602
  },
5603
5603
  });
5604
+ LoggerProxy.logger.info(
5605
+ `${LOG_HEADER} successfully established media connection, type=${connectionType}`
5606
+ );
5607
+
5608
+ // We can log ReceiveSlot SSRCs only after the SDP exchange, so doing it here:
5609
+ this.remoteMediaManager?.logAllReceiveSlots();
5604
5610
  })
5605
5611
  .catch((error) => {
5612
+ LoggerProxy.logger.error(`${LOG_HEADER} failed to establish media connection: `, error);
5613
+
5606
5614
  Metrics.sendBehavioralMetric(BEHAVIORAL_METRICS.ADD_MEDIA_FAILURE, {
5607
5615
  correlation_id: this.correlationId,
5608
5616
  locus_id: this.locusUrl.split('/').pop(),
@@ -5642,11 +5650,6 @@ export default class Meeting extends StatelessWebexPlugin {
5642
5650
  this.unsetPeerConnections();
5643
5651
  }
5644
5652
 
5645
- LoggerProxy.logger.error(
5646
- `${LOG_HEADER} Error adding media failed to initiate PC and send request, `,
5647
- error
5648
- );
5649
-
5650
5653
  // Upload logs on error while adding media
5651
5654
  Trigger.trigger(
5652
5655
  this,
@@ -473,6 +473,8 @@ export class RemoteMediaManager extends EventsScope {
473
473
  if (!this.started) {
474
474
  throw new Error('setLayout() called before start()');
475
475
  }
476
+ LoggerProxy.logger.log(`RemoteMediaManager#setLayout --> new layout selected: ${layoutId}`);
477
+
476
478
  this.currentLayoutId = layoutId;
477
479
  this.currentLayout = cloneDeep(this.config.video.layouts[this.currentLayoutId]);
478
480
 
@@ -725,10 +727,12 @@ export class RemoteMediaManager extends EventsScope {
725
727
  /**
726
728
  * Logs the state of the receive slots
727
729
  */
728
- private logReceieveSlots() {
730
+ private logMainVideoReceiveSlots() {
729
731
  let logMessage = '';
730
732
  forEach(this.receiveSlotAllocations.activeSpeaker, (group, groupName) => {
731
- logMessage += `group: ${groupName}\n${group.slots.map((slot) => slot.logString).join(' ')}`;
733
+ logMessage += `\ngroup: ${groupName}\n${group.slots
734
+ .map((slot) => slot.logString)
735
+ .join(', ')}`;
732
736
  });
733
737
 
734
738
  logMessage += '\nreceiverSelected:\n';
@@ -737,10 +741,43 @@ export class RemoteMediaManager extends EventsScope {
737
741
  });
738
742
 
739
743
  LoggerProxy.logger.log(
740
- `RemoteMediaManager#updateVideoReceiveSlots --> receive slots updated: unused=${this.slots.video.unused.length}, activeSpeaker=${this.slots.video.activeSpeaker.length}, receiverSelected=${this.slots.video.receiverSelected.length}\n${logMessage}`
744
+ `RemoteMediaManager#logMainVideoReceiveSlots --> MAIN VIDEO receive slots: unused=${this.slots.video.unused.length}, activeSpeaker=${this.slots.video.activeSpeaker.length}, receiverSelected=${this.slots.video.receiverSelected.length}${logMessage}`
745
+ );
746
+ }
747
+
748
+ /** logs main audio slots */
749
+ private logMainAudioReceiveSlots() {
750
+ LoggerProxy.logger.log(
751
+ `RemoteMediaManager#logMainAudioReceiveSlots --> MAIN AUDIO receive slots: ${this.slots.audio
752
+ .map((slot) => slot.logString)
753
+ .join(', ')}`
741
754
  );
742
755
  }
743
756
 
757
+ /** logs slides video slots */
758
+ private logSlidesVideoReceiveSlots() {
759
+ LoggerProxy.logger.log(
760
+ `RemoteMediaManager#logSlidesVideoReceiveSlots --> SLIDES VIDEO receive slot: ${this.slots.screenShare.video?.logString}`
761
+ );
762
+ }
763
+
764
+ /** logs slides audio slots */
765
+ private logSlidesAudioReceiveSlots() {
766
+ LoggerProxy.logger.log(
767
+ `RemoteMediaManager#logSlidesAudioReceiveSlots --> SLIDES AUDIO receive slots: ${this.slots.screenShare.audio
768
+ .map((slot) => slot.logString)
769
+ .join(', ')}`
770
+ );
771
+ }
772
+
773
+ /** Logs all current receive slots */
774
+ public logAllReceiveSlots() {
775
+ this.logMainVideoReceiveSlots();
776
+ this.logMainAudioReceiveSlots();
777
+ this.logSlidesVideoReceiveSlots();
778
+ this.logSlidesAudioReceiveSlots();
779
+ }
780
+
744
781
  /**
745
782
  * Makes sure we have the right number of receive slots created for the current layout
746
783
  * and allocates them to the right video panes / pane groups
@@ -765,7 +802,7 @@ export class RemoteMediaManager extends EventsScope {
765
802
  // allocate receiver selected
766
803
  this.allocateSlotsToReceiverSelectedVideoPaneGroups();
767
804
 
768
- this.logReceieveSlots();
805
+ this.logMainVideoReceiveSlots();
769
806
 
770
807
  // If this is the initial layout, there may be some "unused" slots left because of the preallocation
771
808
  // done in this.preallocateVideoReceiveSlots(), so release them now
@@ -747,7 +747,11 @@ describe('RemoteMediaManager', () => {
747
747
 
748
748
  assert.calledWith(
749
749
  logger.log,
750
- 'RemoteMediaManager#updateVideoReceiveSlots --> receive slots updated: unused=0, activeSpeaker=6, receiverSelected=4\ngroup: thumbnails\nfake video slot fake video slot fake video slot fake video slot fake video slot fake video slot\nreceiverSelected:\n stage-1: fake video slot\n stage-2: fake video slot\n stage-3: fake video slot\n stage-4: fake video slot\n'
750
+ 'RemoteMediaManager#setLayout --> new layout selected: Stage'
751
+ );
752
+ assert.calledWith(
753
+ logger.log,
754
+ 'RemoteMediaManager#logMainVideoReceiveSlots --> MAIN VIDEO receive slots: unused=0, activeSpeaker=6, receiverSelected=4\ngroup: thumbnails\nfake video slot, fake video slot, fake video slot, fake video slot, fake video slot, fake video slot\nreceiverSelected:\n stage-1: fake video slot\n stage-2: fake video slot\n stage-3: fake video slot\n stage-4: fake video slot\n'
751
755
  );
752
756
  });
753
757
 
@@ -769,7 +773,11 @@ describe('RemoteMediaManager', () => {
769
773
 
770
774
  assert.calledWith(
771
775
  logger.log,
772
- 'RemoteMediaManager#updateVideoReceiveSlots --> receive slots updated: unused=0, activeSpeaker=9, receiverSelected=0\ngroup: main\nfake video slot fake video slot fake video slot fake video slot fake video slot fake video slot fake video slot fake video slot fake video slot\nreceiverSelected:\n'
776
+ 'RemoteMediaManager#setLayout --> new layout selected: AllEqual'
777
+ );
778
+ assert.calledWith(
779
+ logger.log,
780
+ 'RemoteMediaManager#logMainVideoReceiveSlots --> MAIN VIDEO receive slots: unused=0, activeSpeaker=9, receiverSelected=0\ngroup: main\nfake video slot, fake video slot, fake video slot, fake video slot, fake video slot, fake video slot, fake video slot, fake video slot, fake video slot\nreceiverSelected:\n'
773
781
  );
774
782
  });
775
783