@webex/plugin-meetings 3.0.0-beta.69 → 3.0.0-beta.70
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/breakouts/index.js
CHANGED
package/dist/meetings/util.js
CHANGED
|
@@ -101,13 +101,16 @@ MeetingsUtil.checkForCorrelationId = function (deviceUrl, locus) {
|
|
|
101
101
|
return false;
|
|
102
102
|
};
|
|
103
103
|
MeetingsUtil.parseDefaultSiteFromMeetingPreferences = function (userPreferences) {
|
|
104
|
+
var _userPreferences$site;
|
|
104
105
|
var result = '';
|
|
105
|
-
if (userPreferences && userPreferences.sites) {
|
|
106
|
+
if (userPreferences !== null && userPreferences !== void 0 && (_userPreferences$site = userPreferences.sites) !== null && _userPreferences$site !== void 0 && _userPreferences$site.length) {
|
|
106
107
|
var defaultSite = userPreferences.sites.find(function (site) {
|
|
107
108
|
return site.default;
|
|
108
109
|
});
|
|
109
110
|
if (defaultSite) {
|
|
110
111
|
result = defaultSite.siteUrl;
|
|
112
|
+
} else {
|
|
113
|
+
result = userPreferences.sites[0].siteUrl;
|
|
111
114
|
}
|
|
112
115
|
}
|
|
113
116
|
return result;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["MeetingsUtil","getMeetingAddedType","type","_LOCUS_ID_","_INCOMING_","_CREATED_","handleRoapMercury","envelope","meetingCollection","data","eventType","LOCUSEVENT","MESSAGE_ROAP","meeting","getByKey","CORRELATION_ID","correlationId","message","seq","messageType","tieBreaker","errorType","errorCause","ROAP","ROAP_TYPES","TURN_DISCOVERY_RESPONSE","roap","turnDiscovery","handleTurnDiscoveryResponse","roapMessage","sdp","sdps","length","undefined","mediaServer","getMediaServer","mediaProperties","webrtcMediaConnection","roapMessageReceived","split","find","line","startsWith","shift","replace","checkForCorrelationId","deviceUrl","locus","devices","self","foundDevice","device","url","parseDefaultSiteFromMeetingPreferences","userPreferences","result","sites","defaultSite","site","default","siteUrl","hasH264Codec","hasCodec","pc","window","RTCPeerConnection","createOffer","offerToReceiveVideo","offer","match","close","LoggerProxy","logger","warn","checkH264Support","options","firstChecked","disableNotifications","delay","maxDuration","shouldTrigger","shouldStopChecking","Trigger","trigger","file","function","EVENT_TRIGGERS","MEDIA_CODEC_LOADED","log","error","MEDIA_CODEC_MISSING","setTimeout","timestamp","call","getThisDevice","newLocus","thisDevice","joinedOnThisDevice","state","_JOINED_","_LEFT_","reason","_MOVED_"],"sources":["util.ts"],"sourcesContent":["/* globals window */\n\nimport {\n _LOCUS_ID_,\n _INCOMING_,\n _CREATED_,\n LOCUSEVENT,\n CORRELATION_ID,\n EVENT_TRIGGERS,\n ROAP,\n _LEFT_,\n _MOVED_,\n _JOINED_,\n} from '../constants';\nimport LoggerProxy from '../common/logs/logger-proxy';\nimport Trigger from '../common/events/trigger-proxy';\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) => (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(CORRELATION_ID, data.correlationId);\n\n if (meeting) {\n const {seq, messageType, tieBreaker, errorType, errorCause} = data.message;\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);\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 const mediaServer = MeetingsUtil.getMediaServer(roapMessage.sdp);\n\n meeting.mediaProperties.webrtcMediaConnection.roapMessageReceived(roapMessage);\n\n if (mediaServer) {\n meeting.mediaProperties.webrtcMediaConnection.mediaServer = mediaServer;\n }\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 } catch {\n mediaServer = undefined;\n }\n\n return mediaServer;\n};\n\nMeetingsUtil.checkForCorrelationId = (deviceUrl, locus) => {\n let devices = [];\n\n if (locus) {\n if (locus && locus.self && locus.self.devices) {\n devices = locus.self.devices;\n }\n\n const foundDevice = 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 && userPreferences.sites) {\n const defaultSite = userPreferences.sites.find((site) => site.default);\n\n if (defaultSite) {\n result = defaultSite.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 * @returns {Object}\n */\nMeetingsUtil.getThisDevice = (newLocus: any) => {\n if (newLocus?.self?.devices?.length > 0) {\n const [thisDevice] = newLocus.self.devices;\n\n return thisDevice;\n }\n\n return null;\n};\n\n/**\n * get self device joined status from locus data\n * @param {Object} meeting current meeting data\n * @param {Object} newLocus new locus data\n * @returns {Object}\n */\nMeetingsUtil.joinedOnThisDevice = (meeting: any, newLocus: any) => {\n const thisDevice = MeetingsUtil.getThisDevice(newLocus);\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\nexport default MeetingsUtil;\n"],"mappings":";;;;;;;;;;;;AAEA;AAYA;AACA;AAfA;;AAiBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,IAAMA,YAAiB,GAAG,CAAC,CAAC;AAE5BA,YAAY,CAACC,mBAAmB,GAAG,UAACC,IAAI;EAAA,OAAMA,IAAI,KAAKC,qBAAU,GAAGC,qBAAU,GAAGC,oBAAS;AAAA,CAAC;AAE3FL,YAAY,CAACM,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,yBAAc,EAAEN,IAAI,CAACO,aAAa,CAAC;IAE9E,IAAIH,OAAO,EAAE;MACX,oBAA8DJ,IAAI,CAACQ,OAAO;QAAnEC,GAAG,iBAAHA,GAAG;QAAEC,WAAW,iBAAXA,WAAW;QAAEC,UAAU,iBAAVA,UAAU;QAAEC,SAAS,iBAATA,SAAS;QAAEC,UAAU,iBAAVA,UAAU;MAE1D,IAAIH,WAAW,KAAKI,eAAI,CAACC,UAAU,CAACC,uBAAuB,EAAE;QAC3D;QACA;QACAZ,OAAO,CAACa,IAAI,CAACC,aAAa,CAACC,2BAA2B,CAACnB,IAAI,CAACQ,OAAO,CAAC;MACtE,CAAC,MAAM;QAAA;QAC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mBAAU;YAE5C5E,YAAY,CAAC0E,gBAAgB,CAACmB,IAAI,CAAC,KAAI,EAAE;cAACjB,YAAY,EAAEgB;YAAS,CAAC,CAAC;UACrE,CAAC,EAAEd,KAAK,CAAC;QAAC;QAAA;UAAA;MAAA;IAAA;EAAA,CACX;EAAA,SA7D8CJ,gBAAgB;IAAA;EAAA;EAAA,OAAhBA,gBAAgB;AAAA,GA6D9D;;AAED;AACA;AACA;AACA;AACA;AACA1E,YAAY,CAAC8F,aAAa,GAAG,UAACC,QAAa,EAAK;EAAA;EAC9C,IAAI,CAAAA,QAAQ,aAARA,QAAQ,yCAARA,QAAQ,CAAE9C,IAAI,4EAAd,eAAgBD,OAAO,0DAAvB,sBAAyBhB,MAAM,IAAG,CAAC,EAAE;IACvC,0DAAqB+D,QAAQ,CAAC9C,IAAI,CAACD,OAAO;MAAnCgD,UAAU;IAEjB,OAAOA,UAAU;EACnB;EAEA,OAAO,IAAI;AACb,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACAhG,YAAY,CAACiG,kBAAkB,GAAG,UAACpF,OAAY,EAAEkF,QAAa,EAAK;EACjE,IAAMC,UAAU,GAAGhG,YAAY,CAAC8F,aAAa,CAACC,QAAQ,CAAC;EACvD,IAAIC,UAAU,EAAE;IACd,IAAI,CAACA,UAAU,CAAChF,aAAa,IAAI,CAAAH,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAEG,aAAa,MAAKgF,UAAU,CAAChF,aAAa,EAAE;MACpF,OACEgF,UAAU,CAACE,KAAK,KAAKC,mBAAQ,IAC5BH,UAAU,CAACE,KAAK,KAAKE,iBAAM,IAAIJ,UAAU,CAACK,MAAM,KAAKC,kBAAQ;IAElE;EACF;EAEA,OAAO,KAAK;AACd,CAAC;AAAC,eAEatG,YAAY;AAAA"}
|
|
1
|
+
{"version":3,"names":["MeetingsUtil","getMeetingAddedType","type","_LOCUS_ID_","_INCOMING_","_CREATED_","handleRoapMercury","envelope","meetingCollection","data","eventType","LOCUSEVENT","MESSAGE_ROAP","meeting","getByKey","CORRELATION_ID","correlationId","message","seq","messageType","tieBreaker","errorType","errorCause","ROAP","ROAP_TYPES","TURN_DISCOVERY_RESPONSE","roap","turnDiscovery","handleTurnDiscoveryResponse","roapMessage","sdp","sdps","length","undefined","mediaServer","getMediaServer","mediaProperties","webrtcMediaConnection","roapMessageReceived","split","find","line","startsWith","shift","replace","checkForCorrelationId","deviceUrl","locus","devices","self","foundDevice","device","url","parseDefaultSiteFromMeetingPreferences","userPreferences","result","sites","defaultSite","site","default","siteUrl","hasH264Codec","hasCodec","pc","window","RTCPeerConnection","createOffer","offerToReceiveVideo","offer","match","close","LoggerProxy","logger","warn","checkH264Support","options","firstChecked","disableNotifications","delay","maxDuration","shouldTrigger","shouldStopChecking","Trigger","trigger","file","function","EVENT_TRIGGERS","MEDIA_CODEC_LOADED","log","error","MEDIA_CODEC_MISSING","setTimeout","timestamp","call","getThisDevice","newLocus","thisDevice","joinedOnThisDevice","state","_JOINED_","_LEFT_","reason","_MOVED_"],"sources":["util.ts"],"sourcesContent":["/* globals window */\n\nimport {\n _LOCUS_ID_,\n _INCOMING_,\n _CREATED_,\n LOCUSEVENT,\n CORRELATION_ID,\n EVENT_TRIGGERS,\n ROAP,\n _LEFT_,\n _MOVED_,\n _JOINED_,\n} from '../constants';\nimport LoggerProxy from '../common/logs/logger-proxy';\nimport Trigger from '../common/events/trigger-proxy';\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) => (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(CORRELATION_ID, data.correlationId);\n\n if (meeting) {\n const {seq, messageType, tieBreaker, errorType, errorCause} = data.message;\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);\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 const mediaServer = MeetingsUtil.getMediaServer(roapMessage.sdp);\n\n meeting.mediaProperties.webrtcMediaConnection.roapMessageReceived(roapMessage);\n\n if (mediaServer) {\n meeting.mediaProperties.webrtcMediaConnection.mediaServer = mediaServer;\n }\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 } catch {\n mediaServer = undefined;\n }\n\n return mediaServer;\n};\n\nMeetingsUtil.checkForCorrelationId = (deviceUrl, locus) => {\n let devices = [];\n\n if (locus) {\n if (locus && locus.self && locus.self.devices) {\n devices = locus.self.devices;\n }\n\n const foundDevice = 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 * @returns {Object}\n */\nMeetingsUtil.getThisDevice = (newLocus: any) => {\n if (newLocus?.self?.devices?.length > 0) {\n const [thisDevice] = newLocus.self.devices;\n\n return thisDevice;\n }\n\n return null;\n};\n\n/**\n * get self device joined status from locus data\n * @param {Object} meeting current meeting data\n * @param {Object} newLocus new locus data\n * @returns {Object}\n */\nMeetingsUtil.joinedOnThisDevice = (meeting: any, newLocus: any) => {\n const thisDevice = MeetingsUtil.getThisDevice(newLocus);\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\nexport default MeetingsUtil;\n"],"mappings":";;;;;;;;;;;;AAEA;AAYA;AACA;AAfA;;AAiBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,IAAMA,YAAiB,GAAG,CAAC,CAAC;AAE5BA,YAAY,CAACC,mBAAmB,GAAG,UAACC,IAAI;EAAA,OAAMA,IAAI,KAAKC,qBAAU,GAAGC,qBAAU,GAAGC,oBAAS;AAAA,CAAC;AAE3FL,YAAY,CAACM,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,yBAAc,EAAEN,IAAI,CAACO,aAAa,CAAC;I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AU,GAAGhG,YAAY,CAAC8F,aAAa,CAACC,QAAQ,CAAC;EACvD,IAAIC,UAAU,EAAE;IACd,IAAI,CAACA,UAAU,CAAChF,aAAa,IAAI,CAAAH,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAEG,aAAa,MAAKgF,UAAU,CAAChF,aAAa,EAAE;MACpF,OACEgF,UAAU,CAACE,KAAK,KAAKC,mBAAQ,IAC5BH,UAAU,CAACE,KAAK,KAAKE,iBAAM,IAAIJ,UAAU,CAACK,MAAM,KAAKC,kBAAQ;IAElE;EACF;EAEA,OAAO,KAAK;AACd,CAAC;AAAC,eAEatG,YAAY;AAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webex/plugin-meetings",
|
|
3
|
-
"version": "3.0.0-beta.
|
|
3
|
+
"version": "3.0.0-beta.70",
|
|
4
4
|
"description": "",
|
|
5
5
|
"license": "Cisco EULA (https://www.cisco.com/c/en/us/products/end-user-license-agreement.html)",
|
|
6
6
|
"contributors": [
|
|
@@ -32,12 +32,12 @@
|
|
|
32
32
|
"build": "yarn run -T tsc --declaration true --declarationDir ./dist/types"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
|
-
"@webex/plugin-meetings": "3.0.0-beta.
|
|
36
|
-
"@webex/test-helper-chai": "3.0.0-beta.
|
|
37
|
-
"@webex/test-helper-mocha": "3.0.0-beta.
|
|
38
|
-
"@webex/test-helper-mock-webex": "3.0.0-beta.
|
|
39
|
-
"@webex/test-helper-retry": "3.0.0-beta.
|
|
40
|
-
"@webex/test-helper-test-users": "3.0.0-beta.
|
|
35
|
+
"@webex/plugin-meetings": "3.0.0-beta.70",
|
|
36
|
+
"@webex/test-helper-chai": "3.0.0-beta.70",
|
|
37
|
+
"@webex/test-helper-mocha": "3.0.0-beta.70",
|
|
38
|
+
"@webex/test-helper-mock-webex": "3.0.0-beta.70",
|
|
39
|
+
"@webex/test-helper-retry": "3.0.0-beta.70",
|
|
40
|
+
"@webex/test-helper-test-users": "3.0.0-beta.70",
|
|
41
41
|
"chai": "^4.3.4",
|
|
42
42
|
"chai-as-promised": "^7.1.1",
|
|
43
43
|
"jsdom-global": "3.0.2",
|
|
@@ -46,18 +46,18 @@
|
|
|
46
46
|
"typescript": "^4.7.4"
|
|
47
47
|
},
|
|
48
48
|
"dependencies": {
|
|
49
|
-
"@webex/common": "3.0.0-beta.
|
|
49
|
+
"@webex/common": "3.0.0-beta.70",
|
|
50
50
|
"@webex/internal-media-core": "1.35.7",
|
|
51
|
-
"@webex/internal-plugin-conversation": "3.0.0-beta.
|
|
52
|
-
"@webex/internal-plugin-device": "3.0.0-beta.
|
|
53
|
-
"@webex/internal-plugin-llm": "3.0.0-beta.
|
|
54
|
-
"@webex/internal-plugin-mercury": "3.0.0-beta.
|
|
55
|
-
"@webex/internal-plugin-metrics": "3.0.0-beta.
|
|
56
|
-
"@webex/internal-plugin-support": "3.0.0-beta.
|
|
57
|
-
"@webex/internal-plugin-user": "3.0.0-beta.
|
|
58
|
-
"@webex/plugin-people": "3.0.0-beta.
|
|
59
|
-
"@webex/plugin-rooms": "3.0.0-beta.
|
|
60
|
-
"@webex/webex-core": "3.0.0-beta.
|
|
51
|
+
"@webex/internal-plugin-conversation": "3.0.0-beta.70",
|
|
52
|
+
"@webex/internal-plugin-device": "3.0.0-beta.70",
|
|
53
|
+
"@webex/internal-plugin-llm": "3.0.0-beta.70",
|
|
54
|
+
"@webex/internal-plugin-mercury": "3.0.0-beta.70",
|
|
55
|
+
"@webex/internal-plugin-metrics": "3.0.0-beta.70",
|
|
56
|
+
"@webex/internal-plugin-support": "3.0.0-beta.70",
|
|
57
|
+
"@webex/internal-plugin-user": "3.0.0-beta.70",
|
|
58
|
+
"@webex/plugin-people": "3.0.0-beta.70",
|
|
59
|
+
"@webex/plugin-rooms": "3.0.0-beta.70",
|
|
60
|
+
"@webex/webex-core": "3.0.0-beta.70",
|
|
61
61
|
"ampersand-collection": "^2.0.2",
|
|
62
62
|
"bowser": "^2.11.0",
|
|
63
63
|
"btoa": "^1.2.1",
|
package/src/meetings/util.ts
CHANGED
|
@@ -112,11 +112,13 @@ MeetingsUtil.checkForCorrelationId = (deviceUrl, locus) => {
|
|
|
112
112
|
MeetingsUtil.parseDefaultSiteFromMeetingPreferences = (userPreferences) => {
|
|
113
113
|
let result = '';
|
|
114
114
|
|
|
115
|
-
if (userPreferences
|
|
115
|
+
if (userPreferences?.sites?.length) {
|
|
116
116
|
const defaultSite = userPreferences.sites.find((site) => site.default);
|
|
117
117
|
|
|
118
118
|
if (defaultSite) {
|
|
119
119
|
result = defaultSite.siteUrl;
|
|
120
|
+
} else {
|
|
121
|
+
result = userPreferences.sites[0].siteUrl;
|
|
120
122
|
}
|
|
121
123
|
}
|
|
122
124
|
|
|
@@ -33,7 +33,7 @@ describe('plugin-meetings', () => {
|
|
|
33
33
|
);
|
|
34
34
|
});
|
|
35
35
|
|
|
36
|
-
it('should
|
|
36
|
+
it('should take the first site if none are default', () => {
|
|
37
37
|
const userPreferences = {
|
|
38
38
|
sites: [
|
|
39
39
|
{
|
|
@@ -51,7 +51,10 @@ describe('plugin-meetings', () => {
|
|
|
51
51
|
],
|
|
52
52
|
};
|
|
53
53
|
|
|
54
|
-
assert.equal(
|
|
54
|
+
assert.equal(
|
|
55
|
+
MeetingsUtil.parseDefaultSiteFromMeetingPreferences(userPreferences),
|
|
56
|
+
'site1-example.webex.com'
|
|
57
|
+
);
|
|
55
58
|
});
|
|
56
59
|
|
|
57
60
|
it('should work fine if sites an empty array', () => {
|