@webex/plugin-meetings 3.3.1-next.45 → 3.3.1-next.46

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.
@@ -209,7 +209,7 @@ var Breakout = _webexCore.WebexPlugin.extend({
209
209
  sessionId: this.sessionId
210
210
  });
211
211
  },
212
- version: "3.3.1-next.45"
212
+ version: "3.3.1-next.46"
213
213
  });
214
214
  var _default = exports.default = Breakout;
215
215
  //# sourceMappingURL=breakout.js.map
@@ -1046,7 +1046,7 @@ var Breakouts = _webexCore.WebexPlugin.extend({
1046
1046
  this.trigger(_constants.BREAKOUTS.EVENTS.ASK_RETURN_TO_MAIN);
1047
1047
  }
1048
1048
  },
1049
- version: "3.3.1-next.45"
1049
+ version: "3.3.1-next.46"
1050
1050
  });
1051
1051
  var _default = exports.default = Breakouts;
1052
1052
  //# sourceMappingURL=index.js.map
@@ -373,7 +373,7 @@ var SimultaneousInterpretation = _webexCore.WebexPlugin.extend({
373
373
  throw error;
374
374
  });
375
375
  },
376
- version: "3.3.1-next.45"
376
+ version: "3.3.1-next.46"
377
377
  });
378
378
  var _default = exports.default = SimultaneousInterpretation;
379
379
  //# 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.3.1-next.45"
21
+ version: "3.3.1-next.46"
22
22
  });
23
23
  var _default = exports.default = SILanguage;
24
24
  //# sourceMappingURL=siLanguage.js.map
