@webex/plugin-meetings 3.12.0-next.93 → 3.12.0-next.94

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.
@@ -191,7 +191,7 @@ var AIEnableRequest = _webexCore.WebexPlugin.extend({
191
191
  method: _constants.HTTP_VERBS.PUT
192
192
  });
193
193
  },
194
- version: "3.12.0-next.93"
194
+ version: "3.12.0-next.94"
195
195
  });
196
196
  var _default = exports.default = AIEnableRequest;
197
197
  //# sourceMappingURL=index.js.map
@@ -214,7 +214,7 @@ var Breakout = _webexCore.WebexPlugin.extend({
214
214
  sessionId: this.sessionId
215
215
  });
216
216
  },
217
- version: "3.12.0-next.93"
217
+ version: "3.12.0-next.94"
218
218
  });
219
219
  var _default = exports.default = Breakout;
220
220
  //# sourceMappingURL=breakout.js.map
@@ -1133,7 +1133,7 @@ var Breakouts = _webexCore.WebexPlugin.extend({
1133
1133
  this.trigger(_constants.BREAKOUTS.EVENTS.ASK_RETURN_TO_MAIN);
1134
1134
  }
1135
1135
  },
1136
- version: "3.12.0-next.93"
1136
+ version: "3.12.0-next.94"
1137
1137
  });
1138
1138
  var _default = exports.default = Breakouts;
1139
1139
  //# sourceMappingURL=index.js.map
@@ -381,7 +381,7 @@ var SimultaneousInterpretation = _webexCore.WebexPlugin.extend({
381
381
  throw error;
382
382
  });
383
383
  },
384
- version: "3.12.0-next.93"
384
+ version: "3.12.0-next.94"
385
385
  });
386
386
  var _default = exports.default = SimultaneousInterpretation;
387
387
  //# sourceMappingURL=index.js.map
@@ -18,7 +18,7 @@ var SILanguage = _webexCore.WebexPlugin.extend({
18
18
  languageCode: 'number',
19
19
  languageName: 'string'
20
20
  },
21
- version: "3.12.0-next.93"
21
+ version: "3.12.0-next.94"
22
22
  });
23
23
  var _default = exports.default = SILanguage;
24
24
  //# sourceMappingURL=siLanguage.js.map
@@ -9,6 +9,7 @@ exports.default = void 0;
9
9
  var _now = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/date/now"));
10
10
  var _regenerator = _interopRequireDefault(require("@babel/runtime-corejs2/regenerator"));
11
11
  var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/asyncToGenerator"));
12
+ var _webCapabilities = require("@webex/web-capabilities");
12
13
  var _constants = require("../constants");
13
14
  var _loggerProxy = _interopRequireDefault(require("../common/logs/logger-proxy"));
14
15
  var _triggerProxy = _interopRequireDefault(require("../common/events/trigger-proxy"));
@@ -165,36 +166,59 @@ MeetingsUtil.getSiteName = function (site) {
165
166
  * @returns {Promise<boolean>}
166
167
  */
167
168
  MeetingsUtil.hasH264Codec = /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee() {
168
- var hasCodec, pc, offer, _t;
169
+ var codecCapability, hasCodec, pc, _offer$sdp, offer, _pc, _t, _t2;
169
170
  return _regenerator.default.wrap(function (_context) {
170
171
  while (1) switch (_context.prev = _context.next) {
171
172
  case 0:
173
+ _context.prev = 0;
174
+ codecCapability = _webCapabilities.WebCapabilities.isCapableOfReceivingVideoCodec('video/H264');
175
+ if (!(codecCapability === _webCapabilities.CapabilityState.CAPABLE)) {
176
+ _context.next = 1;
177
+ break;
178
+ }
179
+ return _context.abrupt("return", true);
180
+ case 1:
181
+ if (!(codecCapability === _webCapabilities.CapabilityState.NOT_CAPABLE)) {
182
+ _context.next = 2;
183
+ break;
184
+ }
185
+ return _context.abrupt("return", false);
186
+ case 2:
187
+ _context.next = 4;
188
+ break;
189
+ case 3:
190
+ _context.prev = 3;
191
+ _t = _context["catch"](0);
192
+ case 4:
172
193
  hasCodec = false;
173
- _context.prev = 1;
194
+ _context.prev = 5;
174
195
  pc = new window.RTCPeerConnection();
175
- _context.next = 2;
196
+ _context.next = 6;
176
197
  return pc.createOffer({
177
198
  offerToReceiveVideo: true
178
199
  });
179
- case 2:
200
+ case 6:
180
201
  offer = _context.sent;
181
- if (offer.sdp.match(/^a=rtpmap:\d+\s+H264\/\d+/m)) {
202
+ if ((_offer$sdp = offer.sdp) !== null && _offer$sdp !== void 0 && _offer$sdp.match(/^a=rtpmap:\d+\s+H264\/\d+/m)) {
182
203
  hasCodec = true;
183
204
  }
184
- pc.close();
185
- _context.next = 4;
205
+ _context.next = 8;
186
206
  break;
187
- case 3:
188
- _context.prev = 3;
189
- _t = _context["catch"](1);
207
+ case 7:
208
+ _context.prev = 7;
209
+ _t2 = _context["catch"](5);
190
210
  _loggerProxy.default.logger.warn('Meetings:util#hasH264Codec --> Error creating peerConnection for H.264 test.');
191
- case 4:
211
+ case 8:
212
+ _context.prev = 8;
213
+ (_pc = pc) === null || _pc === void 0 ? void 0 : _pc.close();
214
+ return _context.finish(8);
215
+ case 9:
192
216
  return _context.abrupt("return", hasCodec);
193
- case 5:
217
+ case 10:
194
218
  case "end":
195
219
  return _context.stop();
196
220
  }
197
- }, _callee, null, [[1, 3]]);
221
+ }, _callee, null, [[0, 3], [5, 7, 8, 9]]);
198
222
  }));
