@webex/plugin-meetings 3.12.0-next.19 → 3.12.0-next.20

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.
@@ -298,8 +298,8 @@ MeetingsUtil.joinedOnThisDevice = function (meeting, newLocus, deviceUrl) {
298
298
  * @private
299
299
  */
300
300
  MeetingsUtil.isBreakoutLocusDTO = function (newLocus) {
301
- var _newLocus$controls, _newLocus$controls$br;
302
- return (newLocus === null || newLocus === void 0 ? void 0 : (_newLocus$controls = newLocus.controls) === null || _newLocus$controls === void 0 ? void 0 : (_newLocus$controls$br = _newLocus$controls.breakout) === null || _newLocus$controls$br === void 0 ? void 0 : _newLocus$controls$br.sessionType) === _constants.BREAKOUTS.SESSION_TYPES.BREAKOUT;
301
+ var _newLocus$controls, _newLocus$controls$br, _newLocus$info;
302
+ return (newLocus === null || newLocus === void 0 ? void 0 : (_newLocus$controls = newLocus.controls) === null || _newLocus$controls === void 0 ? void 0 : (_newLocus$controls$br = _newLocus$controls.breakout) === null || _newLocus$controls$br === void 0 ? void 0 : _newLocus$controls$br.sessionType) === _constants.BREAKOUTS.SESSION_TYPES.BREAKOUT || !!(newLocus !== null && newLocus !== void 0 && (_newLocus$info = newLocus.info) !== null && _newLocus$info !== void 0 && _newLocus$info.isBreakout);
303
303
  };
304
304
 
305
305
  /**
@@ -315,5 +315,24 @@ MeetingsUtil.isValidBreakoutLocus = function (locus) {
315
315
  var selfJoined = ((_locus$self = locus.self) === null || _locus$self === void 0 ? void 0 : _locus$self.state) === _constants._JOINED_;
316
316
  return isLocusAsBreakout && !inActiveStatus && selfJoined;
317
317
  };
318
+ /**
319
+ * check if the breakout locus is associated with the main locus by comparing the breakout control url or the replaces info in self device
320
+ * @param {Object} mainLocus main locus data
321
+ * @param {Object} breakoutLocus breakout locus data
322
+ * @returns {boolean}
323
+ * @private
324
+ */
325
+ MeetingsUtil.isMainAssociatedWithBreakout = function (mainLocus, breakoutLocus) {
326
+ var _mainLocus$controls, _mainLocus$controls$b, _mainLocus$controls2, _mainLocus$controls2$, _breakoutLocus$contro, _breakoutLocus$contro2, _breakoutLocus$self, _MeetingsUtil$getThis, _MeetingsUtil$getThis2;
327
+ if ((_mainLocus$controls = mainLocus.controls) !== null && _mainLocus$controls !== void 0 && (_mainLocus$controls$b = _mainLocus$controls.breakout) !== null && _mainLocus$controls$b !== void 0 && _mainLocus$controls$b.url && ((_mainLocus$controls2 = mainLocus.controls) === null || _mainLocus$controls2 === void 0 ? void 0 : (_mainLocus$controls2$ = _mainLocus$controls2.breakout) === null || _mainLocus$controls2$ === void 0 ? void 0 : _mainLocus$controls2$.url) === ((_breakoutLocus$contro = breakoutLocus.controls) === null || _breakoutLocus$contro === void 0 ? void 0 : (_breakoutLocus$contro2 = _breakoutLocus$contro.breakout) === null || _breakoutLocus$contro2 === void 0 ? void 0 : _breakoutLocus$contro2.url)) {
328
+ return true;
329
+ }
330
+ var deviceUrl = breakoutLocus === null || breakoutLocus === void 0 ? void 0 : (_breakoutLocus$self = breakoutLocus.self) === null || _breakoutLocus$self === void 0 ? void 0 : _breakoutLocus$self.deviceUrl;
331
+ var replaceInfo = (_MeetingsUtil$getThis = MeetingsUtil.getThisDevice(breakoutLocus, deviceUrl)) === null || _MeetingsUtil$getThis === void 0 ? void 0 : (_MeetingsUtil$getThis2 = _MeetingsUtil$getThis.replaces) === null || _MeetingsUtil$getThis2 === void 0 ? void 0 : _MeetingsUtil$getThis2[0];
332
+ if (replaceInfo !== null && replaceInfo !== void 0 && replaceInfo.locusUrl && replaceInfo.locusUrl === mainLocus.url) {
333
+ return true;
334
+ }
335
+ return false;
336
+ };
318
337
  var _default = exports.default = MeetingsUtil;
319
338
  //# sourceMappingURL=util.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_constants","require","_loggerProxy","_interopRequireDefault","_triggerProxy","_constants2","_metrics","_meetings","MeetingsUtil","getMeetingAddedType","type","DESTINATION_TYPE","LOCUS_ID","_INCOMING_","_CREATED_","handleRoapMercury","envelope","meetingCollection","data","eventType","LOCUSEVENT","MESSAGE_ROAP","meeting","getByKey","MEETING_KEY","CORRELATION_ID","correlationId","_data$message","message","seq","messageType","tieBreaker","errorType","errorCause","Metrics","sendBehavioralMetric","BEHAVIORAL_METRICS","ROAP_MERCURY_EVENT_RECEIVED","correlation_id","message_type","error_type","error_cause","ROAP","ROAP_TYPES","TURN_DISCOVERY_RESPONSE","roap","turnDiscovery","handleTurnDiscoveryResponse","_data$message$sdps","roapMessage","sdp","sdps","length","undefined","roapMessageReceived","getMediaServer","mediaServer","split","find","line","startsWith","shift","replace","toLowerCase","_unused","getMediaServerIp","mediaServerIp","_sdp$split$find$match","match","trim","_unused2","getCorrelationIdForDevice","deviceUrl","locusSelf","devices","foundDevice","device","url","parseDefaultSiteFromMeetingPreferences","userPreferences","_userPreferences$site","result","sites","defaultSite","site","default","siteUrl","hasH264Codec","_asyncToGenerator2","_regenerator","mark","_callee","hasCodec","pc","offer","_t","wrap","_context","prev","next","window","RTCPeerConnection","createOffer","offerToReceiveVideo","sent","close","LoggerProxy","logger","warn","abrupt","stop","checkH264Support","_checkH264Support","_callee2","options","_this","_ref2","firstChecked","disableNotifications","delay","maxDuration","shouldTrigger","shouldStopChecking","_context2","_now","Trigger","trigger","file","function","EVENT_TRIGGERS","MEDIA_CODEC_LOADED","log","error","MEDIA_CODEC_MISSING","setTimeout","timestamp","call","_x","apply","arguments","getThisDevice","newLocus","_newLocus$self","_newLocus$self$device","self","joinedOnThisDevice","thisDevice","state","_JOINED_","_LEFT_","reason","_MOVED_","isBreakoutLocusDTO","_newLocus$controls","_newLocus$controls$br","controls","breakout","sessionType","BREAKOUTS","SESSION_TYPES","BREAKOUT","isValidBreakoutLocus","locus","_locus$fullState","_locus$self","inActiveStatus","fullState","LOCUS","STATE","INACTIVE","isLocusAsBreakout","selfJoined","_default","exports"],"sources":["util.ts"],"sourcesContent":["/* globals window */\n\nimport {\n _CREATED_,\n _INCOMING_,\n _JOINED_,\n _LEFT_,\n DESTINATION_TYPE,\n _MOVED_,\n BREAKOUTS,\n EVENT_TRIGGERS,\n LOCUS,\n LOCUSEVENT,\n ROAP,\n} from '../constants';\nimport LoggerProxy from '../common/logs/logger-proxy';\nimport Trigger from '../common/events/trigger-proxy';\nimport BEHAVIORAL_METRICS from '../metrics/constants';\nimport Metrics from '../metrics';\nimport {MEETING_KEY} from './meetings.types';\n\n/**\n * Meetings Media Codec Missing Event\n * Emitted when H.264 codec is not\n * found in the browser.\n * @event media:codec:missing\n * @instance\n * @memberof MeetingsUtil\n */\n\n/**\n * Meetings Media Codec Loaded Event\n * Emitted when H.264 codec has been\n * loaded in the browser.\n * @event media:codec:loaded\n * @instance\n * @memberof MeetingsUtil\n */\n\nconst MeetingsUtil: any = {};\n\nMeetingsUtil.getMeetingAddedType = (type: DESTINATION_TYPE) =>\n type === DESTINATION_TYPE.LOCUS_ID ? _INCOMING_ : _CREATED_;\n\nMeetingsUtil.handleRoapMercury = (envelope, meetingCollection) => {\n const {data} = envelope;\n const {eventType} = data;\n\n if (eventType === LOCUSEVENT.MESSAGE_ROAP) {\n const meeting = meetingCollection.getByKey(MEETING_KEY.CORRELATION_ID, data.correlationId);\n\n if (meeting) {\n const {seq, messageType, tieBreaker, errorType, errorCause} = data.message;\n\n Metrics.sendBehavioralMetric(BEHAVIORAL_METRICS.ROAP_MERCURY_EVENT_RECEIVED, {\n correlation_id: data.correlationId,\n seq,\n message_type: messageType,\n error_type: errorType,\n error_cause: errorCause,\n });\n\n if (messageType === ROAP.ROAP_TYPES.TURN_DISCOVERY_RESPONSE) {\n // turn discovery is not part of normal roap protocol and so we are not handling it\n // through the usual roap state machine\n meeting.roap.turnDiscovery.handleTurnDiscoveryResponse(data.message, 'from mercury');\n } else {\n const roapMessage = {\n seq,\n messageType,\n sdp: data.message.sdps?.length > 0 ? data.message.sdps[0] : undefined,\n tieBreaker,\n errorType,\n errorCause,\n };\n\n meeting.roapMessageReceived(roapMessage);\n }\n }\n }\n};\n\nMeetingsUtil.getMediaServer = (sdp) => {\n let mediaServer;\n\n // Attempt to collect the media server from the roap message.\n try {\n mediaServer = sdp\n .split('\\r\\n')\n .find((line) => line.startsWith('o='))\n .split(' ')\n .shift()\n .replace('o=', '')\n .toLowerCase();\n } catch {\n mediaServer = undefined;\n }\n\n return mediaServer;\n};\n\nMeetingsUtil.getMediaServerIp = (sdp) => {\n let mediaServerIp;\n\n // Attempt to collect the media server from the roap message.\n try {\n mediaServerIp = sdp\n .split('\\r\\n')\n .find((line) => line.startsWith('o='))\n .match(/o=\\S+ \\d+ \\d+ IN IP4 ([\\d.]+)/)?.[1]\n .toLowerCase()\n .trim();\n } catch {\n mediaServerIp = undefined;\n }\n\n return mediaServerIp;\n};\n\n/**\n * Finds correlationId of a device from locus self devices array\n * that matches the given deviceUrl\n * @param {string} deviceUrl\n * @param {object} locusSelf\n * @returns {string|false} correlationId or false if not found\n */\nMeetingsUtil.getCorrelationIdForDevice = (deviceUrl: string, locusSelf: any) => {\n if (locusSelf?.devices) {\n const foundDevice = locusSelf?.devices.find((device) => device.url === deviceUrl);\n\n if (foundDevice && foundDevice.correlationId) {\n return foundDevice.correlationId;\n }\n }\n\n return false;\n};\n\nMeetingsUtil.parseDefaultSiteFromMeetingPreferences = (userPreferences) => {\n let result = '';\n\n if (userPreferences?.sites?.length) {\n const defaultSite = userPreferences.sites.find((site) => site.default);\n\n if (defaultSite) {\n result = defaultSite.siteUrl;\n } else {\n result = userPreferences.sites[0].siteUrl;\n }\n }\n\n return result;\n};\n\n/**\n * Will check to see if the H.264 media codec is supported.\n * @async\n * @private\n * @returns {Promise<boolean>}\n */\nMeetingsUtil.hasH264Codec = async () => {\n let hasCodec = false;\n\n try {\n const pc = new window.RTCPeerConnection();\n const offer = await pc.createOffer({offerToReceiveVideo: true});\n\n if (offer.sdp.match(/^a=rtpmap:\\d+\\s+H264\\/\\d+/m)) {\n hasCodec = true;\n }\n pc.close();\n } catch (error) {\n LoggerProxy.logger.warn(\n 'Meetings:util#hasH264Codec --> Error creating peerConnection for H.264 test.'\n );\n }\n\n return hasCodec;\n};\n\n/**\n * Notifies the user whether or not the H.264\n * codec is present. Will continuously check\n * until max duration.\n * @async\n * @private\n * @param {object} options\n * @param {Number} options.firstChecked Timestamp in milliseconds\n * @param {boolean} options.disableNotifications Default is false. Boolean to enable/disable notification and events\n * @returns {undefined}\n */\nMeetingsUtil.checkH264Support = async function checkH264Support(options: {\n firstChecked: number;\n disableNotifications: boolean;\n}) {\n const {hasH264Codec} = MeetingsUtil;\n const {firstChecked, disableNotifications} = options || {};\n const delay = 5e3; // ms\n const maxDuration = 3e5; // ms\n const shouldTrigger = firstChecked === undefined;\n const shouldStopChecking = firstChecked && Date.now() - firstChecked >= maxDuration;\n\n // Disable notifications and start H.264 download only\n if (disableNotifications) {\n hasH264Codec();\n\n return;\n }\n\n // Codec loaded trigger event notification\n if (await hasH264Codec()) {\n Trigger.trigger(\n this,\n {\n file: 'meetings/util',\n function: 'checkH264Support',\n },\n EVENT_TRIGGERS.MEDIA_CODEC_LOADED\n );\n LoggerProxy.logger.log('Meetings:util#checkH264Support --> H264 codec loaded successfully.');\n\n return;\n }\n\n // Stop checking if past the timelimit\n if (shouldStopChecking) {\n LoggerProxy.logger.error(\n 'Meetings:util#checkH264Support --> Timed out waiting for H264 codec to load.'\n );\n\n return;\n }\n\n // Trigger only once\n if (shouldTrigger) {\n Trigger.trigger(\n this,\n {\n file: 'meetings/util',\n function: 'checkH264Support',\n },\n EVENT_TRIGGERS.MEDIA_CODEC_MISSING\n );\n LoggerProxy.logger.log('Meetings:util#checkH264Support --> H264 codec is missing.');\n }\n\n // Keep checking in intervals to see if codec loaded\n window.setTimeout(() => {\n const timestamp = firstChecked || Date.now();\n\n MeetingsUtil.checkH264Support.call(this, {firstChecked: timestamp});\n }, delay);\n};\n\n/**\n * get device from locus data\n * @param {Object} newLocus new locus data\n * @param {String} deviceUrl current device url\n * @returns {Object}\n */\nMeetingsUtil.getThisDevice = (newLocus: any, deviceUrl: string) => {\n if (newLocus?.self?.devices?.length > 0) {\n return newLocus.self.devices.find((device) => device.url === deviceUrl);\n }\n\n return null;\n};\n\n/**\n * get self device joined status from locus data\n * @param {Object} meeting current meeting data\n * @param {Object} newLocus new locus data\n * @param {String} deviceUrl current device url\n * @returns {Object}\n */\nMeetingsUtil.joinedOnThisDevice = (meeting: any, newLocus: any, deviceUrl: string) => {\n const thisDevice = MeetingsUtil.getThisDevice(newLocus, deviceUrl);\n if (thisDevice) {\n if (!thisDevice.correlationId || meeting?.correlationId === thisDevice.correlationId) {\n return (\n thisDevice.state === _JOINED_ ||\n (thisDevice.state === _LEFT_ && thisDevice.reason === _MOVED_)\n );\n }\n }\n\n return false;\n};\n\n/**\n * check the new locus is breakout session's one or not\n * @param {Object} newLocus new locus data\n * @returns {boolean}\n * @private\n */\nMeetingsUtil.isBreakoutLocusDTO = (newLocus: any) => {\n return newLocus?.controls?.breakout?.sessionType === BREAKOUTS.SESSION_TYPES.BREAKOUT;\n};\n\n/**\n * check the locus is valid breakout locus or not\n * @param {Object} locus\n * @returns {boolean}\n * @private\n */\nMeetingsUtil.isValidBreakoutLocus = (locus: any) => {\n const inActiveStatus = locus?.fullState?.state === LOCUS.STATE.INACTIVE;\n const isLocusAsBreakout = MeetingsUtil.isBreakoutLocusDTO(locus);\n const selfJoined = locus.self?.state === _JOINED_;\n\n return isLocusAsBreakout && !inActiveStatus && selfJoined;\n};\nexport default MeetingsUtil;\n"],"mappings":";;;;;;;;;;;AAEA,IAAAA,UAAA,GAAAC,OAAA;AAaA,IAAAC,YAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,aAAA,GAAAD,sBAAA,CAAAF,OAAA;AACA,IAAAI,WAAA,GAAAF,sBAAA,CAAAF,OAAA;AACA,IAAAK,QAAA,GAAAH,sBAAA,CAAAF,OAAA;AACA,IAAAM,SAAA,GAAAN,OAAA;AAnBA;;AAqBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA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,kBAAkB,CAACU,KAAK,CAAC;EAChE,IAAMS,UAAU,GAAG,EAAAP,WAAA,GAAAF,KAAK,CAAClB,IAAI,cAAAoB,WAAA,uBAAVA,WAAA,CAAYjB,KAAK,MAAKC,mBAAQ;EAEjD,OAAOsB,iBAAiB,IAAI,CAACL,cAAc,IAAIM,UAAU;AAC3D,CAAC;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAxF,OAAA,GACa7E,YAAY","ignoreList":[]}
1
+ {"version":3,"names":["_constants","require","_loggerProxy","_interopRequireDefault","_triggerProxy","_constants2","_metrics","_meetings","MeetingsUtil","getMeetingAddedType","type","DESTINATION_TYPE","LOCUS_ID","_INCOMING_","_CREATED_","handleRoapMercury","envelope","meetingCollection","data","eventType","LOCUSEVENT","MESSAGE_ROAP","meeting","getByKey","MEETING_KEY","CORRELATION_ID","correlationId","_data$message","message","seq","messageType","tieBreaker","errorType","errorCause","Metrics","sendBehavioralMetric","BEHAVIORAL_METRICS","ROAP_MERCURY_EVENT_RECEIVED","correlation_id","message_type","error_type","error_cause","ROAP","ROAP_TYPES","TURN_DISCOVERY_RESPONSE","roap","turnDiscovery","handleTurnDiscoveryResponse","_data$message$sdps","roapMessage","sdp","sdps","length","undefined","roapMessageReceived","getMediaServer","mediaServer","split","find","line","startsWith","shift","replace","toLowerCase","_unused","getMediaServerIp","mediaServerIp","_sdp$split$find$match","match","trim","_unused2","getCorrelationIdForDevice","deviceUrl","locusSelf","devices","foundDevice","device","url","parseDefaultSiteFromMeetingPreferences","userPreferences","_userPreferences$site","result","sites","defaultSite","site","default","siteUrl","hasH264Codec","_asyncToGenerator2","_regenerator","mark","_callee","hasCodec","pc","offer","_t","wrap","_context","prev","next","window","RTCPeerConnection","createOffer","offerToReceiveVideo","sent","close","LoggerProxy","logger","warn","abrupt","stop","checkH264Support","_checkH264Support","_callee2","options","_this","_ref2","firstChecked","disableNotifications","delay","maxDuration","shouldTrigger","shouldStopChecking","_context2","_now","Trigger","trigger","file","function","EVENT_TRIGGERS","MEDIA_CODEC_LOADED","log","error","MEDIA_CODEC_MISSING","setTimeout","timestamp","call","_x","apply","arguments","getThisDevice","newLocus","_newLocus$self","_newLocus$self$device","self","joinedOnThisDevice","thisDevice","state","_JOINED_","_LEFT_","reason","_MOVED_","isBreakoutLocusDTO","_newLocus$controls","_newLocus$controls$br","_newLocus$info","controls","breakout","sessionType","BREAKOUTS","SESSION_TYPES","BREAKOUT","info","isBreakout","isValidBreakoutLocus","locus","_locus$fullState","_locus$self","inActiveStatus","fullState","LOCUS","STATE","INACTIVE","isLocusAsBreakout","selfJoined","isMainAssociatedWithBreakout","mainLocus","breakoutLocus","_mainLocus$controls","_mainLocus$controls$b","_mainLocus$controls2","_mainLocus$controls2$","_breakoutLocus$contro","_breakoutLocus$contro2","_breakoutLocus$self","_MeetingsUtil$getThis","_MeetingsUtil$getThis2","replaceInfo","replaces","locusUrl","_default","exports"],"sources":["util.ts"],"sourcesContent":["/* globals window */\n\nimport {\n _CREATED_,\n _INCOMING_,\n _JOINED_,\n _LEFT_,\n DESTINATION_TYPE,\n _MOVED_,\n BREAKOUTS,\n EVENT_TRIGGERS,\n LOCUS,\n LOCUSEVENT,\n ROAP,\n} from '../constants';\nimport LoggerProxy from '../common/logs/logger-proxy';\nimport Trigger from '../common/events/trigger-proxy';\nimport BEHAVIORAL_METRICS from '../metrics/constants';\nimport Metrics from '../metrics';\nimport {MEETING_KEY} from './meetings.types';\n\n/**\n * Meetings Media Codec Missing Event\n * Emitted when H.264 codec is not\n * found in the browser.\n * @event media:codec:missing\n * @instance\n * @memberof MeetingsUtil\n */\n\n/**\n * Meetings Media Codec Loaded Event\n * Emitted when H.264 codec has been\n * loaded in the browser.\n * @event media:codec:loaded\n * @instance\n * @memberof MeetingsUtil\n */\n\nconst MeetingsUtil: any = {};\n\nMeetingsUtil.getMeetingAddedType = (type: DESTINATION_TYPE) =>\n type === DESTINATION_TYPE.LOCUS_ID ? _INCOMING_ : _CREATED_;\n\nMeetingsUtil.handleRoapMercury = (envelope, meetingCollection) => {\n const {data} = envelope;\n const {eventType} = data;\n\n if (eventType === LOCUSEVENT.MESSAGE_ROAP) {\n const meeting = meetingCollection.getByKey(MEETING_KEY.CORRELATION_ID, data.correlationId);\n\n if (meeting) {\n const {seq, messageType, tieBreaker, errorType, errorCause} = data.message;\n\n Metrics.sendBehavioralMetric(BEHAVIORAL_METRICS.ROAP_MERCURY_EVENT_RECEIVED, {\n correlation_id: data.correlationId,\n seq,\n message_type: messageType,\n error_type: errorType,\n error_cause: errorCause,\n });\n\n if (messageType === ROAP.ROAP_TYPES.TURN_DISCOVERY_RESPONSE) {\n // turn discovery is not part of normal roap protocol and so we are not handling it\n // through the usual roap state machine\n meeting.roap.turnDiscovery.handleTurnDiscoveryResponse(data.message, 'from mercury');\n } else {\n const roapMessage = {\n seq,\n messageType,\n sdp: data.message.sdps?.length > 0 ? data.message.sdps[0] : undefined,\n tieBreaker,\n errorType,\n errorCause,\n };\n\n meeting.roapMessageReceived(roapMessage);\n }\n }\n }\n};\n\nMeetingsUtil.getMediaServer = (sdp) => {\n let mediaServer;\n\n // Attempt to collect the media server from the roap message.\n try {\n mediaServer = sdp\n .split('\\r\\n')\n .find((line) => line.startsWith('o='))\n .split(' ')\n .shift()\n .replace('o=', '')\n .toLowerCase();\n } catch {\n mediaServer = undefined;\n }\n\n return mediaServer;\n};\n\nMeetingsUtil.getMediaServerIp = (sdp) => {\n let mediaServerIp;\n\n // Attempt to collect the media server from the roap message.\n try {\n mediaServerIp = sdp\n .split('\\r\\n')\n .find((line) => line.startsWith('o='))\n .match(/o=\\S+ \\d+ \\d+ IN IP4 ([\\d.]+)/)?.[1]\n .toLowerCase()\n .trim();\n } catch {\n mediaServerIp = undefined;\n }\n\n return mediaServerIp;\n};\n\n/**\n * Finds correlationId of a device from locus self devices array\n * that matches the given deviceUrl\n * @param {string} deviceUrl\n * @param {object} locusSelf\n * @returns {string|false} correlationId or false if not found\n */\nMeetingsUtil.getCorrelationIdForDevice = (deviceUrl: string, locusSelf: any) => {\n if (locusSelf?.devices) {\n const foundDevice = locusSelf?.devices.find((device) => device.url === deviceUrl);\n\n if (foundDevice && foundDevice.correlationId) {\n return foundDevice.correlationId;\n }\n }\n\n return false;\n};\n\nMeetingsUtil.parseDefaultSiteFromMeetingPreferences = (userPreferences) => {\n let result = '';\n\n if (userPreferences?.sites?.length) {\n const defaultSite = userPreferences.sites.find((site) => site.default);\n\n if (defaultSite) {\n result = defaultSite.siteUrl;\n } else {\n result = userPreferences.sites[0].siteUrl;\n }\n }\n\n return result;\n};\n\n/**\n * Will check to see if the H.264 media codec is supported.\n * @async\n * @private\n * @returns {Promise<boolean>}\n */\nMeetingsUtil.hasH264Codec = async () => {\n let hasCodec = false;\n\n try {\n const pc = new window.RTCPeerConnection();\n const offer = await pc.createOffer({offerToReceiveVideo: true});\n\n if (offer.sdp.match(/^a=rtpmap:\\d+\\s+H264\\/\\d+/m)) {\n hasCodec = true;\n }\n pc.close();\n } catch (error) {\n LoggerProxy.logger.warn(\n 'Meetings:util#hasH264Codec --> Error creating peerConnection for H.264 test.'\n );\n }\n\n return hasCodec;\n};\n\n/**\n * Notifies the user whether or not the H.264\n * codec is present. Will continuously check\n * until max duration.\n * @async\n * @private\n * @param {object} options\n * @param {Number} options.firstChecked Timestamp in milliseconds\n * @param {boolean} options.disableNotifications Default is false. Boolean to enable/disable notification and events\n * @returns {undefined}\n */\nMeetingsUtil.checkH264Support = async function checkH264Support(options: {\n firstChecked: number;\n disableNotifications: boolean;\n}) {\n const {hasH264Codec} = MeetingsUtil;\n const {firstChecked, disableNotifications} = options || {};\n const delay = 5e3; // ms\n const maxDuration = 3e5; // ms\n const shouldTrigger = firstChecked === undefined;\n const shouldStopChecking = firstChecked && Date.now() - firstChecked >= maxDuration;\n\n // Disable notifications and start H.264 download only\n if (disableNotifications) {\n hasH264Codec();\n\n return;\n }\n\n // Codec loaded trigger event notification\n if (await hasH264Codec()) {\n Trigger.trigger(\n this,\n {\n file: 'meetings/util',\n function: 'checkH264Support',\n },\n EVENT_TRIGGERS.MEDIA_CODEC_LOADED\n );\n LoggerProxy.logger.log('Meetings:util#checkH264Support --> H264 codec loaded successfully.');\n\n return;\n }\n\n // Stop checking if past the timelimit\n if (shouldStopChecking) {\n LoggerProxy.logger.error(\n 'Meetings:util#checkH264Support --> Timed out waiting for H264 codec to load.'\n );\n\n return;\n }\n\n // Trigger only once\n if (shouldTrigger) {\n Trigger.trigger(\n this,\n {\n file: 'meetings/util',\n function: 'checkH264Support',\n },\n EVENT_TRIGGERS.MEDIA_CODEC_MISSING\n );\n LoggerProxy.logger.log('Meetings:util#checkH264Support --> H264 codec is missing.');\n }\n\n // Keep checking in intervals to see if codec loaded\n window.setTimeout(() => {\n const timestamp = firstChecked || Date.now();\n\n MeetingsUtil.checkH264Support.call(this, {firstChecked: timestamp});\n }, delay);\n};\n\n/**\n * get device from locus data\n * @param {Object} newLocus new locus data\n * @param {String} deviceUrl current device url\n * @returns {Object}\n */\nMeetingsUtil.getThisDevice = (newLocus: any, deviceUrl: string) => {\n if (newLocus?.self?.devices?.length > 0) {\n return newLocus.self.devices.find((device) => device.url === deviceUrl);\n }\n\n return null;\n};\n\n/**\n * get self device joined status from locus data\n * @param {Object} meeting current meeting data\n * @param {Object} newLocus new locus data\n * @param {String} deviceUrl current device url\n * @returns {Object}\n */\nMeetingsUtil.joinedOnThisDevice = (meeting: any, newLocus: any, deviceUrl: string) => {\n const thisDevice = MeetingsUtil.getThisDevice(newLocus, deviceUrl);\n if (thisDevice) {\n if (!thisDevice.correlationId || meeting?.correlationId === thisDevice.correlationId) {\n return (\n thisDevice.state === _JOINED_ ||\n (thisDevice.state === _LEFT_ && thisDevice.reason === _MOVED_)\n );\n }\n }\n\n return false;\n};\n\n/**\n * check the new locus is breakout session's one or not\n * @param {Object} newLocus new locus data\n * @returns {boolean}\n * @private\n */\nMeetingsUtil.isBreakoutLocusDTO = (newLocus: any) => {\n return (\n newLocus?.controls?.breakout?.sessionType === BREAKOUTS.SESSION_TYPES.BREAKOUT ||\n !!newLocus?.info?.isBreakout\n );\n};\n\n/**\n * check the locus is valid breakout locus or not\n * @param {Object} locus\n * @returns {boolean}\n * @private\n */\nMeetingsUtil.isValidBreakoutLocus = (locus: any) => {\n const inActiveStatus = locus?.fullState?.state === LOCUS.STATE.INACTIVE;\n const isLocusAsBreakout = MeetingsUtil.isBreakoutLocusDTO(locus);\n const selfJoined = locus.self?.state === _JOINED_;\n\n return isLocusAsBreakout && !inActiveStatus && selfJoined;\n};\n/**\n * check if the breakout locus is associated with the main locus by comparing the breakout control url or the replaces info in self device\n * @param {Object} mainLocus main locus data\n * @param {Object} breakoutLocus breakout locus data\n * @returns {boolean}\n * @private\n */\nMeetingsUtil.isMainAssociatedWithBreakout = (mainLocus: any, breakoutLocus: any) => {\n if (\n mainLocus.controls?.breakout?.url &&\n mainLocus.controls?.breakout?.url === breakoutLocus.controls?.breakout?.url\n ) {\n return true;\n }\n const deviceUrl = breakoutLocus?.self?.deviceUrl;\n const replaceInfo = MeetingsUtil.getThisDevice(breakoutLocus, deviceUrl)?.replaces?.[0];\n if (replaceInfo?.locusUrl && replaceInfo.locusUrl === mainLocus.url) {\n return true;\n }\n\n return false;\n};\nexport default MeetingsUtil;\n"],"mappings":";;;;;;;;;;;AAEA,IAAAA,UAAA,GAAAC,OAAA;AAaA,IAAAC,YAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,aAAA,GAAAD,sBAAA,CAAAF,OAAA;AACA,IAAAI,WAAA,GAAAF,sBAAA,CAAAF,OAAA;AACA,IAAAK,QAAA,GAAAH,sBAAA,CAAAF,OAAA;AACA,IAAAM,SAAA,GAAAN,OAAA;AAnBA;;AAqBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,IAAMO,YAAiB,GAAG,CAAC,CAAC;AAE5BA,YAAY,CAACC,mBAAmB,GAAG,UAACC,IAAsB;EAAA,O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AAC,sBAAA,GAApDD,qBAAA,CAAsDG,QAAQ,cAAAF,sBAAA,uBAA9DA,sBAAA,CAAiE,CAAC,CAAC;EACvF,IAAIC,WAAW,aAAXA,WAAW,eAAXA,WAAW,CAAEE,QAAQ,IAAIF,WAAW,CAACE,QAAQ,KAAKb,SAAS,CAACnG,GAAG,EAAE;IACnE,OAAO,IAAI;EACb;EAEA,OAAO,KAAK;AACd,CAAC;AAAC,IAAAiH,QAAA,GAAAC,OAAA,CAAA1G,OAAA,GACa7E,YAAY","ignoreList":[]}
@@ -25,10 +25,9 @@ export type HashTreeParserEntry = {
25
25
  *
26
26
  * @param {HashTreeMessage} message - The hash tree message to find the meeting for
27
27
  * @param {MeetingCollection} meetingCollection - The collection of meetings to search
28
- * @param {string} deviceUrl - The URL of the user's device
29
28
  * @returns {any} The meeting if found, otherwise undefined
30
29
  */
31
- export declare function findMeetingForHashTreeMessage(message: HashTreeMessage, meetingCollection: MeetingCollection, deviceUrl: string): any;
30
+ export declare function findMeetingForHashTreeMessage(message: HashTreeMessage | undefined, meetingCollection: MeetingCollection): any;
32
31
  /**
33
32
  * Creates a locus object from the objects received in a hash tree message. It usually will be
34
33
  * incomplete, because hash tree messages only contain the parts of locus that have changed,
@@ -723,7 +723,7 @@ var Webinar = _webexCore.WebexPlugin.extend({
723
723
  }, _callee1);
724
724
  }))();
725
725
  },
726
- version: "3.12.0-next.19"
726
+ version: "3.12.0-next.20"
727
727
  });
728
728
  var _default = exports.default = Webinar;
729
729
  //# sourceMappingURL=index.js.map
package/package.json CHANGED
@@ -94,5 +94,5 @@
94
94
  "//": [
95
95
  "TODO: upgrade jwt-decode when moving to node 18"
96
96
  ],
97
- "version": "3.12.0-next.19"
97
+ "version": "3.12.0-next.20"
98
98
  }
@@ -98,7 +98,7 @@ export type HashTreeParserEntry = {
98
98
  * Gets the replacement information
99
99
  *
100
100
  * @param {any} self - "self" object from Locus DTO
101
- * @param {string} deviceUrl - The URL of the user's device
101
+ * @param {string} deviceUrl - The URL of the specified device
102
102
  * @returns {any} The replace information if available, otherwise undefined
103
103
  */
104
104
  function getReplaceInfoFromSelf(self: any, deviceUrl: string): ReplacesInfo | undefined {
@@ -138,14 +138,15 @@ function findLocusUrlInAnyHashTreeParser(
138
138
  *
139
139
  * @param {HashTreeMessage} message - The hash tree message to find the meeting for
140
140
  * @param {MeetingCollection} meetingCollection - The collection of meetings to search
141
- * @param {string} deviceUrl - The URL of the user's device
142
141
  * @returns {any} The meeting if found, otherwise undefined
143
142
  */
144
143
  export function findMeetingForHashTreeMessage(
145
- message: HashTreeMessage,
146
- meetingCollection: MeetingCollection,
147
- deviceUrl: string
144
+ message: HashTreeMessage | undefined,
145
+ meetingCollection: MeetingCollection
148
146
  ): any {
147
+ if (!message) {
148
+ return undefined;
149
+ }
149
150
  let foundMeeting = findLocusUrlInAnyHashTreeParser(meetingCollection, message.locusUrl);
150
151
 
151
152
  if (foundMeeting) {
@@ -155,7 +156,7 @@ export function findMeetingForHashTreeMessage(
155
156
  // if we haven't found anything, it may mean that message has a new locusUrl
156
157
  // check if it indicates that it replaces some existing current locusUrl (this is indicated in "self")
157
158
  const self = message.locusStateElements?.find((el) => isSelf(el))?.data;
158
- const replaces = getReplaceInfoFromSelf(self, deviceUrl);
159
+ const replaces = getReplaceInfoFromSelf(self, self?.deviceUrl);
159
160
 
160
161
  if (replaces?.locusUrl) {
161
162
  foundMeeting = findLocusUrlInAnyHashTreeParser(meetingCollection, replaces.locusUrl);
@@ -69,6 +69,7 @@ import JoinForbiddenError from '../common/errors/join-forbidden-error';
69
69
  import {HashTreeMessage} from '../hashTree/hashTreeParser';
70
70
  import {HashTreeObject} from '../hashTree/types';
71
71
  import {isSelf} from '../hashTree/utils';
72
+
72
73
  import {createLocusFromHashTreeMessage, findMeetingForHashTreeMessage} from '../locus-info';
73
74
 
74
75
  let mediaLogger;
@@ -435,14 +436,11 @@ export default class Meetings extends WebexPlugin {
435
436
  if (existingMeeting) {
436
437
  return existingMeeting;
437
438
  }
438
-
439
439
  if (data.eventType === LOCUSEVENT.HASH_TREE_DATA_UPDATED) {
440
440
  // need to check if maybe this event indicates a move to/from breakout
441
441
  const meetingForHashTreeMessage = findMeetingForHashTreeMessage(
442
- data.stateElementsMessage,
443
- this.meetingCollection,
444
- // @ts-ignore
445
- this.webex.internal.device.url
442
+ data?.stateElementsMessage,
443
+ this.meetingCollection
446
444
  );
447
445
 
448
446
  if (meetingForHashTreeMessage) {
@@ -492,7 +490,6 @@ export default class Meetings extends WebexPlugin {
492
490
  */
493
491
  private handleLocusEvent(data: LocusEvent, useRandomDelayForInfo = false) {
494
492
  let meeting = this.getCorrespondingMeetingByLocus(data);
495
-
496
493
  // @ts-ignore
497
494
  if (this.config.experimental.storeLocusHashTreeEventsForDebugging) {
498
495
  storeEventForDebugging('mercury', data);
@@ -604,7 +601,6 @@ export default class Meetings extends WebexPlugin {
604
601
  // @ts-ignore
605
602
  this.destroy(meeting, MEETING_REMOVED_REASON.LOCUS_DTO_SYNC_FAILED);
606
603
  }
607
-
608
604
  this.checkHandleBreakoutLocus(data.locus);
609
605
  })
610
606
  .catch((e) => {
@@ -1902,8 +1898,8 @@ export default class Meetings extends WebexPlugin {
1902
1898
 
1903
1899
  return this.request
1904
1900
  .getActiveMeetings()
1905
- .then((locusArray) => {
1906
- const activeLocusUrl = [];
1901
+ .then((locusArray: any) => {
1902
+ const activeLocusUrl: string[] = [];
1907
1903
 
1908
1904
  if (locusArray?.loci && locusArray.loci.length > 0) {
1909
1905
  const lociToUpdate = this.sortLocusArrayToUpdate(locusArray.loci);
@@ -1954,8 +1950,8 @@ export default class Meetings extends WebexPlugin {
1954
1950
  this.breakoutLocusForHandleLater = [];
1955
1951
  const lociToUpdate = [...mainLoci];
1956
1952
  breakoutLoci.forEach((breakoutLocus) => {
1957
- const associateMainLocus = mainLoci.find(
1958
- (mainLocus) => mainLocus.controls?.breakout?.url === breakoutLocus.controls?.breakout?.url
1953
+ const associateMainLocus = mainLoci.find((mainLocus) =>
1954
+ MeetingsUtil.isMainAssociatedWithBreakout(mainLocus, breakoutLocus)
1959
1955
  );
1960
1956
  const existCorrespondingMeeting = this.getCorrespondingMeetingByLocus({
1961
1957
  eventType: LOCUSEVENT.SDK_NO_EVENT,
@@ -1983,7 +1979,7 @@ export default class Meetings extends WebexPlugin {
1983
1979
  * @public
1984
1980
  * @memberof Meetings
1985
1981
  */
1986
- checkHandleBreakoutLocus(newCreatedLocus) {
1982
+ checkHandleBreakoutLocus(newCreatedLocus: any) {
1987
1983
  if (
1988
1984
  !newCreatedLocus ||
1989
1985
  !this.breakoutLocusForHandleLater ||
@@ -1994,9 +1990,8 @@ export default class Meetings extends WebexPlugin {
1994
1990
  if (MeetingsUtil.isBreakoutLocusDTO(newCreatedLocus)) {
1995
1991
  return;
1996
1992
  }
1997
- const existIndex = this.breakoutLocusForHandleLater.findIndex(
1998
- (breakoutLocus) =>
1999
- breakoutLocus.controls?.breakout?.url === newCreatedLocus.controls?.breakout?.url
1993
+ const existIndex = this.breakoutLocusForHandleLater.findIndex((breakoutLocus: any) =>
1994
+ MeetingsUtil.isMainAssociatedWithBreakout(newCreatedLocus, breakoutLocus)
2000
1995
  );
2001
1996
 
2002
1997
  if (existIndex < 0) {
@@ -294,7 +294,10 @@ MeetingsUtil.joinedOnThisDevice = (meeting: any, newLocus: any, deviceUrl: strin
294
294
  * @private
295
295
  */
296
296
  MeetingsUtil.isBreakoutLocusDTO = (newLocus: any) => {
297
- return newLocus?.controls?.breakout?.sessionType === BREAKOUTS.SESSION_TYPES.BREAKOUT;
297
+ return (
298
+ newLocus?.controls?.breakout?.sessionType === BREAKOUTS.SESSION_TYPES.BREAKOUT ||
299
+ !!newLocus?.info?.isBreakout
300
+ );
298
301
  };
299
302
 
300
303
  /**
@@ -310,4 +313,26 @@ MeetingsUtil.isValidBreakoutLocus = (locus: any) => {
310
313
 
311
314
  return isLocusAsBreakout && !inActiveStatus && selfJoined;
312
315
  };
316
+ /**
317
+ * check if the breakout locus is associated with the main locus by comparing the breakout control url or the replaces info in self device
318
+ * @param {Object} mainLocus main locus data
319
+ * @param {Object} breakoutLocus breakout locus data
320
+ * @returns {boolean}
321
+ * @private
322
+ */
323
+ MeetingsUtil.isMainAssociatedWithBreakout = (mainLocus: any, breakoutLocus: any) => {
324
+ if (
325
+ mainLocus.controls?.breakout?.url &&
326
+ mainLocus.controls?.breakout?.url === breakoutLocus.controls?.breakout?.url
327
+ ) {
328
+ return true;
329
+ }
330
+ const deviceUrl = breakoutLocus?.self?.deviceUrl;
331
+ const replaceInfo = MeetingsUtil.getThisDevice(breakoutLocus, deviceUrl)?.replaces?.[0];
332
+ if (replaceInfo?.locusUrl && replaceInfo.locusUrl === mainLocus.url) {
333
+ return true;
334
+ }
335
+
336
+ return false;
337
+ };
313
338
  export default MeetingsUtil;
@@ -3182,6 +3182,7 @@ describe('plugin-meetings', () => {
3182
3182
  const createSelfElementWithReplaces = (replacedLocusUrl, replacedAt) => ({
3183
3183
  htMeta: {elementId: {type: 'Self'}},
3184
3184
  data: {
3185
+ deviceUrl,
3185
3186
  devices: [{url: deviceUrl, replaces: [{locusUrl: replacedLocusUrl, replacedAt}]}],
3186
3187
  },
3187
3188
  });
@@ -5192,6 +5193,7 @@ describe('plugin-meetings', () => {
5192
5193
  return {
5193
5194
  htMeta: {elementId: {type: 'Self'}},
5194
5195
  data: {
5196
+ deviceUrl,
5195
5197
  devices,
5196
5198
  },
5197
5199
  };
@@ -128,6 +128,114 @@ describe('plugin-meetings', () => {
128
128
  };
129
129
  assert.equal(MeetingsUtil.isBreakoutLocusDTO(newLocus), false);
130
130
  });
131
+
132
+ it('returns true if newLocus.info.isBreakout is true', () => {
133
+ const newLocus = {
134
+ info: {
135
+ isBreakout: true,
136
+ },
137
+ };
138
+ assert.equal(MeetingsUtil.isBreakoutLocusDTO(newLocus), true);
139
+ });
140
+
141
+ it('returns false if newLocus.info.isBreakout is false', () => {
142
+ const newLocus = {
143
+ info: {
144
+ isBreakout: false,
145
+ },
146
+ };
147
+ assert.equal(MeetingsUtil.isBreakoutLocusDTO(newLocus), false);
148
+ });
149
+
150
+ it('returns true if both sessionType is BREAKOUT and info.isBreakout is true', () => {
151
+ const newLocus = {
152
+ controls: {
153
+ breakout: {
154
+ sessionType: 'BREAKOUT',
155
+ },
156
+ },
157
+ info: {
158
+ isBreakout: true,
159
+ },
160
+ };
161
+ assert.equal(MeetingsUtil.isBreakoutLocusDTO(newLocus), true);
162
+ });
163
+ });
164
+
165
+ describe('#isMainAssociatedWithBreakout', () => {
166
+ it('returns true when breakout control url matches main locus breakout url', () => {
167
+ const mainLocus = {
168
+ url: 'main-locus-url',
169
+ controls: {
170
+ breakout: {
171
+ url: 'breakout-control-url',
172
+ },
173
+ },
174
+ };
175
+ const breakoutLocus = {
176
+ controls: {
177
+ breakout: {
178
+ url: 'breakout-control-url',
179
+ },
180
+ },
181
+ };
182
+
183
+ assert.equal(MeetingsUtil.isMainAssociatedWithBreakout(mainLocus, breakoutLocus), true);
184
+ });
185
+
186
+ it('returns true when breakout self device replaces the main locus url', () => {
187
+ const mainLocus = {
188
+ url: 'main-locus-url',
189
+ controls: {},
190
+ };
191
+ const breakoutLocus = {
192
+ controls: {
193
+ breakout: {
194
+ url: 'other-breakout-url',
195
+ },
196
+ },
197
+ self: {
198
+ deviceUrl: 'device-url-1',
199
+ devices: [
200
+ {
201
+ url: 'device-url-1',
202
+ replaces: [{locusUrl: 'main-locus-url'}],
203
+ },
204
+ ],
205
+ },
206
+ };
207
+
208
+ assert.equal(MeetingsUtil.isMainAssociatedWithBreakout(mainLocus, breakoutLocus), true);
209
+ });
210
+
211
+ it('returns false when breakout locus is not associated with the main locus', () => {
212
+ const mainLocus = {
213
+ url: 'main-locus-url',
214
+ controls: {
215
+ breakout: {
216
+ url: 'breakout-control-url',
217
+ },
218
+ },
219
+ };
220
+ const breakoutLocus = {
221
+ controls: {
222
+ breakout: {
223
+ url: 'different-breakout-url',
224
+ },
225
+ },
226
+ self: {
227
+ deviceUrl: 'device-url-1',
228
+ devices: [
229
+ {
230
+ url: 'device-url-1',
231
+ replaces: [{locusUrl: 'another-main-locus-url'}],
232
+ },
233
+ ],
234
+ },
235
+ };
236
+
237
+ assert.equal(MeetingsUtil.isMainAssociatedWithBreakout(mainLocus, breakoutLocus), false);
238
+ });
131
239
  });
132
240
 
133
241
  describe('#joinedOnThisDevice', () => {