@@ -124,6 +124,18 @@ Media.createMediaConnection = function (isMultistream, debugId, webex, meetingId
124
124
  // we might not have any TURN server if TURN discovery failed or wasn't done or
125
125
  // we might get an empty TURN url if we land on a video mesh node
126
126
  if (turnServerInfo !== null && turnServerInfo !== void 0 && turnServerInfo.url) {
127
+ if (!isBrowser('firefox')) {
128
+ var bareTurnServer = turnServerInfo.url;
129
+ bareTurnServer = bareTurnServer.replace('turns:', 'turn:');
130
+ bareTurnServer = bareTurnServer.replace('443', '5004');
131
+ iceServers.push({
132
+ urls: bareTurnServer,
133
+ username: turnServerInfo.username || '',
134
+ credential: turnServerInfo.password || ''
135
+ });
136
+ }
137
+
138
+ // TURN-TLS server
127
139
  iceServers.push({
128
140
  urls: turnServerInfo.url,
129
141
  username: turnServerInfo.username || '',
@@ -1 +1 @@
1
- {"version":3,"names":["_internalMediaCore","require","_loggerProxy","_interopRequireDefault","_constants","_config","_config2","_browserDetection","_rtcMetrics","ownKeys","e","r","t","_Object$keys","_Object$getOwnPropertySymbols","o","filter","_Object$getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","Object","forEach","_defineProperty2","default","_Object$getOwnPropertyDescriptors","_Object$defineProperties","_Object$defineProperty","_BrowserDetection","BrowserDetection","isBrowser","Media","getLocalMedia","options","config","sendAudio","sendVideo","sendShare","sharePreferences","isSharing","getMedia","getDisplayMedia","_promise","resolve","undefined","getDirection","forceSendRecv","receive","send","createMediaConnection","isMultistream","debugId","webex","meetingId","correlationId","_audioStream$outputSt","_videoStream$outputSt","_shareVideoStream$out","_shareAudioStream$out","mediaProperties","remoteQualityLevel","enableRtx","enableExtmap","turnServerInfo","bundlePolicy","iceServers","url","urls","username","credential","password","rtcMetrics","RtcMetrics","MultistreamRoapMediaConnection","data","addMetrics","closeMetrics","sendMetricsInQueue","Error","mediaDirection","audioStream","videoStream","shareVideoStream","shareAudioStream","RoapMediaConnection","skipInactiveTransceivers","requireH264","sdpMunging","convertPort9to0","addContentSlides","bandwidthLimits","audio","StaticConfig","meetings","bandwidth","video","startBitrate","periodicKeyframes","disableExtmap","disableRtx","localTracks","outputStream","getTracks","screenShareVideo","screenShareAudio","direction","receiveAudio","receiveVideo","receiveShare","customResolution","screenResolution","customShareFrameRate","screenFrameRate","hasSharePreferences","hasCustomConstraints","shareConstraints","hasHighFrameRate","highFrameRate","_Config$meetings","Config","resolution","videoShareFrameRate","aspectRatio","cursor","MEDIA_TRACK_CONSTRAINT","CURSOR","AWLAYS","frameRate","height","idealHeight","width","idealWidth","mediaConfig","navigator","mediaDevices","then","stream","getVideoTracks","applyConstraints","getDisplayMediaParams","defaultWidth","ideal","max","maxWidth","defaultHeight","maxHeight","deviceId","facingMode","fake","process","env","NODE_ENV","getUserMedia","catch","err","logPath","LoggerProxy","logger","error","concat","constraint","toggleStream","stopStream","stop","readyState","mediaSetting","audioVideo","localStream","shareStream","_default","exports"],"sources":["index.ts"],"sourcesContent":["/*!\n * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.\n */\n/* globals navigator */\n\nimport {\n RoapMediaConnection,\n MultistreamRoapMediaConnection,\n type MultistreamConnectionConfig,\n} from '@webex/internal-media-core';\nimport {\n LocalStream,\n LocalCameraStream,\n LocalDisplayStream,\n LocalSystemAudioStream,\n LocalMicrophoneStream,\n} from '@webex/media-helpers';\nimport LoggerProxy from '../common/logs/logger-proxy';\nimport {MEDIA_TRACK_CONSTRAINT} from '../constants';\nimport Config from '../config';\nimport StaticConfig from '../common/config';\nimport BrowserDetection from '../common/browser-detection';\nimport RtcMetrics from '../rtcMetrics';\n\nconst {isBrowser} = BrowserDetection();\n\nexport type BundlePolicy = MultistreamConnectionConfig['bundlePolicy'];\n\n/**\n * MediaDirection\n * @typedef {Object} MediaDirection\n * @property {boolean} sendAudio\n * @property {boolean} receiveAudio\n * @property {boolean} sendVideo\n * @property {boolean} receiveVideo\n * @property {boolean} sendShare\n * @property {boolean} receiveShare\n */\n\n/**\n * SendOptions\n * @typedef {Object} SendOptions\n * @property sendAudio\n * @property sendVideo\n * @property sendShare\n * @property isSharing\n * @property {Object} sharePreferences\n */\n/**\n *\n * @public\n * @export\n * Mimic browser APIs as \"the ultimate browser\".\n * Handles the quirks of each browser.\n * Extends and enhances adapter.js, i.e., the \"media\" file from the web client.\n */\nconst Media: any = {};\n\n/**\n * make a browser call to get the media\n * @param {SendOptions} options\n * @param {Object} config SDK Configuration for meetings plugin\n * @returns {Promise}\n */\nMedia.getLocalMedia = (options: any, config: object) => {\n const {sendAudio, sendVideo, sendShare, sharePreferences, isSharing} = options;\n\n if (sendAudio || sendVideo) {\n return Media.getMedia(sendAudio, sendVideo, config);\n }\n\n if (sendShare && !isSharing) {\n return Media.getDisplayMedia(\n {\n sendAudio: false,\n sendShare: true,\n sharePreferences,\n },\n config\n );\n }\n\n return Promise.resolve(undefined);\n};\n\nMedia.getDirection = (forceSendRecv: boolean, receive: boolean, send: boolean) => {\n if (!receive && !send) {\n return 'inactive';\n }\n\n if (forceSendRecv || (receive && send)) {\n return 'sendrecv';\n }\n\n if (receive) {\n return 'recvonly';\n }\n\n return 'sendonly';\n};\n\n/**\n * creates a webrtc media connection with provided tracks and mediaDirection configuration\n *\n * @param {boolean} isMultistream\n * @param {string} debugId string useful for debugging (will appear in media connection logs)\n * @param {object} webex main `webex` object.\n * @param {string} meetingId id for the meeting using this connection\n * @param {string} correlationId id used in requests to correlate to this session\n * @param {Object} options\n * @param {Object} [options.mediaProperties] contains mediaDirection and local tracks:\n * audioTrack, videoTrack, shareVideoTrack, and shareAudioTrack\n * @param {string} [options.remoteQualityLevel] LOW|MEDIUM|HIGH applicable only to non-multistream connections\n * @param {boolean} [options.enableRtx] applicable only to non-multistream connections\n * @param {boolean} [options.enableExtmap] applicable only to non-multistream connections\n * @param {Object} [options.turnServerInfo]\n * @param {BundlePolicy} [options.bundlePolicy]\n * @returns {RoapMediaConnection | MultistreamRoapMediaConnection}\n */\nMedia.createMediaConnection = (\n isMultistream: boolean,\n debugId: string,\n webex: object,\n meetingId: string,\n correlationId: string,\n options: {\n mediaProperties: {\n mediaDirection?: {\n receiveAudio: boolean;\n receiveVideo: boolean;\n receiveShare: boolean;\n sendAudio: boolean;\n sendVideo: boolean;\n sendShare: boolean;\n };\n audioStream?: LocalMicrophoneStream;\n videoStream?: LocalCameraStream;\n shareVideoStream?: LocalDisplayStream;\n shareAudioStream?: LocalSystemAudioStream;\n };\n remoteQualityLevel?: 'LOW' | 'MEDIUM' | 'HIGH';\n enableRtx?: boolean;\n enableExtmap?: boolean;\n turnServerInfo?: {\n url: string;\n username: string;\n password: string;\n };\n bundlePolicy?: BundlePolicy;\n }\n) => {\n const {\n mediaProperties,\n remoteQualityLevel,\n enableRtx,\n enableExtmap,\n turnServerInfo,\n bundlePolicy,\n } = options;\n\n const iceServers = [];\n\n // we might not have any TURN server if TURN discovery failed or wasn't done or\n // we might get an empty TURN url if we land on a video mesh node\n if (turnServerInfo?.url) {\n iceServers.push({\n urls: turnServerInfo.url,\n username: turnServerInfo.username || '',\n credential: turnServerInfo.password || '',\n });\n }\n\n if (isMultistream) {\n const config: MultistreamConnectionConfig = {\n iceServers,\n };\n\n if (bundlePolicy) {\n config.bundlePolicy = bundlePolicy;\n }\n\n const rtcMetrics = new RtcMetrics(webex, meetingId, correlationId);\n\n return new MultistreamRoapMediaConnection(\n config,\n meetingId,\n /* the rtc metrics objects callbacks */\n (data) => rtcMetrics.addMetrics(data),\n () => rtcMetrics.closeMetrics(),\n () => rtcMetrics.sendMetricsInQueue()\n );\n }\n\n if (!mediaProperties) {\n throw new Error('mediaProperties have to be provided for non-multistream media connections');\n }\n\n const {mediaDirection, audioStream, videoStream, shareVideoStream, shareAudioStream} =\n mediaProperties;\n\n return new RoapMediaConnection(\n {\n iceServers,\n skipInactiveTransceivers: false,\n requireH264: true,\n sdpMunging: {\n convertPort9to0: false,\n addContentSlides: true,\n bandwidthLimits: {\n audio: StaticConfig.meetings.bandwidth.audio,\n video: StaticConfig.meetings.bandwidth.video,\n },\n startBitrate: StaticConfig.meetings.bandwidth.startBitrate,\n periodicKeyframes: 20, // it's always been hardcoded in SDK so for now keeping it that way\n disableExtmap: !enableExtmap,\n disableRtx: !enableRtx, // see https://bugs.chromium.org/p/chromium/issues/detail?id=1020642 why we might want to remove RTX from SDP\n },\n },\n {\n // TODO: RoapMediaConnection is not ready to use stream classes yet, so we pass the raw MediaStreamTrack for now SPARK-460530\n localTracks: {\n audio: audioStream?.outputStream?.getTracks()[0],\n video: videoStream?.outputStream?.getTracks()[0],\n screenShareVideo: shareVideoStream?.outputStream?.getTracks()[0],\n screenShareAudio: shareAudioStream?.outputStream?.getTracks()[0], // TODO: add type for screenShareAudio in internal-media-core SPARK-446923\n } as unknown,\n direction: {\n audio: Media.getDirection(true, mediaDirection.receiveAudio, mediaDirection.sendAudio),\n video: Media.getDirection(true, mediaDirection.receiveVideo, mediaDirection.sendVideo),\n screenShareVideo: Media.getDirection(\n false,\n mediaDirection.receiveShare,\n mediaDirection.sendShare\n ),\n },\n remoteQualityLevel,\n },\n debugId\n );\n};\n\n/**\n * generates share streams\n * @param {Object} options parameter\n * @param {Boolean} options.sendAudio send audio from the display share\n * @param {Boolean} options.sendShare send video from the display share\n * @param {Object} options.sharePreferences\n * @param {MediaTrackConstraints} options.sharePreferences.shareConstraints constraints to apply to video\n * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/MediaTrackConstraints}\n * @param {Boolean} options.sharePreferences.highFrameRate if shareConstraints isn't provided, set default values based off of this boolean\n * @param {Object} config SDK Configuration for meetings plugin\n * @returns {Promise.<MediaStream>}\n */\nMedia.getDisplayMedia = (\n options: {\n sendAudio: boolean;\n sendShare: boolean;\n sharePreferences: {\n shareConstraints: MediaTrackConstraints;\n highFrameRate: any;\n };\n },\n config: any = {}\n) => {\n // SDK screen share resolution settings from Webex.init\n const customResolution = config.screenResolution || {};\n // user defined screen share frame rate\n const customShareFrameRate = config.screenFrameRate || null;\n // user defined share preferences\n const hasSharePreferences = options.sharePreferences;\n const hasCustomConstraints = hasSharePreferences && hasSharePreferences.shareConstraints;\n const hasHighFrameRate = hasSharePreferences && hasSharePreferences.highFrameRate;\n const {screenResolution, resolution, videoShareFrameRate, screenFrameRate, aspectRatio} =\n Config.meetings;\n\n let shareConstraints: any = {\n cursor: MEDIA_TRACK_CONSTRAINT.CURSOR.AWLAYS,\n aspectRatio,\n };\n\n if (hasCustomConstraints) {\n shareConstraints = hasSharePreferences.shareConstraints;\n } else if (hasHighFrameRate) {\n shareConstraints = {\n ...shareConstraints,\n frameRate: videoShareFrameRate,\n height: resolution.idealHeight,\n width: resolution.idealWidth,\n ...config.resolution,\n };\n } else {\n shareConstraints = {\n ...shareConstraints,\n frameRate: customShareFrameRate || screenFrameRate,\n height: customResolution.idealHeight || screenResolution.idealHeight,\n width: customResolution.idealWidth || screenResolution.idealWidth,\n ...config.screenResolution,\n };\n }\n\n // chrome and webkit based browsers (edge, safari) automatically adjust everything\n // and we have noticed higher quality with those browser types\n // firefox specifically has some issues with resolution and frame rate decision making\n // so we are making it optional and configurable (with defaults) for firefox\n // to have higher quality, and for developers to control the values\n // eventually we may have to add the same functionality to chrome, OR conversely, get to with firefox\n\n if (isBrowser('firefox')) {\n const mediaConfig: any = {\n audio: options.sendAudio,\n video: options.sendShare,\n };\n\n return navigator.mediaDevices\n .getDisplayMedia({audio: options.sendAudio, video: mediaConfig})\n .then((stream) => {\n if (options.sendShare && stream.getVideoTracks().length > 0) {\n // Firefox has a bug with the spec where changing in the height and width only happens\n // after we get the inital tracks\n // https://bugzilla.mozilla.org/show_bug.cgi?id=1321221\n stream.getVideoTracks()[0].applyConstraints(shareConstraints);\n }\n\n return stream;\n });\n }\n\n const getDisplayMediaParams: any = {video: options.sendShare ? shareConstraints : false};\n\n // safari doesn't support sending screen share audio\n // https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getDisplayMedia\n if (options.sendAudio && isBrowser('safari')) {\n getDisplayMediaParams.audio = options.sendAudio;\n }\n\n return navigator.mediaDevices.getDisplayMedia(getDisplayMediaParams);\n};\n\n/**\n * generates audio and video using constraints (often called after getSupportedDevices)\n * @param {Object|Boolean} audio gum constraints\n * @param {Object|Boolean} video gum constraints\n * @param {Object} config SDK Configuration for meetings plugin\n * @returns {Object} {streams}\n */\nMedia.getMedia = (audio: any | boolean, video: any | boolean, config: any) => {\n const defaultWidth = {ideal: config.resolution.idealWidth, max: config.resolution.maxWidth};\n const defaultHeight = {ideal: config.resolution.idealHeight, max: config.resolution.maxHeight};\n const mediaConfig = {\n audio,\n // TODO: Remove temporary workaround once Firefox fixes low constraint issues\n // eslint-disable-next-line no-nested-ternary\n video: video\n ? isBrowser('firefox') && video.width && video.width.max === 320\n ? {\n deviceId: video.deviceId ? video.deviceId : undefined,\n width: 320,\n height: 180,\n frameRate: video.frameRate ? video.frameRate : undefined,\n facingMode: video.facingMode ? video.facingMode : undefined,\n }\n : {\n deviceId: video.deviceId ? video.deviceId : undefined,\n width: video.width ? video.width : defaultWidth,\n height: video.height ? video.height : defaultHeight,\n frameRate: video.frameRate ? video.frameRate : undefined,\n facingMode: video.facingMode ? video.facingMode : undefined,\n }\n : false,\n fake: process.env.NODE_ENV === 'test', // Special case to get fake media for Firefox browser for testing\n };\n\n return navigator.mediaDevices.getUserMedia(mediaConfig).catch((err) => {\n const logPath = 'Media:index#getMedia --> navigator.mediaDevices.getUserMedia';\n\n LoggerProxy.logger.error(`${logPath} failed - ${err} (${err.constraint})`);\n throw err;\n });\n};\n\n/**\n *\n * Toggle a specific stream\n * noop as of now, does nothing\n * @returns {null}\n */\nMedia.toggleStream = () => {};\n\n/**\n * Stop input stream\n * @param {LocalStream} stream A local stream\n * @returns {null}\n */\nMedia.stopStream = (stream: LocalStream) => {\n if (!stream) {\n return Promise.resolve();\n }\n\n return Promise.resolve().then(() => {\n try {\n stream.stop();\n } catch (e) {\n LoggerProxy.logger.error(\n `Media:index#stopStream --> Unable to stop the stream with ready state => ${stream.readyState}, error: ${e}`\n );\n }\n });\n};\n\n/**\n * generates streams for audio video and share\n * @param {object} mediaSetting parameter\n * @param {Object} mediaSetting.sendAudio sendAudio: {Boolean} sendAudio constraints\n * @param {Object} mediaSetting.sendVideo sendVideo: {Boolean} sendVideo constraints\n * @param {Object} mediaSetting.sendShare sendShare: {Boolean} sendShare constraints\n * @param {Object} mediaSetting.isSharing isSharing: {Boolean} isSharing constraints\n * @param {Object} audioVideo parameter\n * @param {Object} audioVideo.audio {deviceId: {String}}\n * @param {Object} audioVideo.video {deviceId: {String}}\n * @param {Object} sharePreferences parameter\n * @param {Object} sharePreferences.shareConstraints parameter\n * @param {Boolean} sharePreferences.highFrameRate parameter\n * @param {Object} config SDK Config\n * @returns {Array} [localStream, shareStream]\n */\nMedia.getUserMedia = (\n mediaSetting: {\n sendAudio: object;\n sendVideo: object;\n sendShare: object;\n isSharing: object;\n },\n audioVideo: {\n audio: object;\n video: object;\n },\n sharePreferences: {\n shareConstraints: object;\n highFrameRate: boolean;\n },\n config: object\n) =>\n Media.getLocalMedia(\n {\n sendAudio: mediaSetting.sendAudio ? audioVideo.audio || mediaSetting.sendAudio : false,\n sendVideo: mediaSetting.sendVideo ? audioVideo.video || mediaSetting.sendVideo : false,\n },\n config\n ).then((localStream) =>\n Media.getLocalMedia(\n {\n sendShare: mediaSetting.sendShare,\n isSharing: mediaSetting.isSharing,\n sharePreferences,\n },\n config\n ).then((shareStream) => [localStream, shareStream])\n );\n\nexport default Media;\n"],"mappings":";;;;;;;;;;;;;;;AAKA,IAAAA,kBAAA,GAAAC,OAAA;AAYA,IAAAC,YAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,UAAA,GAAAH,OAAA;AACA,IAAAI,OAAA,GAAAF,sBAAA,CAAAF,OAAA;AACA,IAAAK,QAAA,GAAAH,sBAAA,CAAAF,OAAA;AACA,IAAAM,iBAAA,GAAAJ,sBAAA,CAAAF,OAAA;AACA,IAAAO,WAAA,GAAAL,sBAAA,CAAAF,OAAA;AAAuC,SAAAQ,QAAAC,CAAA,EAAAC,CAAA,QAAAC,CAAA,GAAAC,YAAA,CAAAH,CAAA,OAAAI,6BAAA,QAAAC,CAAA,GAAAD,6BAAA,CAAAJ,CAAA,GAAAC,CAAA,KAAAI,CAAA,GAAAA,CAAA,CAAAC,MAAA,WAAAL,CAAA,WAAAM,gCAAA,CAAAP,CAAA,EAAAC,CAAA,EAAAO,UAAA,OAAAN,CAAA,CAAAO,IAAA,CAAAC,KAAA,CAAAR,CAAA,EAAAG,CA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AI;MACFC,MAAM,CAAC2B,IAAI,CAAC,CAAC;IACf,CAAC,CAAC,OAAO5J,CAAC,EAAE;MACVqJ,oBAAW,CAACC,MAAM,CAACC,KAAK,6EAAAC,MAAA,CACsDvB,MAAM,CAAC4B,UAAU,eAAAL,MAAA,CAAYxJ,CAAC,CAC5G,CAAC;IACH;EACF,CAAC,CAAC;AACJ,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACAwB,KAAK,CAACyH,YAAY,GAAG,UACnBa,YAKC,EACDC,UAGC,EACDhI,gBAGC,EACDJ,MAAc;EAAA,OAEdH,KAAK,CAACC,aAAa,CACjB;IACEG,SAAS,EAAEkI,YAAY,CAAClI,SAAS,GAAGmI,UAAU,CAAC3E,KAAK,IAAI0E,YAAY,CAAClI,SAAS,GAAG,KAAK;IACtFC,SAAS,EAAEiI,YAAY,CAACjI,SAAS,GAAGkI,UAAU,CAACvE,KAAK,IAAIsE,YAAY,CAACjI,SAAS,GAAG;EACnF,CAAC,EACDF,MACF,CAAC,CAACqG,IAAI,CAAC,UAACgC,WAAW;IAAA,OACjBxI,KAAK,CAACC,aAAa,CACjB;MACEK,SAAS,EAAEgI,YAAY,CAAChI,SAAS;MACjCE,SAAS,EAAE8H,YAAY,CAAC9H,SAAS;MACjCD,gBAAgB,EAAhBA;IACF,CAAC,EACDJ,MACF,CAAC,CAACqG,IAAI,CAAC,UAACiC,WAAW;MAAA,OAAK,CAACD,WAAW,EAAEC,WAAW,CAAC;IAAA,EAAC;EAAA,CACrD,CAAC;AAAA;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAlJ,OAAA,GAEWO,KAAK"}
1
+ {"version":3,"names":["_internalMediaCore","require","_loggerProxy","_interopRequireDefault","_constants","_config","_config2","_browserDetection","_rtcMetrics","ownKeys","e","r","t","_Object$keys","_Object$getOwnPropertySymbols","o","filter","_Object$getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","Object","forEach","_defineProperty2","default","_Object$getOwnPropertyDescriptors","_Object$defineProperties","_Object$defineProperty","_BrowserDetection","BrowserDetection","isBrowser","Media","getLocalMedia","options","config","sendAudio","sendVideo","sendShare","sharePreferences","isSharing","getMedia","getDisplayMedia","_promise","resolve","undefined","getDirection","forceSendRecv","receive","send","createMediaConnection","isMultistream","debugId","webex","meetingId","correlationId","_audioStream$outputSt","_videoStream$outputSt","_shareVideoStream$out","_shareAudioStream$out","mediaProperties","remoteQualityLevel","enableRtx","enableExtmap","turnServerInfo","bundlePolicy","iceServers","url","bareTurnServer","replace","urls","username","credential","password","rtcMetrics","RtcMetrics","MultistreamRoapMediaConnection","data","addMetrics","closeMetrics","sendMetricsInQueue","Error","mediaDirection","audioStream","videoStream","shareVideoStream","shareAudioStream","RoapMediaConnection","skipInactiveTransceivers","requireH264","sdpMunging","convertPort9to0","addContentSlides","bandwidthLimits","audio","StaticConfig","meetings","bandwidth","video","startBitrate","periodicKeyframes","disableExtmap","disableRtx","localTracks","outputStream","getTracks","screenShareVideo","screenShareAudio","direction","receiveAudio","receiveVideo","receiveShare","customResolution","screenResolution","customShareFrameRate","screenFrameRate","hasSharePreferences","hasCustomConstraints","shareConstraints","hasHighFrameRate","highFrameRate","_Config$meetings","Config","resolution","videoShareFrameRate","aspectRatio","cursor","MEDIA_TRACK_CONSTRAINT","CURSOR","AWLAYS","frameRate","height","idealHeight","width","idealWidth","mediaConfig","navigator","mediaDevices","then","stream","getVideoTracks","applyConstraints","getDisplayMediaParams","defaultWidth","ideal","max","maxWidth","defaultHeight","maxHeight","deviceId","facingMode","fake","process","env","NODE_ENV","getUserMedia","catch","err","logPath","LoggerProxy","logger","error","concat","constraint","toggleStream","stopStream","stop","readyState","mediaSetting","audioVideo","localStream","shareStream","_default","exports"],"sources":["index.ts"],"sourcesContent":["/*!\n * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.\n */\n/* globals navigator */\n\nimport {\n RoapMediaConnection,\n MultistreamRoapMediaConnection,\n type MultistreamConnectionConfig,\n} from '@webex/internal-media-core';\nimport {\n LocalStream,\n LocalCameraStream,\n LocalDisplayStream,\n LocalSystemAudioStream,\n LocalMicrophoneStream,\n} from '@webex/media-helpers';\nimport LoggerProxy from '../common/logs/logger-proxy';\nimport {MEDIA_TRACK_CONSTRAINT} from '../constants';\nimport Config from '../config';\nimport StaticConfig from '../common/config';\nimport BrowserDetection from '../common/browser-detection';\nimport RtcMetrics from '../rtcMetrics';\n\nconst {isBrowser} = BrowserDetection();\n\nexport type BundlePolicy = MultistreamConnectionConfig['bundlePolicy'];\n\n/**\n * MediaDirection\n * @typedef {Object} MediaDirection\n * @property {boolean} sendAudio\n * @property {boolean} receiveAudio\n * @property {boolean} sendVideo\n * @property {boolean} receiveVideo\n * @property {boolean} sendShare\n * @property {boolean} receiveShare\n */\n\n/**\n * SendOptions\n * @typedef {Object} SendOptions\n * @property sendAudio\n * @property sendVideo\n * @property sendShare\n * @property isSharing\n * @property {Object} sharePreferences\n */\n/**\n *\n * @public\n * @export\n * Mimic browser APIs as \"the ultimate browser\".\n * Handles the quirks of each browser.\n * Extends and enhances adapter.js, i.e., the \"media\" file from the web client.\n */\nconst Media: any = {};\n\n/**\n * make a browser call to get the media\n * @param {SendOptions} options\n * @param {Object} config SDK Configuration for meetings plugin\n * @returns {Promise}\n */\nMedia.getLocalMedia = (options: any, config: object) => {\n const {sendAudio, sendVideo, sendShare, sharePreferences, isSharing} = options;\n\n if (sendAudio || sendVideo) {\n return Media.getMedia(sendAudio, sendVideo, config);\n }\n\n if (sendShare && !isSharing) {\n return Media.getDisplayMedia(\n {\n sendAudio: false,\n sendShare: true,\n sharePreferences,\n },\n config\n );\n }\n\n return Promise.resolve(undefined);\n};\n\nMedia.getDirection = (forceSendRecv: boolean, receive: boolean, send: boolean) => {\n if (!receive && !send) {\n return 'inactive';\n }\n\n if (forceSendRecv || (receive && send)) {\n return 'sendrecv';\n }\n\n if (receive) {\n return 'recvonly';\n }\n\n return 'sendonly';\n};\n\n/**\n * creates a webrtc media connection with provided tracks and mediaDirection configuration\n *\n * @param {boolean} isMultistream\n * @param {string} debugId string useful for debugging (will appear in media connection logs)\n * @param {object} webex main `webex` object.\n * @param {string} meetingId id for the meeting using this connection\n * @param {string} correlationId id used in requests to correlate to this session\n * @param {Object} options\n * @param {Object} [options.mediaProperties] contains mediaDirection and local tracks:\n * audioTrack, videoTrack, shareVideoTrack, and shareAudioTrack\n * @param {string} [options.remoteQualityLevel] LOW|MEDIUM|HIGH applicable only to non-multistream connections\n * @param {boolean} [options.enableRtx] applicable only to non-multistream connections\n * @param {boolean} [options.enableExtmap] applicable only to non-multistream connections\n * @param {Object} [options.turnServerInfo]\n * @param {BundlePolicy} [options.bundlePolicy]\n * @returns {RoapMediaConnection | MultistreamRoapMediaConnection}\n */\nMedia.createMediaConnection = (\n isMultistream: boolean,\n debugId: string,\n webex: object,\n meetingId: string,\n correlationId: string,\n options: {\n mediaProperties: {\n mediaDirection?: {\n receiveAudio: boolean;\n receiveVideo: boolean;\n receiveShare: boolean;\n sendAudio: boolean;\n sendVideo: boolean;\n sendShare: boolean;\n };\n audioStream?: LocalMicrophoneStream;\n videoStream?: LocalCameraStream;\n shareVideoStream?: LocalDisplayStream;\n shareAudioStream?: LocalSystemAudioStream;\n };\n remoteQualityLevel?: 'LOW' | 'MEDIUM' | 'HIGH';\n enableRtx?: boolean;\n enableExtmap?: boolean;\n turnServerInfo?: {\n url: string;\n username: string;\n password: string;\n };\n bundlePolicy?: BundlePolicy;\n }\n) => {\n const {\n mediaProperties,\n remoteQualityLevel,\n enableRtx,\n enableExtmap,\n turnServerInfo,\n bundlePolicy,\n } = options;\n\n const iceServers = [];\n\n // we might not have any TURN server if TURN discovery failed or wasn't done or\n // we might get an empty TURN url if we land on a video mesh node\n if (turnServerInfo?.url) {\n if (!isBrowser('firefox')) {\n let bareTurnServer = turnServerInfo.url;\n bareTurnServer = bareTurnServer.replace('turns:', 'turn:');\n bareTurnServer = bareTurnServer.replace('443', '5004');\n\n iceServers.push({\n urls: bareTurnServer,\n username: turnServerInfo.username || '',\n credential: turnServerInfo.password || '',\n });\n }\n\n // TURN-TLS server\n iceServers.push({\n urls: turnServerInfo.url,\n username: turnServerInfo.username || '',\n credential: turnServerInfo.password || '',\n });\n }\n\n if (isMultistream) {\n const config: MultistreamConnectionConfig = {\n iceServers,\n };\n\n if (bundlePolicy) {\n config.bundlePolicy = bundlePolicy;\n }\n\n const rtcMetrics = new RtcMetrics(webex, meetingId, correlationId);\n\n return new MultistreamRoapMediaConnection(\n config,\n meetingId,\n /* the rtc metrics objects callbacks */\n (data) => rtcMetrics.addMetrics(data),\n () => rtcMetrics.closeMetrics(),\n () => rtcMetrics.sendMetricsInQueue()\n );\n }\n\n if (!mediaProperties) {\n throw new Error('mediaProperties have to be provided for non-multistream media connections');\n }\n\n const {mediaDirection, audioStream, videoStream, shareVideoStream, shareAudioStream} =\n mediaProperties;\n\n return new RoapMediaConnection(\n {\n iceServers,\n skipInactiveTransceivers: false,\n requireH264: true,\n sdpMunging: {\n convertPort9to0: false,\n addContentSlides: true,\n bandwidthLimits: {\n audio: StaticConfig.meetings.bandwidth.audio,\n video: StaticConfig.meetings.bandwidth.video,\n },\n startBitrate: StaticConfig.meetings.bandwidth.startBitrate,\n periodicKeyframes: 20, // it's always been hardcoded in SDK so for now keeping it that way\n disableExtmap: !enableExtmap,\n disableRtx: !enableRtx, // see https://bugs.chromium.org/p/chromium/issues/detail?id=1020642 why we might want to remove RTX from SDP\n },\n },\n {\n // TODO: RoapMediaConnection is not ready to use stream classes yet, so we pass the raw MediaStreamTrack for now SPARK-460530\n localTracks: {\n audio: audioStream?.outputStream?.getTracks()[0],\n video: videoStream?.outputStream?.getTracks()[0],\n screenShareVideo: shareVideoStream?.outputStream?.getTracks()[0],\n screenShareAudio: shareAudioStream?.outputStream?.getTracks()[0], // TODO: add type for screenShareAudio in internal-media-core SPARK-446923\n } as unknown,\n direction: {\n audio: Media.getDirection(true, mediaDirection.receiveAudio, mediaDirection.sendAudio),\n video: Media.getDirection(true, mediaDirection.receiveVideo, mediaDirection.sendVideo),\n screenShareVideo: Media.getDirection(\n false,\n mediaDirection.receiveShare,\n mediaDirection.sendShare\n ),\n },\n remoteQualityLevel,\n },\n debugId\n );\n};\n\n/**\n * generates share streams\n * @param {Object} options parameter\n * @param {Boolean} options.sendAudio send audio from the display share\n * @param {Boolean} options.sendShare send video from the display share\n * @param {Object} options.sharePreferences\n * @param {MediaTrackConstraints} options.sharePreferences.shareConstraints constraints to apply to video\n * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/MediaTrackConstraints}\n * @param {Boolean} options.sharePreferences.highFrameRate if shareConstraints isn't provided, set default values based off of this boolean\n * @param {Object} config SDK Configuration for meetings plugin\n * @returns {Promise.<MediaStream>}\n */\nMedia.getDisplayMedia = (\n options: {\n sendAudio: boolean;\n sendShare: boolean;\n sharePreferences: {\n shareConstraints: MediaTrackConstraints;\n highFrameRate: any;\n };\n },\n config: any = {}\n) => {\n // SDK screen share resolution settings from Webex.init\n const customResolution = config.screenResolution || {};\n // user defined screen share frame rate\n const customShareFrameRate = config.screenFrameRate || null;\n // user defined share preferences\n const hasSharePreferences = options.sharePreferences;\n const hasCustomConstraints = hasSharePreferences && hasSharePreferences.shareConstraints;\n const hasHighFrameRate = hasSharePreferences && hasSharePreferences.highFrameRate;\n const {screenResolution, resolution, videoShareFrameRate, screenFrameRate, aspectRatio} =\n Config.meetings;\n\n let shareConstraints: any = {\n cursor: MEDIA_TRACK_CONSTRAINT.CURSOR.AWLAYS,\n aspectRatio,\n };\n\n if (hasCustomConstraints) {\n shareConstraints = hasSharePreferences.shareConstraints;\n } else if (hasHighFrameRate) {\n shareConstraints = {\n ...shareConstraints,\n frameRate: videoShareFrameRate,\n height: resolution.idealHeight,\n width: resolution.idealWidth,\n ...config.resolution,\n };\n } else {\n shareConstraints = {\n ...shareConstraints,\n frameRate: customShareFrameRate || screenFrameRate,\n height: customResolution.idealHeight || screenResolution.idealHeight,\n width: customResolution.idealWidth || screenResolution.idealWidth,\n ...config.screenResolution,\n };\n }\n\n // chrome and webkit based browsers (edge, safari) automatically adjust everything\n // and we have noticed higher quality with those browser types\n // firefox specifically has some issues with resolution and frame rate decision making\n // so we are making it optional and configurable (with defaults) for firefox\n // to have higher quality, and for developers to control the values\n // eventually we may have to add the same functionality to chrome, OR conversely, get to with firefox\n\n if (isBrowser('firefox')) {\n const mediaConfig: any = {\n audio: options.sendAudio,\n video: options.sendShare,\n };\n\n return navigator.mediaDevices\n .getDisplayMedia({audio: options.sendAudio, video: mediaConfig})\n .then((stream) => {\n if (options.sendShare && stream.getVideoTracks().length > 0) {\n // Firefox has a bug with the spec where changing in the height and width only happens\n // after we get the inital tracks\n // https://bugzilla.mozilla.org/show_bug.cgi?id=1321221\n stream.getVideoTracks()[0].applyConstraints(shareConstraints);\n }\n\n return stream;\n });\n }\n\n const getDisplayMediaParams: any = {video: options.sendShare ? shareConstraints : false};\n\n // safari doesn't support sending screen share audio\n // https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getDisplayMedia\n if (options.sendAudio && isBrowser('safari')) {\n getDisplayMediaParams.audio = options.sendAudio;\n }\n\n return navigator.mediaDevices.getDisplayMedia(getDisplayMediaParams);\n};\n\n/**\n * generates audio and video using constraints (often called after getSupportedDevices)\n * @param {Object|Boolean} audio gum constraints\n * @param {Object|Boolean} video gum constraints\n * @param {Object} config SDK Configuration for meetings plugin\n * @returns {Object} {streams}\n */\nMedia.getMedia = (audio: any | boolean, video: any | boolean, config: any) => {\n const defaultWidth = {ideal: config.resolution.idealWidth, max: config.resolution.maxWidth};\n const defaultHeight = {ideal: config.resolution.idealHeight, max: config.resolution.maxHeight};\n const mediaConfig = {\n audio,\n // TODO: Remove temporary workaround once Firefox fixes low constraint issues\n // eslint-disable-next-line no-nested-ternary\n video: video\n ? isBrowser('firefox') && video.width && video.width.max === 320\n ? {\n deviceId: video.deviceId ? video.deviceId : undefined,\n width: 320,\n height: 180,\n frameRate: video.frameRate ? video.frameRate : undefined,\n facingMode: video.facingMode ? video.facingMode : undefined,\n }\n : {\n deviceId: video.deviceId ? video.deviceId : undefined,\n width: video.width ? video.width : defaultWidth,\n height: video.height ? video.height : defaultHeight,\n frameRate: video.frameRate ? video.frameRate : undefined,\n facingMode: video.facingMode ? video.facingMode : undefined,\n }\n : false,\n fake: process.env.NODE_ENV === 'test', // Special case to get fake media for Firefox browser for testing\n };\n\n return navigator.mediaDevices.getUserMedia(mediaConfig).catch((err) => {\n const logPath = 'Media:index#getMedia --> navigator.mediaDevices.getUserMedia';\n\n LoggerProxy.logger.error(`${logPath} failed - ${err} (${err.constraint})`);\n throw err;\n });\n};\n\n/**\n *\n * Toggle a specific stream\n * noop as of now, does nothing\n * @returns {null}\n */\nMedia.toggleStream = () => {};\n\n/**\n * Stop input stream\n * @param {LocalStream} stream A local stream\n * @returns {null}\n */\nMedia.stopStream = (stream: LocalStream) => {\n if (!stream) {\n return Promise.resolve();\n }\n\n return Promise.resolve().then(() => {\n try {\n stream.stop();\n } catch (e) {\n LoggerProxy.logger.error(\n `Media:index#stopStream --> Unable to stop the stream with ready state => ${stream.readyState}, error: ${e}`\n );\n }\n });\n};\n\n/**\n * generates streams for audio video and share\n * @param {object} mediaSetting parameter\n * @param {Object} mediaSetting.sendAudio sendAudio: {Boolean} sendAudio constraints\n * @param {Object} mediaSetting.sendVideo sendVideo: {Boolean} sendVideo constraints\n * @param {Object} mediaSetting.sendShare sendShare: {Boolean} sendShare constraints\n * @param {Object} mediaSetting.isSharing isSharing: {Boolean} isSharing constraints\n * @param {Object} audioVideo parameter\n * @param {Object} audioVideo.audio {deviceId: {String}}\n * @param {Object} audioVideo.video {deviceId: {String}}\n * @param {Object} sharePreferences parameter\n * @param {Object} sharePreferences.shareConstraints parameter\n * @param {Boolean} sharePreferences.highFrameRate parameter\n * @param {Object} config SDK Config\n * @returns {Array} [localStream, shareStream]\n */\nMedia.getUserMedia = (\n mediaSetting: {\n sendAudio: object;\n sendVideo: object;\n sendShare: object;\n isSharing: object;\n },\n audioVideo: {\n audio: object;\n video: object;\n },\n sharePreferences: {\n shareConstraints: object;\n highFrameRate: boolean;\n },\n config: object\n) =>\n Media.getLocalMedia(\n {\n sendAudio: mediaSetting.sendAudio ? audioVideo.audio || mediaSetting.sendAudio : false,\n sendVideo: mediaSetting.sendVideo ? audioVideo.video || mediaSetting.sendVideo : false,\n },\n config\n ).then((localStream) =>\n Media.getLocalMedia(\n {\n sendShare: mediaSetting.sendShare,\n isSharing: mediaSetting.isSharing,\n sharePreferences,\n },\n config\n ).then((shareStream) => [localStream, shareStream])\n );\n\nexport default Media;\n"],"mappings":";;;;;;;;;;;;;;;AAKA,IAAAA,kBAAA,GAAAC,OAAA;AAYA,IAAAC,YAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,UAAA,GAAAH,OAAA;AACA,IAAAI,OAAA,GAAAF,sBAAA,CAAAF,OAAA;AACA,IAAAK,QAAA,GAAAH,sBAAA,CAAAF,OAAA;AACA,IAAAM,iBAAA,GAAAJ,sBAAA,CAAAF,OAAA;AACA,IAAAO,WAAA,GAAAL,sBAAA,CAAAF,OAAA;AAAuC,SAAAQ,QAAAC,CAAA,EAAAC,CAAA,QAAAC,CAAA,GAAAC,YAAA,CAAAH,CAAA,OAAAI,6BAAA,QAAAC,CAAA,GAAAD,6BAAA,CAAAJ,CAAA,GAAAC,CAAA,KAAAI,CAAA,GAAAA,CAAA,CAAAC,MAAA,WAAAL,CAAA,WAAAM,gCAAA,CAAAP,CAAA,EAAAC,CAAA,EAAAO,UAAA,OAAAN,CAAA,CAAAO,IAAA,CAAAC,KAAA,CAAAR,CAAA,EAAAG,CAAA,YAAAH,CAAA;AAAA,SAAAS,cAAAX,CAAA,aAAAC,CAAA,MAAAA,CAAA,GAAAW,SAAA,CAAAC,MAAA,EAAAZ,CAAA,UAAAC,CAAA,WAAAU,SAAA,CAAAX,CAAA,IAAAW,SAAA,CAAAX,CAAA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C;AAAA;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAApJ,OAAA,GAEWO,KAAK"}
@@ -62,7 +62,7 @@ var Webinar = _webexCore.WebexPlugin.extend({
62
62
  updateCanManageWebcast: function updateCanManageWebcast(canManageWebcast) {
63
63
  this.set('canManageWebcast', canManageWebcast);
64
64
  },
65
- version: "3.3.1-next.45"
65
+ version: "3.3.1-next.46"
66
66
  });
67
67
  var _default = exports.default = Webinar;
68
68
  //# sourceMappingURL=index.js.map
package/package.json CHANGED
@@ -43,7 +43,7 @@
43
43
  "@webex/eslint-config-legacy": "0.0.0",
44
44
  "@webex/jest-config-legacy": "0.0.0",
45
45
  "@webex/legacy-tools": "0.0.0",
46
- "@webex/plugin-meetings": "3.3.1-next.45",
46
+ "@webex/plugin-meetings": "3.3.1-next.46",
47
47
  "@webex/plugin-rooms": "3.3.1-next.13",
48
48
  "@webex/test-helper-chai": "3.3.1-next.12",
49
49
  "@webex/test-helper-mocha": "3.3.1-next.12",
@@ -70,7 +70,7 @@
70
70
  "@webex/internal-plugin-metrics": "3.3.1-next.12",
71
71
  "@webex/internal-plugin-support": "3.3.1-next.13",
72
72
  "@webex/internal-plugin-user": "3.3.1-next.12",
73
- "@webex/internal-plugin-voicea": "3.3.1-next.45",
73
+ "@webex/internal-plugin-voicea": "3.3.1-next.46",
74
74
  "@webex/media-helpers": "3.3.1-next.22",
75
75
  "@webex/plugin-people": "3.3.1-next.13",
76
76
  "@webex/plugin-rooms": "3.3.1-next.13",
@@ -91,5 +91,5 @@
91
91
  "//": [
92
92
  "TODO: upgrade jwt-decode when moving to node 18"
93
93
  ],
94
- "version": "3.3.1-next.45"
94
+ "version": "3.3.1-next.46"
95
95
  }
@@ -163,6 +163,19 @@ Media.createMediaConnection = (
163
163
  // we might not have any TURN server if TURN discovery failed or wasn't done or
164
164
  // we might get an empty TURN url if we land on a video mesh node
165
165
  if (turnServerInfo?.url) {
166
+ if (!isBrowser('firefox')) {
167
+ let bareTurnServer = turnServerInfo.url;
168
+ bareTurnServer = bareTurnServer.replace('turns:', 'turn:');
169
+ bareTurnServer = bareTurnServer.replace('443', '5004');
170
+
171
+ iceServers.push({
172
+ urls: bareTurnServer,
173
+ username: turnServerInfo.username || '',
174
+ credential: turnServerInfo.password || '',
175
+ });
176
+ }
177
+
178
+ // TURN-TLS server
166
179
  iceServers.push({
167
180
  urls: turnServerInfo.url,
168
181
  username: turnServerInfo.username || '',
@@ -16,39 +16,39 @@ describe('createMediaConnection', () => {
16
16
  id: 'roap media connection',
17
17
  };
18
18
  const fakeTrack = {
19
- id: 'any fake track'
20
- }
19
+ id: 'any fake track',
20
+ };
21
21
  const fakeAudioStream = {
22
22
  outputStream: {
23
23
  getTracks: () => {
24
24
  return [fakeTrack];
25
- }
26
- }
25
+ },
26
+ },
27
27
  };
28
28
  const fakeVideoStream = {
29
29
  outputStream: {
30
30
  getTracks: () => {
31
31
  return [fakeTrack];
32
- }
33
- }
32
+ },
33
+ },
34
34
  };
35
35
  const fakeShareVideoStream = {
36
36
  outputStream: {
37
37
  getTracks: () => {
38
38
  return [fakeTrack];
39
- }
40
- }
39
+ },
40
+ },
41
41
  };
42
42
  const fakeShareAudioStream = {
43
43
  outputStream: {
44
44
  getTracks: () => {
45
45
  return [fakeTrack];
46
- }
47
- }
46
+ },
47
+ },
48
48
  };