199
223
 
200
224
  /**
@@ -1 +1 @@
1
- {"version":3,"names":["_constants","require","_loggerProxy","_interopRequireDefault","_triggerProxy","_constants2","_metrics","_meetings","_types","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","getSiteName","multipartSitePrefixList","arguments","siteName","forEach","multipartSitePrefix","includes","secondDot","indexOf","substring","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","getThisDevice","newLocus","_newLocus$self","_newLocus$self$device","self","isWholeMeetingEnded","fullState","state","LOCUS","STATE","INACTIVE","endMeetingReason","EndMeetingReason","breakoutEnded","isSelfMovedOrBreakoutEnded","locus","_locus$self","_locus$self2","_locus$fullState","_locus$fullState2","isSelfLeftMoved","_LEFT_","reason","_MOVED_","isBreakoutEnded","isOneOnOneCall","_locus$fullState3","fullStateType","_CALL_","_SIP_BRIDGE_","_SPACE_SHARE_","joinedOnThisDevice","thisDevice","_JOINED_","isBreakoutLocusDTO","_newLocus$controls","_newLocus$controls$br","_newLocus$info","controls","breakout","sessionType","BREAKOUTS","SESSION_TYPES","BREAKOUT","info","isBreakout","isValidBreakoutLocus","_locus$fullState4","_locus$self3","inActiveStatus","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 _CALL_,\n _CREATED_,\n _INCOMING_,\n _JOINED_,\n _LEFT_,\n DESTINATION_TYPE,\n _MOVED_,\n _SIP_BRIDGE_,\n _SPACE_SHARE_,\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';\nimport {EndMeetingReason, LocusFullState} from '../locus-info/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\nMeetingsUtil.getSiteName = (site: string, multipartSitePrefixList: string[] = []) => {\n if (!site) {\n return null;\n }\n\n let siteName: string | undefined;\n\n multipartSitePrefixList.forEach((multipartSitePrefix) => {\n if (!siteName && site.includes(multipartSitePrefix)) {\n const secondDot = site.indexOf('.', site.indexOf('.') + 1);\n\n siteName = site.substring(0, secondDot);\n }\n });\n\n if (siteName) {\n return siteName;\n }\n\n siteName = site.substring(0, site.indexOf('.'));\n\n return siteName;\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 * Checks if the fullState indicates the meeting has fully ended (not just a breakout move).\n * @param {Object} fullState locus fullState data\n * @returns {boolean}\n */\nMeetingsUtil.isWholeMeetingEnded = (fullState: LocusFullState): boolean => {\n return (\n fullState.state === LOCUS.STATE.INACTIVE &&\n fullState.endMeetingReason !== EndMeetingReason.breakoutEnded\n );\n};\n\n/**\n * Checks if the self state in a locus indicates a breakout move or breakout end.\n * Returns true when:\n * - self state is LEFT with reason MOVED (regular breakout move), OR\n * - fullState is INACTIVE with endMeetingReason BREAKOUT_ENDED (breakout session ended)\n * @param {Object} locus locus data\n * @returns {boolean}\n */\nMeetingsUtil.isSelfMovedOrBreakoutEnded = (locus: any): boolean => {\n const isSelfLeftMoved = locus?.self?.state === _LEFT_ && locus?.self?.reason === _MOVED_;\n const isBreakoutEnded =\n locus?.fullState?.state === LOCUS.STATE.INACTIVE &&\n locus?.fullState?.endMeetingReason === EndMeetingReason.breakoutEnded;\n\n return isSelfLeftMoved || isBreakoutEnded;\n};\n\n/**\n * Checks if a locus is a 1:1 call using locus.fullState.type.\n * Returns true when fullState.type is CALL, SIP_BRIDGE, or SPACE_SHARE.\n * @param {Object} locus locus data\n * @returns {boolean}\n */\nMeetingsUtil.isOneOnOneCall = (locus: any): boolean => {\n const fullStateType = locus?.fullState?.type;\n\n return (\n fullStateType === _CALL_ || fullStateType === _SIP_BRIDGE_ || fullStateType === _SPACE_SHARE_\n );\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;AAgBA,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;AACA,IAAAO,MAAA,GAAAP,OAAA;AAvBA;;AAyBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,IAAMQ,YAAiB,GAAG,CAAC,CAAC;AAE5BA,YAAY,CAACC,mBAAmB,GAAG,UAACC,IAAsB;EAAA,OACxDA,IAAI,KAAKC,2BAAgB,CAACC,QAAQ,GAAGC,qBAAU,GAAGC,oBAAS;AAAA;AAE7DN,YAAY,CAACO,iBAAiB,GAAG,UAACC,QAAQ,EAAEC,iBAAiB,EAAK;EAChE,IAAOC,IAAI,GAAIF,QAAQ,CAAhBE,IAAI;EACX,IAAOC,SAAS,GAAID,IAAI,CAAjBC,SAAS;EAEhB,IAAIA,SAAS,KAAKC,qBAAU,CAACC,YAAY,EAAE;IACzC,IAAMC,OAAO,GAAGL,iBAAiB,CAACM,QAAQ,CAACC,qBAAW,CAACC,cAAc,EAAEP,IAAI,CAACQ,aAAa,CAAC;IAE1F,IAAIJ,OAAO,EAAE;MACX,IAAAK,aAAA,GAA8DT,IAAI,CAACU,OAAO;QAAnEC,GAAG,GAAAF,aAAA,CAAHE,GAAG;QAAEC,WAAW,GAAAH,aAAA,CAAXG,WAAW;QAAEC,UAAU,GAAAJ,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wBpB,QAAQ,cAAAqB,sBAAA,uBAAhCA,sBAAA,CAAkCpI,GAAG,GAC3E;IACA,OAAO,IAAI;EACb;EACA,IAAML,SAAS,GAAGmI,aAAa,aAAbA,aAAa,wBAAAO,mBAAA,GAAbP,aAAa,CAAElD,IAAI,cAAAyD,mBAAA,uBAAnBA,mBAAA,CAAqB1I,SAAS;EAChD,IAAM6I,WAAW,IAAAF,qBAAA,GAAG3M,YAAY,CAAC6I,aAAa,CAACsD,aAAa,EAAEnI,SAAS,CAAC,cAAA2I,qBAAA,wBAAAC,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,CAAC7H,GAAG,EAAE;IACnE,OAAO,IAAI;EACb;EAEA,OAAO,KAAK;AACd,CAAC;AAAC,IAAA2I,QAAA,GAAAC,OAAA,CAAApI,OAAA,GACa7E,YAAY","ignoreList":[]}
1
+ {"version":3,"names":["_webCapabilities","require","_constants","_loggerProxy","_interopRequireDefault","_triggerProxy","_constants2","_metrics","_meetings","_types","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","getSiteName","multipartSitePrefixList","arguments","siteName","forEach","multipartSitePrefix","includes","secondDot","indexOf","substring","hasH264Codec","_asyncToGenerator2","_regenerator","mark","_callee","codecCapability","hasCodec","pc","_offer$sdp","offer","_pc","_t","_t2","wrap","_context","prev","next","WebCapabilities","isCapableOfReceivingVideoCodec","CapabilityState","CAPABLE","abrupt","NOT_CAPABLE","window","RTCPeerConnection","createOffer","offerToReceiveVideo","sent","LoggerProxy","logger","warn","close","finish","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","getThisDevice","newLocus","_newLocus$self","_newLocus$self$device","self","isWholeMeetingEnded","fullState","state","LOCUS","STATE","INACTIVE","endMeetingReason","EndMeetingReason","breakoutEnded","isSelfMovedOrBreakoutEnded","locus","_locus$self","_locus$self2","_locus$fullState","_locus$fullState2","isSelfLeftMoved","_LEFT_","reason","_MOVED_","isBreakoutEnded","isOneOnOneCall","_locus$fullState3","fullStateType","_CALL_","_SIP_BRIDGE_","_SPACE_SHARE_","joinedOnThisDevice","thisDevice","_JOINED_","isBreakoutLocusDTO","_newLocus$controls","_newLocus$controls$br","_newLocus$info","controls","breakout","sessionType","BREAKOUTS","SESSION_TYPES","BREAKOUT","info","isBreakout","isValidBreakoutLocus","_locus$fullState4","_locus$self3","inActiveStatus","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 {CapabilityState, WebCapabilities} from '@webex/web-capabilities';\nimport {\n _CALL_,\n _CREATED_,\n _INCOMING_,\n _JOINED_,\n _LEFT_,\n DESTINATION_TYPE,\n _MOVED_,\n _SIP_BRIDGE_,\n _SPACE_SHARE_,\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';\nimport {EndMeetingReason, LocusFullState} from '../locus-info/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\nMeetingsUtil.getSiteName = (site: string, multipartSitePrefixList: string[] = []) => {\n if (!site) {\n return null;\n }\n\n let siteName: string | undefined;\n\n multipartSitePrefixList.forEach((multipartSitePrefix) => {\n if (!siteName && site.includes(multipartSitePrefix)) {\n const secondDot = site.indexOf('.', site.indexOf('.') + 1);\n\n siteName = site.substring(0, secondDot);\n }\n });\n\n if (siteName) {\n return siteName;\n }\n\n siteName = site.substring(0, site.indexOf('.'));\n\n return siteName;\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 try {\n const codecCapability = WebCapabilities.isCapableOfReceivingVideoCodec('video/H264');\n\n if (codecCapability === CapabilityState.CAPABLE) {\n return true;\n }\n\n if (codecCapability === CapabilityState.NOT_CAPABLE) {\n return false;\n }\n } catch (_) {\n // NO-OP\n }\n\n let hasCodec = false;\n\n let pc;\n try {\n 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 } catch (error) {\n LoggerProxy.logger.warn(\n 'Meetings:util#hasH264Codec --> Error creating peerConnection for H.264 test.'\n );\n } finally {\n pc?.close();\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 * Checks if the fullState indicates the meeting has fully ended (not just a breakout move).\n * @param {Object} fullState locus fullState data\n * @returns {boolean}\n */\nMeetingsUtil.isWholeMeetingEnded = (fullState: LocusFullState): boolean => {\n return (\n fullState.state === LOCUS.STATE.INACTIVE &&\n fullState.endMeetingReason !== EndMeetingReason.breakoutEnded\n );\n};\n\n/**\n * Checks if the self state in a locus indicates a breakout move or breakout end.\n * Returns true when:\n * - self state is LEFT with reason MOVED (regular breakout move), OR\n * - fullState is INACTIVE with endMeetingReason BREAKOUT_ENDED (breakout session ended)\n * @param {Object} locus locus data\n * @returns {boolean}\n */\nMeetingsUtil.isSelfMovedOrBreakoutEnded = (locus: any): boolean => {\n const isSelfLeftMoved = locus?.self?.state === _LEFT_ && locus?.self?.reason === _MOVED_;\n const isBreakoutEnded =\n locus?.fullState?.state === LOCUS.STATE.INACTIVE &&\n locus?.fullState?.endMeetingReason === EndMeetingReason.breakoutEnded;\n\n return isSelfLeftMoved || isBreakoutEnded;\n};\n\n/**\n * Checks if a locus is a 1:1 call using locus.fullState.type.\n * Returns true when fullState.type is CALL, SIP_BRIDGE, or SPACE_SHARE.\n * @param {Object} locus locus data\n * @returns {boolean}\n */\nMeetingsUtil.isOneOnOneCall = (locus: any): boolean => {\n const fullStateType = locus?.fullState?.type;\n\n return (\n fullStateType === _CALL_ || fullStateType === _SIP_BRIDGE_ || fullStateType === _SPACE_SHARE_\n );\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,gBAAA,GAAAC,OAAA;AACA,IAAAC,UAAA,GAAAD,OAAA;AAgBA,IAAAE,YAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,aAAA,GAAAD,sBAAA,CAAAH,OAAA;AACA,IAAAK,WAAA,GAAAF,sBAAA,CAAAH,OAAA;AACA,IAAAM,QAAA,GAAAH,sBAAA,CAAAH,OAAA;AACA,IAAAO,SAAA,GAAAP,OAAA;AACA,IAAAQ,MAAA,GAAAR,OAAA;AAxBA;;AA0BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,IAAMS,YAAiB,GAAG,CAAC,CAAC;AAE5BA,YAAY,CAACC,mBAAmB,GAAG,UAACC,IAAsB;EAAA,OACxDA,IAAI,KAAKC,2BAAgB,CAACC,QAAQ,GAAGC,qBAAU,GAAGC,oBAAS;AAAA;AAE7DN,YAAY,CAACO,iBAAiB,GAAG,UAACC,QAAQ,EAAEC,iBAAiB,EAAK;EAChE,IAAOC,IAAI,GAAI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aAAa,CAAElD,IAAI,cAAAyD,mBAAA,uBAAnBA,mBAAA,CAAqBpJ,SAAS;EAChD,IAAMuJ,WAAW,IAAAF,qBAAA,GAAGrN,YAAY,CAACuJ,aAAa,CAACsD,aAAa,EAAE7I,SAAS,CAAC,cAAAqJ,qBAAA,wBAAAC,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,CAACvI,GAAG,EAAE;IACnE,OAAO,IAAI;EACb;EAEA,OAAO,KAAK;AACd,CAAC;AAAC,IAAAqJ,QAAA,GAAAC,OAAA,CAAA9I,OAAA,GACa7E,YAAY","ignoreList":[]}
@@ -869,7 +869,7 @@ var Webinar = _webexCore.WebexPlugin.extend({
869
869
  }, _callee1);
870
870
  }))();
