@webex/plugin-meetings 3.12.0-next.49 → 3.12.0-next.50
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/aiEnableRequest/index.js +1 -1
- package/dist/breakouts/breakout.js +1 -1
- package/dist/breakouts/index.js +1 -1
- package/dist/config.js +1 -0
- package/dist/config.js.map +1 -1
- package/dist/index.js +7 -0
- package/dist/index.js.map +1 -1
- package/dist/interpretation/index.js +1 -1
- package/dist/interpretation/siLanguage.js +1 -1
- package/dist/meetings/index.js +25 -0
- package/dist/meetings/index.js.map +1 -1
- package/dist/meetings/meetings.types.js +6 -1
- package/dist/meetings/meetings.types.js.map +1 -1
- package/dist/meetings/request.js +39 -0
- package/dist/meetings/request.js.map +1 -1
- package/dist/meetings/util.js +18 -0
- package/dist/meetings/util.js.map +1 -1
- package/dist/types/config.d.ts +1 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/meetings/index.d.ts +18 -1
- package/dist/types/meetings/meetings.types.d.ts +15 -0
- package/dist/types/meetings/request.d.ts +14 -0
- package/dist/webinar/index.js +1 -1
- package/package.json +1 -1
- package/src/config.ts +1 -0
- package/src/index.ts +5 -0
- package/src/meetings/index.ts +27 -0
- package/src/meetings/meetings.types.ts +19 -0
- package/src/meetings/request.ts +43 -0
- package/src/meetings/util.ts +24 -0
- package/test/unit/spec/meetings/index.js +83 -0
- package/test/unit/spec/meetings/request.js +141 -0
- package/test/unit/spec/meetings/utils.js +24 -0
|
@@ -4,7 +4,7 @@ var _Object$defineProperty = require("@babel/runtime-corejs2/core-js/object/defi
|
|
|
4
4
|
_Object$defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.MEETING_KEY = void 0;
|
|
7
|
+
exports.SitePreferenceSelectOption = exports.MEETING_KEY = exports.DEFAULT_SITE_PREFERENCE_SELECT_OPTIONS = void 0;
|
|
8
8
|
var MEETING_KEY = exports.MEETING_KEY = {
|
|
9
9
|
CONVERSATION_URL: 'conversationUrl',
|
|
10
10
|
SIP_URI: 'sipUri',
|
|
@@ -14,4 +14,9 @@ var MEETING_KEY = exports.MEETING_KEY = {
|
|
|
14
14
|
};
|
|
15
15
|
|
|
16
16
|
// finer grained status for registration steps
|
|
17
|
+
var SitePreferenceSelectOption = exports.SitePreferenceSelectOption = /*#__PURE__*/function (SitePreferenceSelectOption) {
|
|
18
|
+
SitePreferenceSelectOption["SCHEDULING"] = "scheduling";
|
|
19
|
+
return SitePreferenceSelectOption;
|
|
20
|
+
}({});
|
|
21
|
+
var DEFAULT_SITE_PREFERENCE_SELECT_OPTIONS = exports.DEFAULT_SITE_PREFERENCE_SELECT_OPTIONS = [SitePreferenceSelectOption.SCHEDULING];
|
|
17
22
|
//# sourceMappingURL=meetings.types.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["MEETING_KEY","exports","CONVERSATION_URL","SIP_URI","LOCUS_URL","MEETINGNUMBER","CORRELATION_ID"],"sources":["meetings.types.ts"],"sourcesContent":["import type {\n NoiseReductionEffectOptions,\n VirtualBackgroundEffectOptions,\n} from '@webex/media-helpers';\nimport {Enum} from '../constants';\n\ntype INoiseReductionEffect = Omit<\n NoiseReductionEffectOptions,\n 'authToken' | 'workletProcessorUrl' | 'legacyProcessorUrl'\n>;\ntype IVirtualBackgroundEffect = Omit<VirtualBackgroundEffectOptions, 'authToken'>;\n\nexport type {INoiseReductionEffect, IVirtualBackgroundEffect};\n\nexport const MEETING_KEY = {\n CONVERSATION_URL: 'conversationUrl',\n SIP_URI: 'sipUri',\n LOCUS_URL: 'locusUrl',\n MEETINGNUMBER: 'meetingNumber',\n CORRELATION_ID: 'correlationId',\n} as const;\n\nexport type MEETING_KEY = Enum<typeof MEETING_KEY>;\n\n// finer grained status for registration steps\nexport type MeetingRegistrationStatus = {\n fetchWebexSite: boolean;\n getGeoHint: boolean;\n startReachability: boolean;\n deviceRegister: boolean;\n mercuryConnect: boolean;\n checkH264Support: boolean;\n};\n"],"mappings":";;;;;;;AAcO,IAAMA,WAAW,GAAAC,OAAA,CAAAD,WAAA,GAAG;EACzBE,gBAAgB,EAAE,iBAAiB;EACnCC,OAAO,EAAE,QAAQ;EACjBC,SAAS,EAAE,UAAU;EACrBC,aAAa,EAAE,eAAe;EAC9BC,cAAc,EAAE;AAClB,CAAU;;AAIV","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["MEETING_KEY","exports","CONVERSATION_URL","SIP_URI","LOCUS_URL","MEETINGNUMBER","CORRELATION_ID","SitePreferenceSelectOption","DEFAULT_SITE_PREFERENCE_SELECT_OPTIONS","SCHEDULING"],"sources":["meetings.types.ts"],"sourcesContent":["import type {\n NoiseReductionEffectOptions,\n VirtualBackgroundEffectOptions,\n} from '@webex/media-helpers';\nimport {Enum} from '../constants';\n\ntype INoiseReductionEffect = Omit<\n NoiseReductionEffectOptions,\n 'authToken' | 'workletProcessorUrl' | 'legacyProcessorUrl'\n>;\ntype IVirtualBackgroundEffect = Omit<VirtualBackgroundEffectOptions, 'authToken'>;\n\nexport type {INoiseReductionEffect, IVirtualBackgroundEffect};\n\nexport const MEETING_KEY = {\n CONVERSATION_URL: 'conversationUrl',\n SIP_URI: 'sipUri',\n LOCUS_URL: 'locusUrl',\n MEETINGNUMBER: 'meetingNumber',\n CORRELATION_ID: 'correlationId',\n} as const;\n\nexport type MEETING_KEY = Enum<typeof MEETING_KEY>;\n\n// finer grained status for registration steps\nexport type MeetingRegistrationStatus = {\n fetchWebexSite: boolean;\n getGeoHint: boolean;\n startReachability: boolean;\n deviceRegister: boolean;\n mercuryConnect: boolean;\n checkH264Support: boolean;\n};\n\nexport enum SitePreferenceSelectOption {\n SCHEDULING = 'scheduling',\n}\n\nexport type FetchSitePreferencesMeViaSiteOptions = {\n siteUrl?: string;\n siteName?: string;\n selectOptions?: SitePreferenceSelectOption[];\n};\n\nexport const DEFAULT_SITE_PREFERENCE_SELECT_OPTIONS = [SitePreferenceSelectOption.SCHEDULING];\n\nexport type SitePreferencesResponse = {\n scheduling?: {\n supportScheduleWebinar?: boolean;\n webinarWebLink?: string;\n };\n};\n"],"mappings":";;;;;;;AAcO,IAAMA,WAAW,GAAAC,OAAA,CAAAD,WAAA,GAAG;EACzBE,gBAAgB,EAAE,iBAAiB;EACnCC,OAAO,EAAE,QAAQ;EACjBC,SAAS,EAAE,UAAU;EACrBC,aAAa,EAAE,eAAe;EAC9BC,cAAc,EAAE;AAClB,CAAU;;AAIV;AAAA,IAUYC,0BAA0B,GAAAN,OAAA,CAAAM,0BAAA,0BAA1BA,0BAA0B;EAA1BA,0BAA0B;EAAA,OAA1BA,0BAA0B;AAAA;AAU/B,IAAMC,sCAAsC,GAAAP,OAAA,CAAAO,sCAAA,GAAG,CAACD,0BAA0B,CAACE,UAAU,CAAC","ignoreList":[]}
|
package/dist/meetings/request.js
CHANGED
|
@@ -15,7 +15,10 @@ var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime-corejs2/he
|
|
|
15
15
|
var _inherits2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/inherits"));
|
|
16
16
|
var _webexCore = require("@webex/webex-core");
|
|
17
17
|
var _loggerProxy = _interopRequireDefault(require("../common/logs/logger-proxy"));
|
|
18
|
+
var _parameter = _interopRequireDefault(require("../common/errors/parameter"));
|
|
18
19
|
var _constants = require("../constants");
|
|
20
|
+
var _meetings = require("./meetings.types");
|
|
21
|
+
var _util = _interopRequireDefault(require("./util"));
|
|
19
22
|
function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? _Reflect$construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); }
|
|
20
23
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } // @ts-ignore
|
|
21
24
|
/**
|
|
@@ -70,6 +73,42 @@ var MeetingRequest = exports.default = /*#__PURE__*/function (_StatelessWebexPlu
|
|
|
70
73
|
return this.webex.internal.services.getMeetingPreferences();
|
|
71
74
|
}
|
|
72
75
|
|
|
76
|
+
/**
|
|
77
|
+
* Fetches site preferences from a given site given a select option and a siteUrl with an optional siteName. If siteName is not provided, it will be derived from the siteUrl. If siteUrl is not provided, it will throw an error. If selectOptions is not provided, it will default to scheduling.
|
|
78
|
+
*
|
|
79
|
+
* @param {object} [options]
|
|
80
|
+
* @param {string} [options.siteUrl] - Webex site URL, for example "cisco.webex.com".
|
|
81
|
+
* @param {string} [options.siteName] - Site name query override. Defaults to the site name derived from options.siteUrl, e.g., "cisco".
|
|
82
|
+
* @param {SitePreferenceSelectOption[]} [options.selectOptions] - Preference sections to fetch. Defaults to 'scheduling'.
|
|
83
|
+
* @returns {Promise<SitePreferencesResponse>} site preferences response body
|
|
84
|
+
* @throws {ParameterError}
|
|
85
|
+
* @public
|
|
86
|
+
* @memberof MeetingRequest
|
|
87
|
+
*/
|
|
88
|
+
}, {
|
|
89
|
+
key: "fetchSitePreferencesMeViaSite",
|
|
90
|
+
value: function fetchSitePreferencesMeViaSite() {
|
|
91
|
+
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
92
|
+
var siteUrl = options.siteUrl,
|
|
93
|
+
_options$selectOption = options.selectOptions,
|
|
94
|
+
selectOptions = _options$selectOption === void 0 ? _meetings.DEFAULT_SITE_PREFERENCE_SELECT_OPTIONS : _options$selectOption;
|
|
95
|
+
if (!siteUrl) {
|
|
96
|
+
throw new _parameter.default('No siteUrl available. Call register() before fetching site preferences or provide options.siteUrl.');
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
// @ts-ignore - config comes from registerPlugin
|
|
100
|
+
var multipartSitePrefixList = this.config.meetings.multipartSitePrefixList || [];
|
|
101
|
+
var siteName = options.siteName || _util.default.getSiteName(siteUrl, multipartSitePrefixList);
|
|
102
|
+
|
|
103
|
+
// @ts-ignore
|
|
104
|
+
return this.request({
|
|
105
|
+
method: _constants.HTTP_VERBS.GET,
|
|
106
|
+
uri: "https://".concat(siteUrl, "/wbxappapi/v1/users/me/preference?select=").concat(encodeURIComponent(selectOptions.join(',')), "&siteurl=").concat(encodeURIComponent(siteName))
|
|
107
|
+
}).then(function (res) {
|
|
108
|
+
return res.body;
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
|
|
73
112
|
// locus federation, determines and populate locus if the responseBody has remote URLs to fetch locus details
|
|
74
113
|
|
|
75
114
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_webexCore","require","_loggerProxy","_interopRequireDefault","_constants","_callSuper","t","o","e","_getPrototypeOf2","default","_possibleConstructorReturn2","_isNativeReflectConstruct","_Reflect$construct","constructor","apply","Boolean","prototype","valueOf","call","MeetingRequest","exports","_StatelessWebexPlugin","_classCallCheck2","arguments","_inherits2","_createClass2","key","value","getActiveMeetings","_this","request","api","API","LOCUS","resource","RESOURCE","LOCI","then","res","determineRedirections","body","catch","error","LoggerProxy","logger","concat","Error","fetchGeoHint","webex","internal","services","fetchClientRegionInfo","getMeetingPreferences","
|
|
1
|
+
{"version":3,"names":["_webexCore","require","_loggerProxy","_interopRequireDefault","_parameter","_constants","_meetings","_util","_callSuper","t","o","e","_getPrototypeOf2","default","_possibleConstructorReturn2","_isNativeReflectConstruct","_Reflect$construct","constructor","apply","Boolean","prototype","valueOf","call","MeetingRequest","exports","_StatelessWebexPlugin","_classCallCheck2","arguments","_inherits2","_createClass2","key","value","getActiveMeetings","_this","request","api","API","LOCUS","resource","RESOURCE","LOCI","then","res","determineRedirections","body","catch","error","LoggerProxy","logger","concat","Error","fetchGeoHint","webex","internal","services","fetchClientRegionInfo","getMeetingPreferences","fetchSitePreferencesMeViaSite","options","length","undefined","siteUrl","_options$selectOption","selectOptions","DEFAULT_SITE_PREFERENCE_SELECT_OPTIONS","ParameterError","multipartSitePrefixList","config","meetings","siteName","MeetingsUtil","getSiteName","method","HTTP_VERBS","GET","uri","encodeURIComponent","join","responseBody","_this2","remoteLocusClusterUrls","_promise","all","map","url","runWhitelistedDomains","loci","locusUrls","resolve","StatelessWebexPlugin"],"sources":["request.ts"],"sourcesContent":["// @ts-ignore\nimport {StatelessWebexPlugin} from '@webex/webex-core';\n\nimport LoggerProxy from '../common/logs/logger-proxy';\nimport ParameterError from '../common/errors/parameter';\nimport {HTTP_VERBS, API, RESOURCE} from '../constants';\nimport {\n DEFAULT_SITE_PREFERENCE_SELECT_OPTIONS,\n type FetchSitePreferencesMeViaSiteOptions,\n type SitePreferencesResponse,\n} from './meetings.types';\nimport MeetingsUtil from './util';\n\n/**\n * @class MeetingRequest\n */\nexport default class MeetingRequest extends StatelessWebexPlugin {\n /**\n * get all the active meetings for the user\n * @returns {Array} return locus array\n */\n getActiveMeetings() {\n // @ts-ignore\n return this.request({\n api: API.LOCUS,\n resource: RESOURCE.LOCI,\n })\n .then((res) => this.determineRedirections(res.body))\n .catch((error) => {\n LoggerProxy.logger.error(\n `Meetings:request#getActiveMeetings --> failed to get locus details, ${error}`\n );\n throw new Error(error);\n });\n }\n\n /**\n * fetch geoHit for the user\n * @returns {Promise<object>} geoHintInfo\n */\n fetchGeoHint() {\n // @ts-ignore\n return this.webex.internal.services.fetchClientRegionInfo();\n }\n\n /**\n * get user meeting preference information\n * @returns {Promise<object>} getMeetingPreferences\n */\n getMeetingPreferences() {\n // @ts-ignore\n return this.webex.internal.services.getMeetingPreferences();\n }\n\n /**\n * Fetches site preferences from a given site given a select option and a siteUrl with an optional siteName. If siteName is not provided, it will be derived from the siteUrl. If siteUrl is not provided, it will throw an error. If selectOptions is not provided, it will default to scheduling.\n *\n * @param {object} [options]\n * @param {string} [options.siteUrl] - Webex site URL, for example \"cisco.webex.com\".\n * @param {string} [options.siteName] - Site name query override. Defaults to the site name derived from options.siteUrl, e.g., \"cisco\".\n * @param {SitePreferenceSelectOption[]} [options.selectOptions] - Preference sections to fetch. Defaults to 'scheduling'.\n * @returns {Promise<SitePreferencesResponse>} site preferences response body\n * @throws {ParameterError}\n * @public\n * @memberof MeetingRequest\n */\n fetchSitePreferencesMeViaSite(\n options: FetchSitePreferencesMeViaSiteOptions = {}\n ): Promise<SitePreferencesResponse> {\n const {siteUrl, selectOptions = DEFAULT_SITE_PREFERENCE_SELECT_OPTIONS} = options;\n\n if (!siteUrl) {\n throw new ParameterError(\n 'No siteUrl available. Call register() before fetching site preferences or provide options.siteUrl.'\n );\n }\n\n // @ts-ignore - config comes from registerPlugin\n const multipartSitePrefixList = this.config.meetings.multipartSitePrefixList || [];\n const siteName = options.siteName || MeetingsUtil.getSiteName(siteUrl, multipartSitePrefixList);\n\n // @ts-ignore\n return this.request({\n method: HTTP_VERBS.GET,\n uri: `https://${siteUrl}/wbxappapi/v1/users/me/preference?select=${encodeURIComponent(\n selectOptions.join(',')\n )}&siteurl=${encodeURIComponent(siteName)}`,\n }).then((res: any) => res.body);\n }\n\n // locus federation, determines and populate locus if the responseBody has remote URLs to fetch locus details\n\n /**\n * Fetches indivdual locus rather then getting all at once\n * @param {object} responseBody determine the locus and fetch them if a remoteUrl is given\n * @returns {Promise} returns locusObject array\n */\n determineRedirections(responseBody: any) {\n if (responseBody.remoteLocusClusterUrls && responseBody.remoteLocusClusterUrls.length) {\n return Promise.all(\n responseBody.remoteLocusClusterUrls.map((url) =>\n // @ts-ignore\n this.request({\n method: HTTP_VERBS.GET,\n url,\n runWhitelistedDomains: true, // allows auth token for whitelisted domain\n })\n .then((res) => {\n responseBody.loci = responseBody.loci.concat(res.body.loci);\n responseBody.locusUrls = responseBody.locusUrls.concat(res.body.locusUrls);\n\n return Promise.resolve(responseBody);\n })\n .catch((error) => {\n LoggerProxy.logger.error(\n `Meetings:request#determineRedirections --> failed to get locus details from url: ${url}, reason: ${error}`\n );\n throw new Error(error);\n })\n )\n ).then(() => Promise.resolve(responseBody));\n }\n\n return Promise.resolve(responseBody);\n }\n}\n"],"mappings":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SAAS,CAAC;cAE1E,OAAON,QAAA,CAAApE,OAAA,CAAQ2E,OAAO,CAACV,YAAY,CAAC;YACtC,CAAC,CAAC,CACDjC,KAAK,CAAC,UAACC,KAAK,EAAK;cAChBC,oBAAW,CAACC,MAAM,CAACF,KAAK,qFAAAG,MAAA,CAC8DmC,GAAG,gBAAAnC,MAAA,CAAaH,KAAK,CAC3G,CAAC;cACD,MAAM,IAAII,KAAK,CAACJ,KAAK,CAAC;YACxB,CAAC;UAAC;QAAA,CACN,CACF,CAAC,CAACL,IAAI,CAAC;UAAA,OAAMwC,QAAA,CAAApE,OAAA,CAAQ2E,OAAO,CAACV,YAAY,CAAC;QAAA,EAAC;MAC7C;MAEA,OAAOG,QAAA,CAAApE,OAAA,CAAQ2E,OAAO,CAACV,YAAY,CAAC;IACtC;EAAC;AAAA,EA5GyCW,+BAAoB","ignoreList":[]}
|
package/dist/meetings/util.js
CHANGED
|
@@ -139,6 +139,24 @@ MeetingsUtil.parseDefaultSiteFromMeetingPreferences = function (userPreferences)
|
|
|
139
139
|
}
|
|
140
140
|
return result;
|
|
141
141
|
};
|
|
142
|
+
MeetingsUtil.getSiteName = function (site) {
|
|
143
|
+
var multipartSitePrefixList = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
144
|
+
if (!site) {
|
|
145
|
+
return null;
|
|
146
|
+
}
|
|
147
|
+
var siteName;
|
|
148
|
+
multipartSitePrefixList.forEach(function (multipartSitePrefix) {
|
|
149
|
+
if (!siteName && site.includes(multipartSitePrefix)) {
|
|
150
|
+
var secondDot = site.indexOf('.', site.indexOf('.') + 1);
|
|
151
|
+
siteName = site.substring(0, secondDot);
|
|
152
|
+
}
|
|
153
|
+
});
|
|
154
|
+
if (siteName) {
|
|
155
|
+
return siteName;
|
|
156
|
+
}
|
|
157
|
+
siteName = site.substring(0, site.indexOf('.'));
|
|
158
|
+
return siteName;
|
|
159
|
+
};
|
|
142
160
|
|
|
143
161
|
/**
|
|
144
162
|
* Will check to see if the H.264 media codec is supported.
|
|
@@ -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","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","isWholeMeetingEnded","fullState","state","LOCUS","STATE","INACTIVE","endMeetingReason","EndMeetingReason","breakoutEnded","isSelfMovedOrBreakoutEnded","locus","_locus$self","_locus$self2","_locus$fullState","_locus$fullState2","isSelfLeftMoved","_LEFT_","reason","_MOVED_","isBreakoutEnded","joinedOnThisDevice","thisDevice","_JOINED_","isBreakoutLocusDTO","_newLocus$controls","_newLocus$controls$br","_newLocus$info","controls","breakout","sessionType","BREAKOUTS","SESSION_TYPES","BREAKOUT","info","isBreakout","isValidBreakoutLocus","_locus$fullState3","_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 _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';\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\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 * 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;AACA,IAAAO,MAAA,GAAAP,OAAA;AApBA;;AAsBA;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,aAAA,CAAVI,UAAU;QAAEC,SAAS,GAAAL,aAAA,CAATK,SAAS;QAAEC,UAAU,GAAAN,aAAA,CA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qBAAA,wBAAAC,sBAAA,GAAtBD,qBAAA,CAAwBpB,QAAQ,cAAAqB,sBAAA,uBAAhCA,sBAAA,CAAkCrH,GAAG,GAC3E;IACA,OAAO,IAAI;EACb;EACA,IAAML,SAAS,GAAGoH,aAAa,aAAbA,aAAa,wBAAAO,mBAAA,GAAbP,aAAa,CAAE5C,IAAI,cAAAmD,mBAAA,uBAAnBA,mBAAA,CAAqB3H,SAAS;EAChD,IAAM8H,WAAW,IAAAF,qBAAA,GAAG5L,YAAY,CAACoI,aAAa,CAACgD,aAAa,EAAEpH,SAAS,CAAC,cAAA4H,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,CAAC9G,GAAG,EAAE;IACnE,OAAO,IAAI;EACb;EAEA,OAAO,KAAK;AACd,CAAC;AAAC,IAAA4H,QAAA,GAAAC,OAAA,CAAArH,OAAA,GACa7E,YAAY","ignoreList":[]}
|
|
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","joinedOnThisDevice","thisDevice","_JOINED_","isBreakoutLocusDTO","_newLocus$controls","_newLocus$controls$br","_newLocus$info","controls","breakout","sessionType","BREAKOUTS","SESSION_TYPES","BREAKOUT","info","isBreakout","isValidBreakoutLocus","_locus$fullState3","_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 _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';\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 * 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,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AqI,QAAA,GAAAC,OAAA,CAAA9H,OAAA,GACa7E,YAAY","ignoreList":[]}
|
package/dist/types/config.d.ts
CHANGED
package/dist/types/index.d.ts
CHANGED
|
@@ -16,6 +16,8 @@ export * as REACTIONS from './reactions/reactions';
|
|
|
16
16
|
export * as sdkAnnotationTypes from './annotation/annotation.types';
|
|
17
17
|
export * as MeetingInfoV2 from './meeting-info/meeting-info-v2';
|
|
18
18
|
export { type Reaction } from './reactions/reactions.type';
|
|
19
|
+
export { SitePreferenceSelectOption } from './meetings/meetings.types';
|
|
20
|
+
export type { FetchSitePreferencesMeViaSiteOptions, SitePreferencesResponse, } from './meetings/meetings.types';
|
|
19
21
|
export { CaptchaError, IntentToJoinError, JoinMeetingError, PasswordError, PermissionError, ReclaimHostIsHostAlreadyError, ReclaimHostNotAllowedError, ReclaimHostNotSupportedError, ReclaimHostEmptyWrongKeyError, Meeting, MeetingInfoUtil, JoinWebinarError, SdpResponseTimeoutError, };
|
|
20
22
|
export { RemoteMedia } from './multistream/remoteMedia';
|
|
21
23
|
export { default as TriggerProxy } from './common/events/trigger-proxy';
|
|
@@ -8,7 +8,7 @@ import 'webrtc-adapter';
|
|
|
8
8
|
import { LOCUSEVENT, DESTINATION_TYPE } from '../constants';
|
|
9
9
|
import { CallStateForMetrics } from '../meeting';
|
|
10
10
|
import Reachability from '../reachability';
|
|
11
|
-
import { INoiseReductionEffect, IVirtualBackgroundEffect, MeetingRegistrationStatus } from './meetings.types';
|
|
11
|
+
import { FetchSitePreferencesMeViaSiteOptions, INoiseReductionEffect, IVirtualBackgroundEffect, MeetingRegistrationStatus, SitePreferencesResponse } from './meetings.types';
|
|
12
12
|
import { HashTreeMessage } from '../hashTree/hashTreeParser';
|
|
13
13
|
export type LocusEvent = {
|
|
14
14
|
eventType: LOCUSEVENT;
|
|
@@ -368,6 +368,23 @@ export default class Meetings extends WebexPlugin {
|
|
|
368
368
|
* @memberof Meetings
|
|
369
369
|
*/
|
|
370
370
|
getPersonalMeetingRoom(): any;
|
|
371
|
+
/**
|
|
372
|
+
* Fetches site preferences for the provided Webex site, or the preferred Webex site.
|
|
373
|
+
* This is used to determine capabilities of the site, such as whether scheduling a webinar is supported.
|
|
374
|
+
*
|
|
375
|
+
* @param {object} [options]
|
|
376
|
+
* @param {string} [options.siteUrl] - Webex site URL. Defaults to preferredWebexSite, for example "cisco.webex.com".
|
|
377
|
+
* @param {string} [options.siteName] - Site name query override. Defaults to the site name derived from siteUrl, for example "cisco" for "cisco.webex.com".
|
|
378
|
+
* @param {SitePreferenceSelectOption[]} [options.selectOptions] - Preference sections to fetch. Defaults to 'scheduling'.
|
|
379
|
+
* @returns {Promise<SitePreferencesResponse>} site preferences response body
|
|
380
|
+
* @throws {ParameterError}
|
|
381
|
+
* @public
|
|
382
|
+
* @memberof Meetings
|
|
383
|
+
* @example
|
|
384
|
+
* const preferences = await webex.meetings.fetchSitePreferencesMeViaSite();
|
|
385
|
+
* const supportScheduleWebinar = preferences?.scheduling?.supportScheduleWebinar;
|
|
386
|
+
*/
|
|
387
|
+
fetchSitePreferencesMeViaSite(options?: FetchSitePreferencesMeViaSiteOptions): Promise<SitePreferencesResponse>;
|
|
371
388
|
/**
|
|
372
389
|
* Returns basic information about a meeting that exists or
|
|
373
390
|
* used to exist in the MeetingCollection
|
|
@@ -19,3 +19,18 @@ export type MeetingRegistrationStatus = {
|
|
|
19
19
|
mercuryConnect: boolean;
|
|
20
20
|
checkH264Support: boolean;
|
|
21
21
|
};
|
|
22
|
+
export declare enum SitePreferenceSelectOption {
|
|
23
|
+
SCHEDULING = "scheduling"
|
|
24
|
+
}
|
|
25
|
+
export type FetchSitePreferencesMeViaSiteOptions = {
|
|
26
|
+
siteUrl?: string;
|
|
27
|
+
siteName?: string;
|
|
28
|
+
selectOptions?: SitePreferenceSelectOption[];
|
|
29
|
+
};
|
|
30
|
+
export declare const DEFAULT_SITE_PREFERENCE_SELECT_OPTIONS: SitePreferenceSelectOption[];
|
|
31
|
+
export type SitePreferencesResponse = {
|
|
32
|
+
scheduling?: {
|
|
33
|
+
supportScheduleWebinar?: boolean;
|
|
34
|
+
webinarWebLink?: string;
|
|
35
|
+
};
|
|
36
|
+
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { StatelessWebexPlugin } from '@webex/webex-core';
|
|
2
|
+
import { type FetchSitePreferencesMeViaSiteOptions, type SitePreferencesResponse } from './meetings.types';
|
|
2
3
|
/**
|
|
3
4
|
* @class MeetingRequest
|
|
4
5
|
*/
|
|
@@ -18,6 +19,19 @@ export default class MeetingRequest extends StatelessWebexPlugin {
|
|
|
18
19
|
* @returns {Promise<object>} getMeetingPreferences
|
|
19
20
|
*/
|
|
20
21
|
getMeetingPreferences(): any;
|
|
22
|
+
/**
|
|
23
|
+
* Fetches site preferences from a given site given a select option and a siteUrl with an optional siteName. If siteName is not provided, it will be derived from the siteUrl. If siteUrl is not provided, it will throw an error. If selectOptions is not provided, it will default to scheduling.
|
|
24
|
+
*
|
|
25
|
+
* @param {object} [options]
|
|
26
|
+
* @param {string} [options.siteUrl] - Webex site URL, for example "cisco.webex.com".
|
|
27
|
+
* @param {string} [options.siteName] - Site name query override. Defaults to the site name derived from options.siteUrl, e.g., "cisco".
|
|
28
|
+
* @param {SitePreferenceSelectOption[]} [options.selectOptions] - Preference sections to fetch. Defaults to 'scheduling'.
|
|
29
|
+
* @returns {Promise<SitePreferencesResponse>} site preferences response body
|
|
30
|
+
* @throws {ParameterError}
|
|
31
|
+
* @public
|
|
32
|
+
* @memberof MeetingRequest
|
|
33
|
+
*/
|
|
34
|
+
fetchSitePreferencesMeViaSite(options?: FetchSitePreferencesMeViaSiteOptions): Promise<SitePreferencesResponse>;
|
|
21
35
|
/**
|
|
22
36
|
* Fetches indivdual locus rather then getting all at once
|
|
23
37
|
* @param {object} responseBody determine the locus and fetch them if a remoteUrl is given
|
package/dist/webinar/index.js
CHANGED
package/package.json
CHANGED
package/src/config.ts
CHANGED
|
@@ -82,6 +82,7 @@ export default {
|
|
|
82
82
|
enableExtmap: false,
|
|
83
83
|
enableAutomaticLLM: false,
|
|
84
84
|
installedOrgID: undefined,
|
|
85
|
+
multipartSitePrefixList: ['.my.', '.mydmz.', '.mybts.', '.mydev.', '.myats2.', '.myats.'],
|
|
85
86
|
experimental: {
|
|
86
87
|
enableMediaNegotiatedEvent: false,
|
|
87
88
|
enableUnifiedMeetings: true,
|
package/src/index.ts
CHANGED
|
@@ -65,6 +65,11 @@ export * as REACTIONS from './reactions/reactions';
|
|
|
65
65
|
export * as sdkAnnotationTypes from './annotation/annotation.types';
|
|
66
66
|
export * as MeetingInfoV2 from './meeting-info/meeting-info-v2';
|
|
67
67
|
export {type Reaction} from './reactions/reactions.type';
|
|
68
|
+
export {SitePreferenceSelectOption} from './meetings/meetings.types';
|
|
69
|
+
export type {
|
|
70
|
+
FetchSitePreferencesMeViaSiteOptions,
|
|
71
|
+
SitePreferencesResponse,
|
|
72
|
+
} from './meetings/meetings.types';
|
|
68
73
|
|
|
69
74
|
export {
|
|
70
75
|
CaptchaError,
|
package/src/meetings/index.ts
CHANGED
|
@@ -55,10 +55,12 @@ import PasswordError from '../common/errors/password-error';
|
|
|
55
55
|
import CaptchaError from '../common/errors/captcha-error';
|
|
56
56
|
import MeetingCollection from './collection';
|
|
57
57
|
import {
|
|
58
|
+
FetchSitePreferencesMeViaSiteOptions,
|
|
58
59
|
MEETING_KEY,
|
|
59
60
|
INoiseReductionEffect,
|
|
60
61
|
IVirtualBackgroundEffect,
|
|
61
62
|
MeetingRegistrationStatus,
|
|
63
|
+
SitePreferencesResponse,
|
|
62
64
|
} from './meetings.types';
|
|
63
65
|
import MeetingsUtil from './util';
|
|
64
66
|
import PermissionError from '../common/errors/permission';
|
|
@@ -1405,6 +1407,31 @@ export default class Meetings extends WebexPlugin {
|
|
|
1405
1407
|
return this.personalMeetingRoom;
|
|
1406
1408
|
}
|
|
1407
1409
|
|
|
1410
|
+
/**
|
|
1411
|
+
* Fetches site preferences for the provided Webex site, or the preferred Webex site.
|
|
1412
|
+
* This is used to determine capabilities of the site, such as whether scheduling a webinar is supported.
|
|
1413
|
+
*
|
|
1414
|
+
* @param {object} [options]
|
|
1415
|
+
* @param {string} [options.siteUrl] - Webex site URL. Defaults to preferredWebexSite, for example "cisco.webex.com".
|
|
1416
|
+
* @param {string} [options.siteName] - Site name query override. Defaults to the site name derived from siteUrl, for example "cisco" for "cisco.webex.com".
|
|
1417
|
+
* @param {SitePreferenceSelectOption[]} [options.selectOptions] - Preference sections to fetch. Defaults to 'scheduling'.
|
|
1418
|
+
* @returns {Promise<SitePreferencesResponse>} site preferences response body
|
|
1419
|
+
* @throws {ParameterError}
|
|
1420
|
+
* @public
|
|
1421
|
+
* @memberof Meetings
|
|
1422
|
+
* @example
|
|
1423
|
+
* const preferences = await webex.meetings.fetchSitePreferencesMeViaSite();
|
|
1424
|
+
* const supportScheduleWebinar = preferences?.scheduling?.supportScheduleWebinar;
|
|
1425
|
+
*/
|
|
1426
|
+
public fetchSitePreferencesMeViaSite(
|
|
1427
|
+
options: FetchSitePreferencesMeViaSiteOptions = {}
|
|
1428
|
+
): Promise<SitePreferencesResponse> {
|
|
1429
|
+
return this.request.fetchSitePreferencesMeViaSite({
|
|
1430
|
+
...options,
|
|
1431
|
+
siteUrl: options.siteUrl || this.preferredWebexSite,
|
|
1432
|
+
});
|
|
1433
|
+
}
|
|
1434
|
+
|
|
1408
1435
|
/**
|
|
1409
1436
|
* Returns basic information about a meeting that exists or
|
|
1410
1437
|
* used to exist in the MeetingCollection
|
|
@@ -31,3 +31,22 @@ export type MeetingRegistrationStatus = {
|
|
|
31
31
|
mercuryConnect: boolean;
|
|
32
32
|
checkH264Support: boolean;
|
|
33
33
|
};
|
|
34
|
+
|
|
35
|
+
export enum SitePreferenceSelectOption {
|
|
36
|
+
SCHEDULING = 'scheduling',
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export type FetchSitePreferencesMeViaSiteOptions = {
|
|
40
|
+
siteUrl?: string;
|
|
41
|
+
siteName?: string;
|
|
42
|
+
selectOptions?: SitePreferenceSelectOption[];
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
export const DEFAULT_SITE_PREFERENCE_SELECT_OPTIONS = [SitePreferenceSelectOption.SCHEDULING];
|
|
46
|
+
|
|
47
|
+
export type SitePreferencesResponse = {
|
|
48
|
+
scheduling?: {
|
|
49
|
+
supportScheduleWebinar?: boolean;
|
|
50
|
+
webinarWebLink?: string;
|
|
51
|
+
};
|
|
52
|
+
};
|
package/src/meetings/request.ts
CHANGED
|
@@ -2,7 +2,14 @@
|
|
|
2
2
|
import {StatelessWebexPlugin} from '@webex/webex-core';
|
|
3
3
|
|
|
4
4
|
import LoggerProxy from '../common/logs/logger-proxy';
|
|
5
|
+
import ParameterError from '../common/errors/parameter';
|
|
5
6
|
import {HTTP_VERBS, API, RESOURCE} from '../constants';
|
|
7
|
+
import {
|
|
8
|
+
DEFAULT_SITE_PREFERENCE_SELECT_OPTIONS,
|
|
9
|
+
type FetchSitePreferencesMeViaSiteOptions,
|
|
10
|
+
type SitePreferencesResponse,
|
|
11
|
+
} from './meetings.types';
|
|
12
|
+
import MeetingsUtil from './util';
|
|
6
13
|
|
|
7
14
|
/**
|
|
8
15
|
* @class MeetingRequest
|
|
@@ -45,6 +52,42 @@ export default class MeetingRequest extends StatelessWebexPlugin {
|
|
|
45
52
|
return this.webex.internal.services.getMeetingPreferences();
|
|
46
53
|
}
|
|
47
54
|
|
|
55
|
+
/**
|
|
56
|
+
* Fetches site preferences from a given site given a select option and a siteUrl with an optional siteName. If siteName is not provided, it will be derived from the siteUrl. If siteUrl is not provided, it will throw an error. If selectOptions is not provided, it will default to scheduling.
|
|
57
|
+
*
|
|
58
|
+
* @param {object} [options]
|
|
59
|
+
* @param {string} [options.siteUrl] - Webex site URL, for example "cisco.webex.com".
|
|
60
|
+
* @param {string} [options.siteName] - Site name query override. Defaults to the site name derived from options.siteUrl, e.g., "cisco".
|
|
61
|
+
* @param {SitePreferenceSelectOption[]} [options.selectOptions] - Preference sections to fetch. Defaults to 'scheduling'.
|
|
62
|
+
* @returns {Promise<SitePreferencesResponse>} site preferences response body
|
|
63
|
+
* @throws {ParameterError}
|
|
64
|
+
* @public
|
|
65
|
+
* @memberof MeetingRequest
|
|
66
|
+
*/
|
|
67
|
+
fetchSitePreferencesMeViaSite(
|
|
68
|
+
options: FetchSitePreferencesMeViaSiteOptions = {}
|
|
69
|
+
): Promise<SitePreferencesResponse> {
|
|
70
|
+
const {siteUrl, selectOptions = DEFAULT_SITE_PREFERENCE_SELECT_OPTIONS} = options;
|
|
71
|
+
|
|
72
|
+
if (!siteUrl) {
|
|
73
|
+
throw new ParameterError(
|
|
74
|
+
'No siteUrl available. Call register() before fetching site preferences or provide options.siteUrl.'
|
|
75
|
+
);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
// @ts-ignore - config comes from registerPlugin
|
|
79
|
+
const multipartSitePrefixList = this.config.meetings.multipartSitePrefixList || [];
|
|
80
|
+
const siteName = options.siteName || MeetingsUtil.getSiteName(siteUrl, multipartSitePrefixList);
|
|
81
|
+
|
|
82
|
+
// @ts-ignore
|
|
83
|
+
return this.request({
|
|
84
|
+
method: HTTP_VERBS.GET,
|
|
85
|
+
uri: `https://${siteUrl}/wbxappapi/v1/users/me/preference?select=${encodeURIComponent(
|
|
86
|
+
selectOptions.join(',')
|
|
87
|
+
)}&siteurl=${encodeURIComponent(siteName)}`,
|
|
88
|
+
}).then((res: any) => res.body);
|
|
89
|
+
}
|
|
90
|
+
|
|
48
91
|
// locus federation, determines and populate locus if the responseBody has remote URLs to fetch locus details
|
|
49
92
|
|
|
50
93
|
/**
|
package/src/meetings/util.ts
CHANGED
|
@@ -153,6 +153,30 @@ MeetingsUtil.parseDefaultSiteFromMeetingPreferences = (userPreferences) => {
|
|
|
153
153
|
return result;
|
|
154
154
|
};
|
|
155
155
|
|
|
156
|
+
MeetingsUtil.getSiteName = (site: string, multipartSitePrefixList: string[] = []) => {
|
|
157
|
+
if (!site) {
|
|
158
|
+
return null;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
let siteName: string | undefined;
|
|
162
|
+
|
|
163
|
+
multipartSitePrefixList.forEach((multipartSitePrefix) => {
|
|
164
|
+
if (!siteName && site.includes(multipartSitePrefix)) {
|
|
165
|
+
const secondDot = site.indexOf('.', site.indexOf('.') + 1);
|
|
166
|
+
|
|
167
|
+
siteName = site.substring(0, secondDot);
|
|
168
|
+
}
|
|
169
|
+
});
|
|
170
|
+
|
|
171
|
+
if (siteName) {
|
|
172
|
+
return siteName;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
siteName = site.substring(0, site.indexOf('.'));
|
|
176
|
+
|
|
177
|
+
return siteName;
|
|
178
|
+
};
|
|
179
|
+
|
|
156
180
|
/**
|
|
157
181
|
* Will check to see if the H.264 media codec is supported.
|
|
158
182
|
* @async
|