49
49
  afterEach(() => {
50
50
  sinon.restore();
51
- clock.uninstall()
51
+ clock.uninstall();
52
52
  });
53
53
 
54
54
  it('creates a RoapMediaConnection when multistream is disabled', () => {
@@ -80,7 +80,7 @@ describe('createMediaConnection', () => {
80
80
  enableRtx: ENABLE_RTX,
81
81
  enableExtmap: ENABLE_EXTMAP,
82
82
  turnServerInfo: {
83
- url: 'turn server url',
83
+ url: 'turns:turn-server-url:443?transport=tcp',
84
84
  username: 'turn username',
85
85
  password: 'turn password',
86
86
  },
@@ -91,7 +91,12 @@ describe('createMediaConnection', () => {
91
91
  {
92
92
  iceServers: [
93
93
  {
94
- urls: 'turn server url',
94
+ urls: 'turn:turn-server-url:5004?transport=tcp',
95
+ username: 'turn username',
96
+ credential: 'turn password',
97
+ },
98
+ {
99
+ urls: 'turns:turn-server-url:443?transport=tcp',
95
100
  username: 'turn username',
96
101
  credential: 'turn password',
97
102
  },
@@ -146,7 +151,7 @@ describe('createMediaConnection', () => {
146
151
  },
147
152
  },
148
153
  turnServerInfo: {
149
- url: 'turn server url',
154
+ url: 'turns:turn-server-url:443?transport=tcp',
150
155
  username: 'turn username',
151
156
  password: 'turn password',
152
157
  },
@@ -158,7 +163,12 @@ describe('createMediaConnection', () => {
158
163
  {
159
164
  iceServers: [
160
165
  {
161
- urls: 'turn server url',
166
+ urls: 'turn:turn-server-url:5004?transport=tcp',
167
+ username: 'turn username',
168
+ credential: 'turn password',
169
+ },
170
+ {
171
+ urls: 'turns:turn-server-url:443?transport=tcp',
162
172
  username: 'turn username',
163
173
  credential: 'turn password',
164
174
  },
@@ -171,7 +181,10 @@ describe('createMediaConnection', () => {
171
181
 
172
182
  [
173
183
  {testCase: 'turnServerInfo is undefined', turnServerInfo: undefined},
174
- {testCase: 'turnServerInfo.url is empty string', turnServerInfo: {url: '', username: 'turn username', password: 'turn password'}},
184
+ {
185
+ testCase: 'turnServerInfo.url is empty string',
186
+ turnServerInfo: {url: '', username: 'turn username', password: 'turn password'},
187
+ },
175
188
  ].forEach(({testCase, turnServerInfo}) => {
176
189
  it(`passes empty ICE servers array to MultistreamRoapMediaConnection if ${testCase} (multistream enabled)`, () => {
177
190
  const multistreamRoapMediaConnectionConstructorStub = sinon
@@ -198,7 +211,7 @@ describe('createMediaConnection', () => {
198
211
  iceServers: [],
199
212
  },
200
213
  'meeting id'
201
- );
214
+ );
202
215
  });
203
216
  });
204
217
 
@@ -232,7 +245,10 @@ describe('createMediaConnection', () => {
232
245
 
233
246
  [
234
247
  {testCase: 'turnServerInfo is undefined', turnServerInfo: undefined},
235
- {testCase: 'turnServerInfo.url is empty string', turnServerInfo: {url: '', username: 'turn username', password: 'turn password'}},
248
+ {
249
+ testCase: 'turnServerInfo.url is empty string',
250
+ turnServerInfo: {url: '', username: 'turn username', password: 'turn password'},
251
+ },
236
252
  ].forEach(({testCase, turnServerInfo}) => {
237
253
  it(`passes empty ICE servers array to RoapMediaConnection if ${testCase} (multistream disabled)`, () => {
238
254
  const roapMediaConnectionConstructorStub = sinon
@@ -625,7 +625,9 @@ describe('plugin-meetings', () => {
625
625
 
626
626
  beforeEach(() => {
627
627
  meeting.join = sinon.stub().returns(Promise.resolve(fakeJoinResult));
628
- addMediaInternalStub = sinon.stub(meeting, 'addMediaInternal').returns(Promise.resolve(test4));
628
+ addMediaInternalStub = sinon
629
+ .stub(meeting, 'addMediaInternal')
630
+ .returns(Promise.resolve(test4));
629
631
 
630
632
  webex.meetings.reachability.getReachabilityResults.resolves(fakeReachabilityResults);
631
633
 
@@ -656,12 +658,21 @@ describe('plugin-meetings', () => {
656
658
  meeting,
657
659
  fakeJoinResult
658
660
  );
659
- assert.calledOnceWithExactly(meeting.addMediaInternal, sinon.match.any, fakeTurnServerInfo, false, mediaOptions);
661
+ assert.calledOnceWithExactly(
662
+ meeting.addMediaInternal,
663
+ sinon.match.any,
664
+ fakeTurnServerInfo,
665
+ false,
666
+ mediaOptions
667
+ );
660
668
 
661
669
  assert.deepEqual(result, {join: fakeJoinResult, media: test4});
662
670
 
663
671
  // resets joinWithMediaRetryInfo
664
- assert.deepEqual(meeting.joinWithMediaRetryInfo, {isRetry: false, prevJoinResponse: undefined});
672
+ assert.deepEqual(meeting.joinWithMediaRetryInfo, {
673
+ isRetry: false,
674
+ prevJoinResponse: undefined,
675
+ });
665
676
  });
666
677
 
667
678
  it("should not call handleTurnDiscoveryHttpResponse if we don't send a TURN discovery request with join", async () => {
@@ -681,7 +692,13 @@ describe('plugin-meetings', () => {
681
692
  assert.calledOnceWithExactly(generateTurnDiscoveryRequestMessageStub, meeting, true);
682
693
  assert.notCalled(handleTurnDiscoveryHttpResponseStub);
683
694
  assert.notCalled(abortTurnDiscoveryStub);
684
- assert.calledOnceWithExactly(meeting.addMediaInternal, sinon.match.any, undefined, false, mediaOptions);
695
+ assert.calledOnceWithExactly(
696
+ meeting.addMediaInternal,
697
+ sinon.match.any,
698
+ undefined,
699
+ false,
700
+ mediaOptions
701
+ );
685
702
 
686
703
  assert.deepEqual(result, {join: fakeJoinResult, media: test4});
687
704
  assert.equal(meeting.turnServerUsed, false);
@@ -711,7 +728,13 @@ describe('plugin-meetings', () => {
711
728
  fakeJoinResult
712
729
  );
713
730
  assert.calledOnceWithExactly(abortTurnDiscoveryStub);
714
- assert.calledOnceWithExactly(meeting.addMediaInternal, sinon.match.any, undefined, false, mediaOptions);
731
+ assert.calledOnceWithExactly(
732
+ meeting.addMediaInternal,
733
+ sinon.match.any,
734
+ undefined,
735
+ false,
736
+ mediaOptions
737
+ );
715
738
 
716
739
  assert.deepEqual(result, {join: fakeJoinResult, media: test4});
717
740
  });
@@ -758,12 +781,20 @@ describe('plugin-meetings', () => {
758
781
  );
759
782
 
760
783
  // resets joinWithMediaRetryInfo
761
- assert.deepEqual(meeting.joinWithMediaRetryInfo, {isRetry: false, prevJoinResponse: undefined});
784
+ assert.deepEqual(meeting.joinWithMediaRetryInfo, {
785
+ isRetry: false,
786
+ prevJoinResponse: undefined,
787
+ });
762
788
  });
763
789
 
764
790
  it('should resolve if join() fails the first time but succeeds the second time', async () => {
765
791
  const error = new Error('fake');
766
- meeting.join = sinon.stub().onFirstCall().returns(Promise.reject(error)).onSecondCall().returns(Promise.resolve(fakeJoinResult));
792
+ meeting.join = sinon
793
+ .stub()
794
+ .onFirstCall()
795
+ .returns(Promise.reject(error))
796
+ .onSecondCall()
797
+ .returns(Promise.resolve(fakeJoinResult));
767
798
  const leaveStub = sinon.stub(meeting, 'leave').resolves();
768
799
 
769
800
  const result = await meeting.joinWithMedia({
@@ -795,7 +826,10 @@ describe('plugin-meetings', () => {
795
826
  assert.deepEqual(result, {join: fakeJoinResult, media: test4});
796
827
 
797
828
  // resets joinWithMediaRetryInfo
798
- assert.deepEqual(meeting.joinWithMediaRetryInfo, {isRetry: false, prevJoinResponse: undefined});
829
+ assert.deepEqual(meeting.joinWithMediaRetryInfo, {
830
+ isRetry: false,
831
+ prevJoinResponse: undefined,
832
+ });
799
833
  });
800
834
 
801
835
  it('should fail if called with allowMediaInLobby:false', async () => {
@@ -828,7 +862,6 @@ describe('plugin-meetings', () => {
828
862
  reason: 'joinWithMedia failure',
829
863
  });
830
864
 
831
-
832
865
  // Behavioral metric is sent on both calls of joinWithMedia
833
866
  assert.calledTwice(Metrics.sendBehavioralMetric);
834
867
  assert.calledWith(
@@ -1068,12 +1101,15 @@ describe('plugin-meetings', () => {
1068
1101
  const addMediaError = new Error('fake addMedia error');
1069
1102
  addMediaError.name = 'SdpOfferCreationError';
1070
1103
 
1071
- meeting.addMediaInternal.rejects(addMediaError)
1104
+ meeting.addMediaInternal.rejects(addMediaError);
1072
1105
 
1073
- await assert.isRejected(meeting.joinWithMedia({
1074
- joinOptions,
1075
- mediaOptions,
1076
- }), addMediaError);
1106
+ await assert.isRejected(
1107
+ meeting.joinWithMedia({
1108
+ joinOptions,
1109
+ mediaOptions,
1110
+ }),
1111
+ addMediaError
1112
+ );
1077
1113
 
1078
1114
  // check that only 1 attempt was done
1079
1115
  assert.calledOnce(meeting.join);
@@ -1339,10 +1375,7 @@ describe('plugin-meetings', () => {
1339
1375
 
1340
1376
  it('should trigger meeting:caption-received event', () => {
1341
1377
  meeting.voiceaListenerCallbacks[VOICEAEVENTS.NEW_CAPTION]({});
1342
- assert.calledWith(
1343
- meeting.trigger,
1344
- EVENT_TRIGGERS.MEETING_CAPTION_RECEIVED
1345
- );
1378
+ assert.calledWith(meeting.trigger, EVENT_TRIGGERS.MEETING_CAPTION_RECEIVED);
1346
1379
  });
1347
1380
 
1348
1381
  it('should trigger meeting:receiveTranscription:started event', () => {
@@ -1355,10 +1388,7 @@ describe('plugin-meetings', () => {
1355
1388
 
1356
1389
  it('should trigger meeting:caption-received event', () => {
1357
1390
  meeting.voiceaListenerCallbacks[VOICEAEVENTS.NEW_CAPTION]({});
1358
- assert.calledWith(
1359
- meeting.trigger,
1360
- EVENT_TRIGGERS.MEETING_CAPTION_RECEIVED
1361
- );
1391
+ assert.calledWith(meeting.trigger, EVENT_TRIGGERS.MEETING_CAPTION_RECEIVED);
1362
1392
  });
1363
1393
  });
1364
1394
 
@@ -1513,11 +1543,7 @@ describe('plugin-meetings', () => {
1513
1543
 
1514
1544
  it('turns off llm online, emits transcription connected events', () => {
1515
1545
  meeting.handleLLMOnline();
1516
- assert.calledOnceWithExactly(
1517
- webex.internal.llm.off,
1518
- 'online',
1519
- meeting.handleLLMOnline
1520
- );
1546
+ assert.calledOnceWithExactly(webex.internal.llm.off, 'online', meeting.handleLLMOnline);
1521
1547
  assert.calledWith(
1522
1548
  TriggerProxy.trigger,
1523
1549
  sinon.match.instanceOf(Meeting),
@@ -1579,11 +1605,7 @@ describe('plugin-meetings', () => {
1579
1605
  assert.calledOnce(MeetingUtil.joinMeeting);
1580
1606
  assert.calledOnce(meeting.setLocus);
1581
1607
  assert.equal(result, joinMeetingResult);
1582
- assert.calledWith(
1583
- webex.internal.llm.on,
1584
- 'online',
1585
- meeting.handleLLMOnline
1586
- );
1608
+ assert.calledWith(webex.internal.llm.on, 'online', meeting.handleLLMOnline);
1587
1609
  });
1588
1610
 
1589
1611
  [true, false].forEach((enableMultistream) => {
@@ -1906,7 +1928,9 @@ describe('plugin-meetings', () => {
1906
1928
  };
1907
1929
  meeting.mediaProperties.setMediaDirection = sinon.stub().returns(true);
1908
1930
  meeting.mediaProperties.waitForMediaConnectionConnected = sinon.stub().resolves();
1909
- meeting.mediaProperties.getCurrentConnectionInfo = sinon.stub().resolves({connectionType: 'udp', selectedCandidatePairChanges: 2, numTransports: 1});
1931
+ meeting.mediaProperties.getCurrentConnectionInfo = sinon
1932
+ .stub()
1933
+ .resolves({connectionType: 'udp', selectedCandidatePairChanges: 2, numTransports: 1});
1910
1934
  meeting.audio = muteStateStub;
1911
1935
  meeting.video = muteStateStub;
1912
1936
  sinon.stub(Media, 'createMediaConnection').returns(fakeMediaConnection);
@@ -1920,7 +1944,12 @@ describe('plugin-meetings', () => {
1920
1944
  // normally the first Roap message we send is creating confluence, so mock LocusMediaRequest.isConfluenceCreated()
1921
1945
  // to return false the first time it's called and true the 2nd time, to simulate how it would happen for real
1922
1946
  meeting.locusMediaRequest = {
1923
- isConfluenceCreated: sinon.stub().onFirstCall().returns(false).onSecondCall().returns(true)
1947
+ isConfluenceCreated: sinon
1948
+ .stub()
1949
+ .onFirstCall()
1950
+ .returns(false)
1951
+ .onSecondCall()
1952
+ .returns(true),
1924
1953
  };
1925
1954
  });
1926
1955
 
@@ -2485,7 +2514,6 @@ describe('plugin-meetings', () => {
2485
2514
  it('should reject if waitForMediaConnectionConnected() rejects after turn server retry', async () => {
2486
2515
  const FAKE_ERROR = {fatal: true};
2487
2516
  const getErrorPayloadForClientErrorCodeStub =
2488
-
2489
2517
  (webex.internal.newMetrics.callDiagnosticMetrics.getErrorPayloadForClientErrorCode =
2490
2518
  sinon.stub().returns(FAKE_ERROR));
2491
2519
  webex.meetings.reachability = {
@@ -2690,9 +2718,16 @@ describe('plugin-meetings', () => {
2690
2718
  it('should resolve if waitForMediaConnectionConnected() rejects the first time but resolves the second time', async () => {
2691
2719
  const FAKE_ERROR = {fatal: true};
2692
2720
  webex.meetings.reachability = {
2693
- isWebexMediaBackendUnreachable: sinon.stub().onCall(0).rejects().onCall(1).resolves(true).onCall(2).resolves(false),
2721
+ isWebexMediaBackendUnreachable: sinon
2722
+ .stub()
2723
+ .onCall(0)
2724
+ .rejects()
2725
+ .onCall(1)
2726
+ .resolves(true)
2727
+ .onCall(2)
2728
+ .resolves(false),
2694
2729
  getReachabilityMetrics: sinon.stub().resolves({}),
2695
- }
2730
+ };
2696
2731
  const getErrorPayloadForClientErrorCodeStub =
2697
2732
  (webex.internal.newMetrics.callDiagnosticMetrics.getErrorPayloadForClientErrorCode =
2698
2733
  sinon.stub().returns(FAKE_ERROR));
@@ -3445,9 +3480,9 @@ describe('plugin-meetings', () => {
3445
3480
  .returns(clientErrorCode);
3446
3481
 
3447
3482
  meeting.meetingState = 'ACTIVE';
3448
- meeting.mediaProperties.waitForMediaConnectionConnected.rejects(
3449
- {iceConnected: false}
3450
- );
3483
+ meeting.mediaProperties.waitForMediaConnectionConnected.rejects({
3484
+ iceConnected: false,
3485
+ });
3451
3486
 
3452
3487
  let errorThrown = false;
3453
3488
 
@@ -3562,12 +3597,18 @@ describe('plugin-meetings', () => {
3562
3597
  meeting.meetingState = 'ACTIVE';
3563
3598
  meeting.selfUrl = 'selfUrl';
3564
3599
  meeting.mediaProperties.waitForMediaConnectionConnected = sinon.stub().resolves();
3565
- meeting.mediaProperties.getCurrentConnectionInfo = sinon.stub().resolves({connectionType: 'udp', selectedCandidatePairChanges: 2, numTransports: 1});
3600
+ meeting.mediaProperties.getCurrentConnectionInfo = sinon
3601
+ .stub()
3602
+ .resolves({connectionType: 'udp', selectedCandidatePairChanges: 2, numTransports: 1});
3566
3603
  meeting.setMercuryListener = sinon.stub();
3567
3604
  meeting.locusInfo.onFullLocus = sinon.stub();
3568
3605
  meeting.webex.meetings.geoHintInfo = {regionCode: 'EU', countryCode: 'UK'};
3569
3606
  meeting.roap.doTurnDiscovery = sinon.stub().resolves({
3570
- turnServerInfo: {url: 'turn-url', username: 'turn user', password: 'turn password'},
3607
+ turnServerInfo: {
3608
+ url: 'turns:turn-server-url:443?transport=tcp',
3609
+ username: 'turn user',
3610
+ password: 'turn password',
3611
+ },
3571
3612
  turnDiscoverySkippedReason: 'reachability',
3572
3613
  });
3573
3614
  meeting.deferSDPAnswer = new Defer();
@@ -3580,7 +3621,18 @@ describe('plugin-meetings', () => {
3580
3621
  // setup things that are expected to be the same across all the tests and are actually irrelevant for these tests
3581
3622
  expectedDebugId = `MC-${meeting.id.substring(0, 4)}`;
3582
3623
  expectedMediaConnectionConfig = {
3583
- iceServers: [{urls: 'turn-url', username: 'turn user', credential: 'turn password'}],
3624
+ iceServers: [
3625
+ {
3626
+ urls: 'turn:turn-server-url:5004?transport=tcp',
3627
+ username: 'turn user',
3628
+ credential: 'turn password',
3629
+ },
3630
+ {
3631
+ urls: 'turns:turn-server-url:443?transport=tcp',
3632
+ username: 'turn user',
3633
+ credential: 'turn password',
3634
+ },
3635
+ ],
3584
3636
  skipInactiveTransceivers: false,
3585
3637
  requireH264: true,
3586
3638
  sdpMunging: {
@@ -3665,13 +3717,11 @@ describe('plugin-meetings', () => {
3665
3717
  // that's being tested in these tests)
3666
3718
  meeting.webex.meetings.registered = true;
3667
3719
  meeting.webex.internal.device.config = {};
3668
- sinon
3669
- .stub(MeetingUtil, 'joinMeeting')
3670
- .resolves({
3671
- id: 'fake locus from mocked join request',
3672
- locusUrl: 'fake locus url',
3673
- mediaId: 'fake media id',
3674
- });
3720
+ sinon.stub(MeetingUtil, 'joinMeeting').resolves({
3721
+ id: 'fake locus from mocked join request',
3722
+ locusUrl: 'fake locus url',
3723
+ mediaId: 'fake media id',
3724
+ });
3675
3725
  await meeting.join({enableMultistream: isMultistream});
3676
3726
  });
3677
3727
 
@@ -3701,7 +3751,8 @@ describe('plugin-meetings', () => {
3701
3751
 
3702
3752
  for (let idx = 0; idx < roapMediaConnectionToCheck.on.callCount; idx += 1) {
3703
3753
  if (
3704
- roapMediaConnectionToCheck.on.getCall(idx).args[0] === MediaConnectionEventNames.ROAP_MESSAGE_TO_SEND
3754
+ roapMediaConnectionToCheck.on.getCall(idx).args[0] ===
3755
+ MediaConnectionEventNames.ROAP_MESSAGE_TO_SEND
3705
3756
  ) {
3706
3757
  return roapMediaConnectionToCheck.on.getCall(idx).args[1];
3707
3758
  }
@@ -4148,13 +4199,13 @@ describe('plugin-meetings', () => {
4148
4199
  await meeting.addMedia({
4149
4200
  localStreams: {microphone: fakeMicrophoneStream},
4150
4201
  audioEnabled: false,
4151
- videoEnabled: false
4202
+ videoEnabled: false,
4152
4203
  });
4153
4204
  await simulateRoapOffer();
4154
4205
  await simulateRoapOk();
4155
4206
 
4156
4207
  assert.notCalled(handleDeviceLoggingSpy);
4157
- })
4208
+ });
4158
4209
 
4159
4210
  it('addMedia() works correctly when media is disabled with no streams to publish', async () => {
4160
4211
  await meeting.addMedia({audioEnabled: false});
@@ -6589,14 +6640,14 @@ describe('plugin-meetings', () => {
6589
6640
  beforeEach(() => {
6590
6641
  sandbox = sinon.createSandbox();
6591
6642
  meeting.statsAnalyzer = {
6592
- stopAnalyzer: sinon.stub().returns(Promise.resolve())
6643
+ stopAnalyzer: sinon.stub().returns(Promise.resolve()),
6593
6644
  };
6594
6645
 
6595
6646
  meeting.reconnectionManager = {
6596
- cleanUp: sinon.stub()
6647
+ cleanUp: sinon.stub(),
6597
6648
  };
6598
6649
 
6599
- meeting.cleanupLocalStreams=sinon.stub();
6650
+ meeting.cleanupLocalStreams = sinon.stub();
6600
6651
  meeting.closeRemoteStreams = sinon.stub().returns(Promise.resolve());
6601
6652
  meeting.closePeerConnections = sinon.stub().returns(Promise.resolve());
6602
6653
  meeting.unsetRemoteStreams = sinon.stub();
@@ -6678,7 +6729,6 @@ describe('plugin-meetings', () => {
6678
6729
  'SELF_OBSERVING'
6679
6730
  );
6680
6731
 
6681
-
6682
6732
  // Verify that the event handler behaves as expected
6683
6733
  expect(meeting.statsAnalyzer.stopAnalyzer.calledOnce).to.be.true;
6684
6734
  expect(meeting.closeRemoteStreams.calledOnce).to.be.true;
@@ -6690,11 +6740,13 @@ describe('plugin-meetings', () => {
6690
6740
  expect(meeting.unsetPeerConnections.calledOnce).to.be.true;
6691
6741
  expect(meeting.reconnectionManager.cleanUp.calledOnce).to.be.true;
6692
6742
  expect(meeting.mediaProperties.setMediaDirection.calledOnce).to.be.true;
6693
- expect(meeting.addMedia.calledOnceWithExactly({
6694
- audioEnabled: false,
6695
- videoEnabled: false,
6696
- shareVideoEnabled: true
6697
- })).to.be.true;
6743
+ expect(
6744
+ meeting.addMedia.calledOnceWithExactly({
6745
+ audioEnabled: false,
6746
+ videoEnabled: false,
6747
+ shareVideoEnabled: true,
6748
+ })
6749
+ ).to.be.true;
6698
6750
  await testUtils.flushPromises();
6699
6751
  assert.equal(meeting.isMoveToInProgress, false);
6700
6752
  });
@@ -7482,9 +7534,11 @@ describe('plugin-meetings', () => {
7482
7534
  getTracks: () => [{id: 'track', addEventListener: sinon.stub()}],
7483
7535
  };
7484
7536
  const simulateConnectionStateChange = (newState) => {
7485
- meeting.mediaProperties.webrtcMediaConnection.getConnectionState = sinon.stub().returns(newState);
7537
+ meeting.mediaProperties.webrtcMediaConnection.getConnectionState = sinon
7538
+ .stub()
7539
+ .returns(newState);
7486
7540
  eventListeners[MediaConnectionEventNames.PEER_CONNECTION_STATE_CHANGED]();
7487
- }
7541
+ };
7488
7542
 
7489
7543
  beforeEach(() => {
7490
7544
  eventListeners = {};
@@ -7506,7 +7560,9 @@ describe('plugin-meetings', () => {
7506
7560
  assert.isFunction(eventListeners[MediaConnectionEventNames.ROAP_FAILURE]);
7507
7561
  assert.isFunction(eventListeners[MediaConnectionEventNames.ROAP_MESSAGE_TO_SEND]);
7508
7562
  assert.isFunction(eventListeners[MediaConnectionEventNames.REMOTE_TRACK_ADDED]);
7509
- assert.isFunction(eventListeners[MediaConnectionEventNames.PEER_CONNECTION_STATE_CHANGED]);
7563
+ assert.isFunction(
7564
+ eventListeners[MediaConnectionEventNames.PEER_CONNECTION_STATE_CHANGED]
7565
+ );
7510
7566
  assert.isFunction(eventListeners[MediaConnectionEventNames.ICE_CONNECTION_STATE_CHANGED]);
7511
7567
  assert.isFunction(eventListeners[MediaConnectionEventNames.ICE_CANDIDATE]);
7512
7568
  assert.isFunction(eventListeners[MediaConnectionEventNames.ICE_CANDIDATE_ERROR]);
@@ -7569,28 +7625,44 @@ describe('plugin-meetings', () => {
7569
7625
  });
7570
7626
 
7571
7627
  it('should not collect skipped ice candidates error', () => {
7572
- eventListeners[MediaConnectionEventNames.ICE_CANDIDATE_ERROR]({error: { errorCode: 600, errorText: 'Address not associated with the desired network interface.' }});
7628
+ eventListeners[MediaConnectionEventNames.ICE_CANDIDATE_ERROR]({
7629
+ error: {
7630
+ errorCode: 600,
7631
+ errorText: 'Address not associated with the desired network interface.',
7632
+ },
7633
+ });
7573
7634
 
7574
7635
  assert.equal(meeting.iceCandidateErrors.size, 0);
7575
7636
  });
7576
7637
 
7577
7638
  it('should collect valid ice candidates error', () => {
7578
- eventListeners[MediaConnectionEventNames.ICE_CANDIDATE_ERROR]({error: { errorCode: 701, errorText: '' }});
7639
+ eventListeners[MediaConnectionEventNames.ICE_CANDIDATE_ERROR]({
7640
+ error: {errorCode: 701, errorText: ''},
7641
+ });
7579
7642
 
7580
7643
  assert.equal(meeting.iceCandidateErrors.size, 1);
7581
7644
  assert.equal(meeting.iceCandidateErrors.has('701_'), true);
7582
7645
  });
7583
7646
 
7584
7647
  it('should increment counter if same valid ice candidates error collected', () => {
7585
- eventListeners[MediaConnectionEventNames.ICE_CANDIDATE_ERROR]({error: { errorCode: 701, errorText: '' }});
7648
+ eventListeners[MediaConnectionEventNames.ICE_CANDIDATE_ERROR]({
7649
+ error: {errorCode: 701, errorText: ''},
7650
+ });
7586
7651
 
7587
- eventListeners[MediaConnectionEventNames.ICE_CANDIDATE_ERROR]({error: { errorCode: 701, errorText: 'STUN host lookup received error.' }});
7588
- eventListeners[MediaConnectionEventNames.ICE_CANDIDATE_ERROR]({error: { errorCode: 701, errorText: 'STUN host lookup received error.' }});
7652
+ eventListeners[MediaConnectionEventNames.ICE_CANDIDATE_ERROR]({
7653
+ error: {errorCode: 701, errorText: 'STUN host lookup received error.'},
7654
+ });
7655
+ eventListeners[MediaConnectionEventNames.ICE_CANDIDATE_ERROR]({
7656
+ error: {errorCode: 701, errorText: 'STUN host lookup received error.'},
7657
+ });
7589
7658
 
7590
7659
  assert.equal(meeting.iceCandidateErrors.size, 2);
7591
7660
  assert.equal(meeting.iceCandidateErrors.has('701_'), true);
7592
7661
  assert.equal(meeting.iceCandidateErrors.get('701_'), 1);
7593
- assert.equal(meeting.iceCandidateErrors.has('701_stun_host_lookup_received_error'), true);
7662
+ assert.equal(
7663
+ meeting.iceCandidateErrors.has('701_stun_host_lookup_received_error'),
7664
+ true
7665
+ );
7594
7666
  assert.equal(meeting.iceCandidateErrors.get('701_stun_host_lookup_received_error'), 2);
7595
7667
  });
7596
7668
  });
@@ -8263,8 +8335,12 @@ describe('plugin-meetings', () => {
8263
8335
  });
8264
8336
 
8265
8337
  it('registers for audio and video source count changed', () => {
8266
- assert.isFunction(eventListeners[MediaConnectionEventNames.VIDEO_SOURCES_COUNT_CHANGED]);
8267
- assert.isFunction(eventListeners[MediaConnectionEventNames.AUDIO_SOURCES_COUNT_CHANGED]);
8338
+ assert.isFunction(
8339
+ eventListeners[MediaConnectionEventNames.VIDEO_SOURCES_COUNT_CHANGED]
8340
+ );
8341
+ assert.isFunction(
8342
+ eventListeners[MediaConnectionEventNames.AUDIO_SOURCES_COUNT_CHANGED]
8343
+ );
8268
8344
  });
8269
8345
 
8270
8346
  it('forwards the VIDEO_SOURCES_COUNT_CHANGED event as "media:remoteVideoSourceCountChanged"', () => {