871
871
  },
872
- version: "3.12.0-next.93"
872
+ version: "3.12.0-next.94"
873
873
  });
874
874
  var _default = exports.default = Webinar;
875
875
  //# 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.93"
97
+ "version": "3.12.0-next.94"
98
98
  }
@@ -1,5 +1,6 @@
1
1
  /* globals window */
2
2
 
3
+ import {CapabilityState, WebCapabilities} from '@webex/web-capabilities';
3
4
  import {
4
5
  _CALL_,
5
6
  _CREATED_,
@@ -187,20 +188,36 @@ MeetingsUtil.getSiteName = (site: string, multipartSitePrefixList: string[] = []
187
188
  * @returns {Promise<boolean>}
188
189
  */
189
190
  MeetingsUtil.hasH264Codec = async () => {
191
+ try {
192
+ const codecCapability = WebCapabilities.isCapableOfReceivingVideoCodec('video/H264');
193
+
194
+ if (codecCapability === CapabilityState.CAPABLE) {
195
+ return true;
196
+ }
197
+
198
+ if (codecCapability === CapabilityState.NOT_CAPABLE) {
199
+ return false;
200
+ }
201
+ } catch (_) {
202
+ // NO-OP
203
+ }
204
+
190
205
  let hasCodec = false;
191
206
 
207
+ let pc;
192
208
  try {
193
- const pc = new window.RTCPeerConnection();
209
+ pc = new window.RTCPeerConnection();
194
210
  const offer = await pc.createOffer({offerToReceiveVideo: true});
195
211
 
196
- if (offer.sdp.match(/^a=rtpmap:\d+\s+H264\/\d+/m)) {
212
+ if (offer.sdp?.match(/^a=rtpmap:\d+\s+H264\/\d+/m)) {
197
213
  hasCodec = true;
198
214
  }
199
- pc.close();
200
215
  } catch (error) {
201
216
  LoggerProxy.logger.warn(
202
217
  'Meetings:util#hasH264Codec --> Error creating peerConnection for H.264 test.'
203
218
  );
219
+ } finally {
220
+ pc?.close();
204
221
  }
205
222
 
206
223
  return hasCodec;
@@ -1,9 +1,12 @@
1
+ import 'jsdom-global/register';
1
2
  import {assert} from '@webex/test-helper-chai';
2
3
  import sinon from 'sinon';
4
+ import {CapabilityState, WebCapabilities} from '@webex/web-capabilities';
3
5
 
4
6
  import MeetingsUtil from '@webex/plugin-meetings/src/meetings/util';
5
7
  import Metrics from '@webex/plugin-meetings/src/metrics';
6
8
  import BEHAVIORAL_METRICS from '@webex/plugin-meetings/src/metrics/constants';
9
+ import LoggerProxy from '@webex/plugin-meetings/src/common/logs/logger-proxy';
7
10
 
8
11
  const multipartSitePrefixList = ['.my.', '.mydmz.', '.mybts.', '.mydev.', '.myats2.', '.myats.'];
9
12
 
@@ -77,6 +80,107 @@ describe('plugin-meetings', () => {
77
80
  });
78
81
  });
79
82
 
83
+ describe('#hasH264Codec', () => {
84
+ let isCapableOfReceivingVideoCodecStub;
85
+
86
+ beforeEach(() => {
87
+ isCapableOfReceivingVideoCodecStub = sinon.stub(
88
+ WebCapabilities,
89
+ 'isCapableOfReceivingVideoCodec'
90
+ );
91
+ });
92
+
93
+ it('returns true when video/H264 reports CAPABLE', async () => {
94
+ isCapableOfReceivingVideoCodecStub.withArgs('video/H264').returns(CapabilityState.CAPABLE);
95
+
96
+ const result = await MeetingsUtil.hasH264Codec();
97
+ assert.equal(result, true);
98
+ assert.calledOnceWithExactly(isCapableOfReceivingVideoCodecStub, 'video/H264');
99
+ });
100
+
101
+ it('returns false when video/H264 reports NOT_CAPABLE', async () => {
102
+ isCapableOfReceivingVideoCodecStub
103
+ .withArgs('video/H264')
104
+ .returns(CapabilityState.NOT_CAPABLE);
105
+
106
+ const result = await MeetingsUtil.hasH264Codec();
107
+ assert.equal(result, false);
108
+ assert.calledOnceWithExactly(isCapableOfReceivingVideoCodecStub, 'video/H264');
109
+ });
110
+
111
+ it('falls back to RTCPeerConnection when isCapableOfReceivingVideoCodec throws', async () => {
112
+ isCapableOfReceivingVideoCodecStub.throws(new Error('WebCapabilities unavailable'));
113
+ const mockPc = {createOffer: sinon.stub(), close: sinon.stub()};
114
+ global.window.RTCPeerConnection = sinon.stub().returns(mockPc);
115
+ mockPc.createOffer.resolves({sdp: 'v=0\r\na=rtpmap:96 H264/90000\r\n'});
116
+
117
+ assert.equal(await MeetingsUtil.hasH264Codec(), true);
118
+ assert.calledOnce(mockPc.close);
119
+
120
+ delete global.window.RTCPeerConnection;
121
+ });
122
+
123
+ describe('when video/H264 reports UNKNOWN (falls back to RTCPeerConnection)', () => {
124
+ let mockPc;
125
+
126
+ beforeEach(() => {
127
+ isCapableOfReceivingVideoCodecStub
128
+ .withArgs('video/H264')
129
+ .returns(CapabilityState.UNKNOWN);
130
+ mockPc = {createOffer: sinon.stub(), close: sinon.stub()};
131
+ global.window.RTCPeerConnection = sinon.stub().returns(mockPc);
132
+ });
133
+
134
+ afterEach(() => {
135
+ delete global.window.RTCPeerConnection;
136
+ });
137
+
138
+ it('returns true when SDP contains H264', async () => {
139
+ mockPc.createOffer.resolves({sdp: 'v=0\r\na=rtpmap:96 H264/90000\r\n'});
140
+
141
+ assert.equal(await MeetingsUtil.hasH264Codec(), true);
142
+ assert.calledOnce(mockPc.close);
143
+ });
144
+
145
+ it('returns false when SDP does not contain H264', async () => {
146
+ mockPc.createOffer.resolves({sdp: 'v=0\r\na=rtpmap:96 VP8/90000\r\n'});
147
+
148
+ assert.equal(await MeetingsUtil.hasH264Codec(), false);
149
+ assert.calledOnce(mockPc.close);
150
+ });
151
+
152
+ it('returns false when SDP is undefined', async () => {
153
+ mockPc.createOffer.resolves({sdp: undefined});
154
+
155
+ assert.equal(await MeetingsUtil.hasH264Codec(), false);
156
+ assert.calledOnce(mockPc.close);
157
+ });
158
+
159
+ it('logs a warning and returns false when createOffer throws', async () => {
160
+ sinon.stub(LoggerProxy.logger, 'warn');
161
+ mockPc.createOffer.rejects(new Error('createOffer failed'));
162
+
163
+ assert.equal(await MeetingsUtil.hasH264Codec(), false);
164
+ assert.calledOnce(mockPc.close);
165
+ assert.calledWith(
166
+ LoggerProxy.logger.warn,
167
+ 'Meetings:util#hasH264Codec --> Error creating peerConnection for H.264 test.'
168
+ );
169
+ });
170
+
171
+ it('logs a warning and returns false when RTCPeerConnection constructor throws', async () => {
172
+ sinon.stub(LoggerProxy.logger, 'warn');
173
+ global.window.RTCPeerConnection = sinon.stub().throws(new Error('no RTCPeerConnection'));
174
+
175
+ assert.equal(await MeetingsUtil.hasH264Codec(), false);
176
+ assert.calledWith(
177
+ LoggerProxy.logger.warn,
178
+ 'Meetings:util#hasH264Codec --> Error creating peerConnection for H.264 test.'
179
+ );
180
+ });
181
+ });
182
+ });
183
+
80
184
  describe('#getSiteName', () => {
81
185
  it('gets the site name from a standard Webex site', () => {
82
186
  assert.equal(MeetingsUtil.getSiteName('go.webex.com', multipartSitePrefixList), 'go');
@@ -107,25 +211,28 @@ describe('plugin-meetings', () => {
107
211
  it('return null if no matched device in self', () => {
108
212
  const newLocus = {
109
213
  self: {
110
- devices: [{state: 'JOINED', url: '456'}]
111
- }
214
+ devices: [{state: 'JOINED', url: '456'}],
215
+ },
112
216
  };
113
217
  assert.equal(MeetingsUtil.getThisDevice(newLocus, '123'), null);
114
218
  });
115
219
  it('return the device match with current device', () => {
116
220
  const newLocus = {
117
221
  self: {
118
- devices: [{state: 'JOINED', url: '123'}]
119
- }
222
+ devices: [{state: 'JOINED', url: '123'}],
223
+ },
120
224
  };
121
- assert.deepEqual(MeetingsUtil.getThisDevice(newLocus, '123'), {state: 'JOINED', url: '123'});
122
- })
225
+ assert.deepEqual(MeetingsUtil.getThisDevice(newLocus, '123'), {
226
+ state: 'JOINED',
227
+ url: '123',
228
+ });
229
+ });
123
230
  });
124
231
 
125
232
  describe('#isBreakoutLocusDTO', () => {
126
233
  it('returns false is no breakout in locus.controls', () => {
127
234
  const newLocus = {
128
- controls: {}
235
+ controls: {},
129
236
  };
130
237
 
131
238
  assert.equal(MeetingsUtil.isBreakoutLocusDTO(newLocus), false);
@@ -264,10 +371,26 @@ describe('plugin-meetings', () => {
264
371
 
265
372
  describe('#isWholeMeetingEnded', () => {
266
373
  [
267
- {description: 'state is INACTIVE with no endMeetingReason', fullState: {state: 'INACTIVE'}, expected: true},
268
- {description: 'state is INACTIVE with endMeetingReason OTHER', fullState: {state: 'INACTIVE', endMeetingReason: 'SOME_OTHER_REASON'}, expected: true},
269
- {description: 'state is INACTIVE with endMeetingReason BREAKOUT_ENDED', fullState: {state: 'INACTIVE', endMeetingReason: 'BREAKOUT_ENDED'}, expected: false},
270
- {description: 'state is not INACTIVE', fullState: {state: 'ACTIVE', endMeetingReason: 'SOME_OTHER_REASON'}, expected: false},
374
+ {
375
+ description: 'state is INACTIVE with no endMeetingReason',
376
+ fullState: {state: 'INACTIVE'},
377
+ expected: true,
378
+ },
379
+ {
380
+ description: 'state is INACTIVE with endMeetingReason OTHER',
381
+ fullState: {state: 'INACTIVE', endMeetingReason: 'SOME_OTHER_REASON'},
382
+ expected: true,
383
+ },
384
+ {
385
+ description: 'state is INACTIVE with endMeetingReason BREAKOUT_ENDED',
386
+ fullState: {state: 'INACTIVE', endMeetingReason: 'BREAKOUT_ENDED'},
387
+ expected: false,
388
+ },
389
+ {
390
+ description: 'state is not INACTIVE',
391
+ fullState: {state: 'ACTIVE', endMeetingReason: 'SOME_OTHER_REASON'},
392
+ expected: false,
393
+ },
271
394
  ].forEach(({description, fullState, expected}) => {
272
395
  it(`returns ${expected} when ${description}`, () => {
273
396
  assert.equal(MeetingsUtil.isWholeMeetingEnded(fullState), expected);
@@ -278,12 +401,42 @@ describe('plugin-meetings', () => {
278
401
  describe('#isSelfMovedOrBreakoutEnded', () => {
279
402
  [
280
403
  {description: 'locus is undefined', locus: undefined, expected: false},
281
- {description: 'self state is JOINED', locus: {self: {state: 'JOINED', reason: 'OTHER'}}, expected: false},
282
- {description: 'self state is LEFT with reason MOVED', locus: {self: {state: 'LEFT', reason: 'MOVED'}}, expected: true},
283
- {description: 'fullState is INACTIVE with BREAKOUT_ENDED', locus: {self: {state: 'LEFT', reason: 'OTHER'}, fullState: {state: 'INACTIVE', endMeetingReason: 'BREAKOUT_ENDED'}}, expected: true},
284
- {description: 'fullState is INACTIVE with different endMeetingReason', locus: {self: {state: 'LEFT', reason: 'OTHER'}, fullState: {state: 'INACTIVE', endMeetingReason: 'SOME_OTHER_REASON'}}, expected: false},
285
- {description: 'fullState is missing', locus: {self: {state: 'LEFT', reason: 'OTHER'}}, expected: false},
286
- {description: 'endMeetingReason is missing', locus: {self: {state: 'LEFT', reason: 'OTHER'}, fullState: {state: 'INACTIVE'}}, expected: false},
404
+ {
405
+ description: 'self state is JOINED',
406
+ locus: {self: {state: 'JOINED', reason: 'OTHER'}},
407
+ expected: false,
408
+ },
409
+ {
410
+ description: 'self state is LEFT with reason MOVED',
411
+ locus: {self: {state: 'LEFT', reason: 'MOVED'}},
412
+ expected: true,
413
+ },
414
+ {
415
+ description: 'fullState is INACTIVE with BREAKOUT_ENDED',
416
+ locus: {
417
+ self: {state: 'LEFT', reason: 'OTHER'},
418
+ fullState: {state: 'INACTIVE', endMeetingReason: 'BREAKOUT_ENDED'},
419
+ },
420
+ expected: true,
421
+ },
422
+ {
423
+ description: 'fullState is INACTIVE with different endMeetingReason',
424
+ locus: {
425
+ self: {state: 'LEFT', reason: 'OTHER'},
426
+ fullState: {state: 'INACTIVE', endMeetingReason: 'SOME_OTHER_REASON'},
427
+ },
428
+ expected: false,
429
+ },
430
+ {
431
+ description: 'fullState is missing',
432
+ locus: {self: {state: 'LEFT', reason: 'OTHER'}},
433
+ expected: false,
434
+ },
435
+ {
436
+ description: 'endMeetingReason is missing',
437
+ locus: {self: {state: 'LEFT', reason: 'OTHER'}, fullState: {state: 'INACTIVE'}},
438
+ expected: false,
439
+ },
287
440
  ].forEach(({description, locus, expected}) => {
288
441
  it(`returns ${expected} when ${description}`, () => {
289
442
  assert.equal(MeetingsUtil.isSelfMovedOrBreakoutEnded(locus), expected);
@@ -327,11 +480,11 @@ describe('plugin-meetings', () => {
327
480
  it('return true if joined on this device', () => {
328
481
  const newLocus = {
329
482
  self: {
330
- devices: [{state: 'JOINED', correlationId: '111', url: '123'}]
331
- }
483
+ devices: [{state: 'JOINED', correlationId: '111', url: '123'}],
484
+ },
332
485
  };
333
486
  const meeting = {
334
- correlationId: '111'
487
+ correlationId: '111',
335
488
  };
336
489
 
337
490
  assert.equal(MeetingsUtil.joinedOnThisDevice(meeting, newLocus, '123'), true);
@@ -339,18 +492,18 @@ describe('plugin-meetings', () => {
339
492
  it('return true if selfMoved on this device', () => {
340
493
  const newLocus = {
341
494
  self: {
342
- devices: [{state: 'LEFT', reason: 'MOVED', correlationId: '111', url: '123'}]
343
- }
495
+ devices: [{state: 'LEFT', reason: 'MOVED', correlationId: '111', url: '123'}],
496
+ },
344
497
  };
345
498
  const meeting = {
346
- correlationId: '111'
499
+ correlationId: '111',
347
500
  };
348
501
 
349
502
  assert.equal(MeetingsUtil.joinedOnThisDevice(meeting, newLocus, '123'), true);
350
503
  });
351
504
  });
352
505
 
353
- describe("#handleRoapMercury", () => {
506
+ describe('#handleRoapMercury', () => {
354
507
  let envelope;
355
508
  let meetingCollection;
356
509
  let roapMessageReceived;
@@ -365,67 +518,74 @@ describe('plugin-meetings', () => {
365
518
  id: 'meeting-id',
366
519
  roapMessageReceived,
367
520
  roap: {
368
- turnDiscovery: {handleTurnDiscoveryResponse}
369
- }
521
+ turnDiscovery: {handleTurnDiscoveryResponse},
522
+ },
370
523
  };
371
524
  envelope = {
372
525
  data: {
373
- message:{
374
- seq: "seq",
526
+ message: {
527
+ seq: 'seq',
375
528
  messageType: 'messageType',
376
529
  tieBreaker: 'tieBreaker',
377
530
  errorType: 'errorType',
378
531
  errorCause: 'errorCause',
379
- sdps: [{id:'sdp-1'}]
532
+ sdps: [{id: 'sdp-1'}],
380
533
  },
381
534
  correlationId: 'correlationId',
382
535
  eventType: 'locus.message.roap',
383
- }
536
+ },
384
537
  };
385
538
  meetingCollection = {
386
- getByKey: () => meeting
539
+ getByKey: () => meeting,
387
540
  };
388
541
  });
389
542
 
390
543
  it('it sends the correct behaviour metric', () => {
391
544
  MeetingsUtil.handleRoapMercury(envelope, meetingCollection);
392
- assert.calledWith(Metrics.sendBehavioralMetric, BEHAVIORAL_METRICS.ROAP_MERCURY_EVENT_RECEIVED, {
393
- correlation_id: 'correlationId',
394
- seq: "seq",
395
- message_type: 'messageType',
396
- error_type: 'errorType',
397
- error_cause: 'errorCause',
398
- })
545
+ assert.calledWith(
546
+ Metrics.sendBehavioralMetric,
547
+ BEHAVIORAL_METRICS.ROAP_MERCURY_EVENT_RECEIVED,
548
+ {
549
+ correlation_id: 'correlationId',
550
+ seq: 'seq',
551
+ message_type: 'messageType',
552
+ error_type: 'errorType',
553
+ error_cause: 'errorCause',
554
+ }
555
+ );
399
556
  assert.calledWith(roapMessageReceived, {
400
- seq: "seq",
557
+ seq: 'seq',
401
558
  messageType: 'messageType',
402
559
  errorType: 'errorType',
403
560
  tieBreaker: 'tieBreaker',
404
561
  errorCause: 'errorCause',
405
- sdp: {id:'sdp-1'}
406
- })
407
-
562
+ sdp: {id: 'sdp-1'},
563
+ });
408
564
  });
409
565
 
410
566
  it('calls handleTurnDiscoveryResponse for TURN_DISCOVERY_RESPONSE', () => {
411
567
  envelope.data.message.messageType = 'TURN_DISCOVERY_RESPONSE';
412
568
  delete envelope.data.message.sdps;
413
569
  MeetingsUtil.handleRoapMercury(envelope, meetingCollection);
414
- assert.calledWith(meeting.roap.turnDiscovery.handleTurnDiscoveryResponse, {
415
- seq: "seq",
416
- messageType: 'TURN_DISCOVERY_RESPONSE',
417
- errorType: 'errorType',
418
- tieBreaker: 'tieBreaker',
419
- errorCause: 'errorCause',
420
- }, 'from mercury')
570
+ assert.calledWith(
571
+ meeting.roap.turnDiscovery.handleTurnDiscoveryResponse,
572
+ {
573
+ seq: 'seq',
574
+ messageType: 'TURN_DISCOVERY_RESPONSE',
575
+ errorType: 'errorType',
576
+ tieBreaker: 'tieBreaker',
577
+ errorCause: 'errorCause',
578
+ },
579
+ 'from mercury'
580
+ );
421
581
  });
422
- })
582
+ });
423
583
  });
424
584
 
425
585
  describe('#isValidBreakoutLocus', () => {
426
586
  it('returns false if is not breakout locus', () => {
427
587
  const newLocus = {
428
- controls: {}
588
+ controls: {},
429
589
  };
430
590
 
431
591
  assert.equal(MeetingsUtil.isValidBreakoutLocus(newLocus), false);
@@ -439,8 +599,8 @@ describe('plugin-meetings', () => {
439
599
  },
440
600
  },
441
601
  fullState: {
442
- state: 'INACTIVE'
443
- }
602
+ state: 'INACTIVE',
603
+ },
444
604
  };
445
605
  assert.equal(MeetingsUtil.isValidBreakoutLocus(newLocus), false);
446
606
  });
@@ -453,11 +613,11 @@ describe('plugin-meetings', () => {
453
613
  },
454
614
  },
455
615
  fullState: {
456
- state: 'ACTIVE'
616
+ state: 'ACTIVE',
457
617
  },
458
618
  self: {
459
- state: 'LEFT'
460
- }
619
+ state: 'LEFT',
620
+ },
461
621
  };
462
622
  assert.equal(MeetingsUtil.isValidBreakoutLocus(newLocus), false);
463
623
  });
@@ -470,11 +630,11 @@ describe('plugin-meetings', () => {
470
630
  },
471
631
  },
472
632
  fullState: {
473
- state: 'ACTIVE'
633
+ state: 'ACTIVE',
474
634
  },
475
635
  self: {
476
- state: 'JOINED'
477
- }
636
+ state: 'JOINED',
637
+ },
478
638
  };
479
639
  assert.equal(MeetingsUtil.isValidBreakoutLocus(newLocus), true);
480
640
  });
@@ -482,10 +642,12 @@ describe('plugin-meetings', () => {
482
642
 
483
643
  describe('#getMediaServer', () => {
484
644
  it('returns the contents of o-line lower cased', () => {
485
- const sdp1 = 'v=0\r\no=homer 0 1 IN IP4 23.89.67.81\r\ns=-\r\nc=IN IP4 23.89.67.81\r\nb=TIAS:128000\r\nt=0 0\r\na=ice-lite\r\n'
645
+ const sdp1 =
646
+ 'v=0\r\no=homer 0 1 IN IP4 23.89.67.81\r\ns=-\r\nc=IN IP4 23.89.67.81\r\nb=TIAS:128000\r\nt=0 0\r\na=ice-lite\r\n';
486
647
  assert.equal(MeetingsUtil.getMediaServer(sdp1), 'homer');
487
648
 
488
- const sdp2 = 'v=0\r\no=HOMER 0 1 IN IP4 23.89.67.81\r\ns=-\r\nc=IN IP4 23.89.67.81\r\nb=TIAS:128000\r\nt=0 0\r\na=ice-lite\r\n'
649
+ const sdp2 =
650
+ 'v=0\r\no=HOMER 0 1 IN IP4 23.89.67.81\r\ns=-\r\nc=IN IP4 23.89.67.81\r\nb=TIAS:128000\r\nt=0 0\r\na=ice-lite\r\n';
489
651
  assert.equal(MeetingsUtil.getMediaServer(sdp2), 'homer');
490
652
  });
491
653
  });