@webex/plugin-meetings 3.0.0-beta.386 → 3.0.0-beta.388

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.0.0-beta.386"
212
+ version: "3.0.0-beta.388"
213
213
  });
214
214
  var _default = Breakout;
215
215
  exports.default = _default;
@@ -1041,7 +1041,7 @@ var Breakouts = _webexCore.WebexPlugin.extend({
1041
1041
  this.trigger(_constants.BREAKOUTS.EVENTS.ASK_RETURN_TO_MAIN);
1042
1042
  }
1043
1043
  },
1044
- version: "3.0.0-beta.386"
1044
+ version: "3.0.0-beta.388"
1045
1045
  });
1046
1046
  var _default = Breakouts;
1047
1047
  exports.default = _default;
@@ -373,7 +373,7 @@ var SimultaneousInterpretation = _webexCore.WebexPlugin.extend({
373
373
  throw error;
374
374
  });
375
375
  },
376
- version: "3.0.0-beta.386"
376
+ version: "3.0.0-beta.388"
377
377
  });
378
378
  var _default = SimultaneousInterpretation;
379
379
  exports.default = _default;
@@ -18,7 +18,7 @@ var SILanguage = _webexCore.WebexPlugin.extend({
18
18
  languageCode: 'number',
19
19
  languageName: 'string'
20
20
  },
21
- version: "3.0.0-beta.386"
21
+ version: "3.0.0-beta.388"
22
22
  });
23
23
  var _default = SILanguage;
24
24
  exports.default = _default;
@@ -118,7 +118,10 @@ Media.createMediaConnection = function (isMultistream, debugId, webex, meetingId
118
118
  turnServerInfo = options.turnServerInfo,
119
119
  bundlePolicy = options.bundlePolicy;
120
120
  var iceServers = [];
121
- if (turnServerInfo) {
121
+
122
+ // we might not have any TURN server if TURN discovery failed or wasn't done or
123
+ // we might get an empty TURN url if we land on a video mesh node
124
+ if (turnServerInfo !== null && turnServerInfo !== void 0 && turnServerInfo.url) {
122
125
  iceServers.push({
123
126
  urls: turnServerInfo.url,
124
127
  username: turnServerInfo.username || '',
@@ -1 +1 @@
1
- {"version":3,"names":["BrowserDetection","isBrowser","Media","getLocalMedia","options","config","sendAudio","sendVideo","sendShare","sharePreferences","isSharing","getMedia","getDisplayMedia","resolve","undefined","getDirection","forceSendRecv","receive","send","createMediaConnection","isMultistream","debugId","webex","meetingId","correlationId","mediaProperties","remoteQualityLevel","enableRtx","enableExtmap","turnServerInfo","bundlePolicy","iceServers","push","urls","url","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","resolution","videoShareFrameRate","aspectRatio","cursor","MEDIA_TRACK_CONSTRAINT","CURSOR","AWLAYS","frameRate","height","idealHeight","width","idealWidth","mediaConfig","navigator","mediaDevices","then","stream","getVideoTracks","length","applyConstraints","getDisplayMediaParams","defaultWidth","ideal","max","maxWidth","defaultHeight","maxHeight","deviceId","facingMode","fake","process","env","NODE_ENV","getUserMedia","catch","err","logPath","LoggerProxy","logger","error","constraint","toggleStream","stopStream","stop","e","readyState","mediaSetting","audioVideo","localStream","shareStream"],"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 if (turnServerInfo) {\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"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IAClC,IAAI;MACFC,MAAM,CAAC2B,IAAI,EAAE;IACf,CAAC,CAAC,OAAOC,CAAC,EAAE;MACVP,oBAAW,CAACC,MAAM,CAACC,KAAK,oFACsDvB,MAAM,CAAC6B,UAAU,sBAAYD,CAAC,EAC3G;IACH;EACF,CAAC,CAAC;AACJ,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACAhI,KAAK,CAACqH,YAAY,GAAG,UACnBa,YAKC,EACDC,UAGC,EACD5H,gBAGC,EACDJ,MAAc;EAAA,OAEdH,KAAK,CAACC,aAAa,CACjB;IACEG,SAAS,EAAE8H,YAAY,CAAC9H,SAAS,GAAG+H,UAAU,CAAC3E,KAAK,IAAI0E,YAAY,CAAC9H,SAAS,GAAG,KAAK;IACtFC,SAAS,EAAE6H,YAAY,CAAC7H,SAAS,GAAG8H,UAAU,CAACvE,KAAK,IAAIsE,YAAY,CAAC7H,SAAS,GAAG;EACnF,CAAC,EACDF,MAAM,CACP,CAACgG,IAAI,CAAC,UAACiC,WAAW;IAAA,OACjBpI,KAAK,CAACC,aAAa,CACjB;MACEK,SAAS,EAAE4H,YAAY,CAAC5H,SAAS;MACjCE,SAAS,EAAE0H,YAAY,CAAC1H,SAAS;MACjCD,gBAAgB,EAAhBA;IACF,CAAC,EACDJ,MAAM,CACP,CAACgG,IAAI,CAAC,UAACkC,WAAW;MAAA,OAAK,CAACD,WAAW,EAAEC,WAAW,CAAC;IAAA,EAAC;EAAA,EACpD;AAAA;AAAC,eAEWrI,KAAK;AAAA"}
1
+ {"version":3,"names":["BrowserDetection","isBrowser","Media","getLocalMedia","options","config","sendAudio","sendVideo","sendShare","sharePreferences","isSharing","getMedia","getDisplayMedia","resolve","undefined","getDirection","forceSendRecv","receive","send","createMediaConnection","isMultistream","debugId","webex","meetingId","correlationId","mediaProperties","remoteQualityLevel","enableRtx","enableExtmap","turnServerInfo","bundlePolicy","iceServers","url","push","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","resolution","videoShareFrameRate","aspectRatio","cursor","MEDIA_TRACK_CONSTRAINT","CURSOR","AWLAYS","frameRate","height","idealHeight","width","idealWidth","mediaConfig","navigator","mediaDevices","then","stream","getVideoTracks","length","applyConstraints","getDisplayMediaParams","defaultWidth","ideal","max","maxWidth","defaultHeight","maxHeight","deviceId","facingMode","fake","process","env","NODE_ENV","getUserMedia","catch","err","logPath","LoggerProxy","logger","error","constraint","toggleStream","stopStream","stop","e","readyState","mediaSetting","audioVideo","localStream","shareStream"],"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;AAYA;AACA;AACA;AACA;AACA;AACA;AAAuC;AAAA;AAEvC,wBAAoB,IAAAA,yBAAgB,GAAE;EAA/BC,SAAS,qBAATA,SAAS;AAIhB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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,UAAU,sBAAYD,CAAC,EAC3G;IACH;EACF,CAAC,CAAC;AACJ,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACAhI,KAAK,CAACqH,YAAY,GAAG,UACnBa,YAKC,EACDC,UAGC,EACD5H,gBAGC,EACDJ,MAAc;EAAA,OAEdH,KAAK,CAACC,aAAa,CACjB;IACEG,SAAS,EAAE8H,YAAY,CAAC9H,SAAS,GAAG+H,UAAU,CAAC3E,KAAK,IAAI0E,YAAY,CAAC9H,SAAS,GAAG,KAAK;IACtFC,SAAS,EAAE6H,YAAY,CAAC7H,SAAS,GAAG8H,UAAU,CAACvE,KAAK,IAAIsE,YAAY,CAAC7H,SAAS,GAAG;EACnF,CAAC,EACDF,MAAM,CACP,CAACgG,IAAI,CAAC,UAACiC,WAAW;IAAA,OACjBpI,KAAK,CAACC,aAAa,CACjB;MACEK,SAAS,EAAE4H,YAAY,CAAC5H,SAAS;MACjCE,SAAS,EAAE0H,YAAY,CAAC1H,SAAS;MACjCD,gBAAgB,EAAhBA;IACF,CAAC,EACDJ,MAAM,CACP,CAACgG,IAAI,CAAC,UAACkC,WAAW;MAAA,OAAK,CAACD,WAAW,EAAEC,WAAW,CAAC;IAAA,EAAC;EAAA,EACpD;AAAA;AAAC,eAEWrI,KAAK;AAAA"}
@@ -642,6 +642,7 @@ var ReconnectionManager = /*#__PURE__*/function () {
642
642
  key: "reconnectMedia",
643
643
  value: function () {
644
644
  var _reconnectMedia = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee5() {
645
+ var _turnServerResult$tur;
645
646
  var turnServerResult, iceServers;
646
647
  return _regenerator.default.wrap(function _callee5$(_context5) {
647
648
  while (1) switch (_context5.prev = _context5.next) {
@@ -654,7 +655,7 @@ var ReconnectionManager = /*#__PURE__*/function () {
654
655
  case 3:
655
656
  turnServerResult = _context5.sent;
656
657
  iceServers = [];
657
- if (turnServerResult.turnServerInfo) {
658
+ if ((_turnServerResult$tur = turnServerResult.turnServerInfo) !== null && _turnServerResult$tur !== void 0 && _turnServerResult$tur.url) {
658
659
  iceServers.push({
659
660
  urls: turnServerResult.turnServerInfo.url,
660
661
  username: turnServerResult.turnServerInfo.username || '',
@@ -1 +1 @@
1
- {"version":3,"names":["NeedsRetryError","Error","NeedsRejoinError","wasSharing","error","ReconnectionManager","meeting","iceState","disconnected","resolve","timer","undefined","timeoutDuration","config","reconnection","iceReconnectionTimeout","status","RECONNECTION","STATE","DEFAULT_STATUS","tryCount","DEFAULT_TRY_COUNT","webex","maxRejoinAttempts","rejoinAttempts","autoRejoinEnabled","autoRejoin","reset","clearTimeout","LoggerProxy","logger","log","resetReconnectionTimer","reject","setTimeout","reason","unpublishStreams","mediaProperties","shareVideoStream","shareAudioStream","Trigger","trigger","file","function","EVENT_TRIGGERS","MEETING_STOPPED_SHARING_LOCAL","IN_PROGRESS","enabled","COMPLETE","info","ReconnectInProgress","ReconnectionError","networkDisconnect","networkRetry","id","validate","internal","newMetrics","submitClientEvent","name","options","meetingId","meetings","startReachability","executeReconnection","media","reconnect","message","payload","errors","category","errorCode","fatal","shownToUser","rejoinMeeting","shareStatus","SHARE_STATUS","LOCAL_SHARE_ACTIVE","stopLocalShareStream","SHARE_STOPPED_REASON","MEDIA_RECONNECTION","reconnectMercuryWebSocket","device","url","FAILURE","syncMeetings","keepOnlyLocusMeetings","getMeetingByType","_ID_","state","_LEFT_","type","_CALL_","reconnectMedia","join","rejoin","MEETING_REJOIN","Metrics","sendBehavioralMetric","BEHAVIORAL_METRICS","MEETING_MAX_REJOIN_FAILURE","locus_id","locusUrl","split","pop","stack","roap","doTurnDiscovery","turnServerResult","iceServers","turnServerInfo","push","urls","username","credential","password","webrtcMediaConnection","isMultistream","mediaRequestManagers","forEach","mediaRequestManager","clearPreviousRequests","commit","mercury","connected","disconnect","connect"],"sources":["index.ts"],"sourcesContent":["/*!\n * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.\n */\n\n/* eslint-disable no-warning-comments */\n\nimport LoggerProxy from '../common/logs/logger-proxy';\nimport Trigger from '../common/events/trigger-proxy';\nimport {\n EVENT_TRIGGERS,\n RECONNECTION,\n SHARE_STATUS,\n SHARE_STOPPED_REASON,\n _CALL_,\n _LEFT_,\n _ID_,\n RECONNECTION_STATE,\n} from '../constants';\nimport BEHAVIORAL_METRICS from '../metrics/constants';\nimport ReconnectInProgress from '../common/errors/reconnection-in-progress';\nimport Metrics from '../metrics';\nimport Meeting from '../meeting';\nimport {MediaRequestManager} from '../multistream/mediaRequestManager';\nimport ReconnectionError from '../common/errors/reconnection';\n\n/**\n * Used to indicate that the reconnect logic needs to be retried.\n *\n * @class NeedsRetryError\n * @extends {Error}\n */\nclass NeedsRetryError extends Error {}\n\n/**\n * Used to indicate that the meeting needs to be rejoined, not just media reconnected\n *\n * @class NeedsRejoinError\n * @extends {Error}\n */\nclass NeedsRejoinError extends Error {\n wasSharing: any;\n\n /**\n * Creates an instance of NeedsRejoinError.\n * @param {Object} params\n * @param {boolean} params.wasSharing\n * @param {Error} params.error\n * @memberof NeedsRejoinError\n */\n constructor({\n wasSharing,\n error = new Error('Meeting needs to be rejoined'),\n }: {\n wasSharing?: boolean;\n error?: Error;\n }) {\n // @ts-ignore\n super(error);\n\n this.wasSharing = wasSharing;\n }\n}\n\n/**\n * @export\n * @class ReconnectionManager\n */\nexport default class ReconnectionManager {\n autoRejoinEnabled: any;\n iceState: any;\n maxRejoinAttempts: any;\n meeting: any;\n rejoinAttempts: any;\n shareStatus: any;\n status: any;\n tryCount: any;\n webex: any;\n /**\n * @param {Meeting} meeting\n */\n constructor(meeting: Meeting) {\n /**\n * Stores ICE reconnection state data.\n *\n * @instance\n * @type {Object}\n * @private\n * @memberof ReconnectionManager\n */\n this.iceState = {\n disconnected: false,\n resolve: () => {},\n timer: undefined,\n // @ts-ignore\n timeoutDuration: meeting.config.reconnection.iceReconnectionTimeout,\n };\n\n /**\n * @instance\n * @type {RECONNECTION_STATE}\n * @private\n * @memberof ReconnectionManager\n */\n this.status = RECONNECTION.STATE.DEFAULT_STATUS;\n /**\n * @instance\n * @type {Number}\n * @private\n * @memberof ReconnectionManager\n */\n this.tryCount = RECONNECTION.STATE.DEFAULT_TRY_COUNT;\n /**\n * @instance\n * @type {Object}\n * @private\n * @memberof ReconnectionManager\n */\n // TODO : change this logic to not save the meeting instance\n // It gets complicated when meeting ends on remote side , We have a old meeting instance which is not up to date\n // @ts-ignore\n this.webex = meeting.webex;\n /**\n * @instance\n * @type {Meeting}\n * @private\n * @memberof ReconnectionManager\n */\n // TODO: try removing the circular dependency for meeting and reconnection manager\n // try moving this to meetings collection\n this.meeting = meeting;\n\n // @ts-ignore\n this.maxRejoinAttempts = meeting.config.reconnection.maxRejoinAttempts;\n this.rejoinAttempts = RECONNECTION.STATE.DEFAULT_TRY_COUNT;\n // @ts-ignore\n this.autoRejoinEnabled = meeting.config.reconnection.autoRejoin;\n\n // Make sure reconnection state is in default\n this.reset();\n }\n\n /**\n * @public\n * @memberof ReconnectionManager\n * @returns {void}\n */\n resetReconnectionTimer() {\n this.iceState.resolve();\n this.iceState.resolve = () => {};\n\n if (this.iceState.timer) {\n clearTimeout(this.iceState.timer);\n delete this.iceState.timer;\n }\n }\n\n /**\n * Sets the iceState to connected and clears any disconnect timeouts and\n * related timeout data within the iceState.\n *\n * @returns {undefined}\n * @public\n * @memberof ReconnectionManager\n */\n public iceReconnected() {\n if (this.iceState.disconnected) {\n LoggerProxy.logger.log('ReconnectionManager:index#iceReconnected --> ice has reconnected');\n\n this.resetReconnectionTimer();\n\n this.iceState.disconnected = false;\n }\n }\n\n /**\n * Set the iceState to disconnected and generates a timeout that waits for the\n * iceState to reconnect and then resolves. If the ice state is already\n * processing a reconnect, it immediately resolves. Rejects if the timeout\n * duration is reached.\n *\n * @returns {Promise<undefined>}\n * @public\n * @memberof ReconnectionManager\n */\n public waitForIceReconnect() {\n if (!this.iceState.disconnected) {\n LoggerProxy.logger.log(\n 'ReconnectionManager:index#waitForIceReconnect --> waiting for ice reconnect'\n );\n\n this.iceState.disconnected = true;\n\n return new Promise<void>((resolve, reject) => {\n this.iceState.timer = setTimeout(() => {\n if (this.iceState.disconnected === false) {\n resolve();\n } else {\n this.iceState.disconnected = false;\n reject(\n new Error(`ice reconnection did not occur in ${this.iceState.timeoutDuration}ms`)\n );\n }\n }, this.iceState.timeoutDuration);\n\n this.iceState.resolve = resolve;\n });\n }\n\n // return a resolved promise to prevent multiple catch executions of reconnect\n return Promise.resolve();\n }\n\n /**\n * @returns {undefined}\n * @public\n * @memberof ReconnectionManager\n */\n public reset() {\n this.status = RECONNECTION.STATE.DEFAULT_STATUS;\n this.tryCount = RECONNECTION.STATE.DEFAULT_TRY_COUNT;\n this.rejoinAttempts = RECONNECTION.STATE.DEFAULT_TRY_COUNT;\n }\n\n /**\n * @returns {undefined}\n * @public\n * @memberof ReconnectionManager\n */\n public cleanUp() {\n this.reset();\n }\n\n /**\n * Stop the local share stream.\n *\n * @param {string} reason a {@link SHARE_STOPPED_REASON}\n * @returns {undefined}\n * @private\n * @memberof ReconnectionManager\n */\n private async stopLocalShareStream(reason: string) {\n await this.meeting.unpublishStreams([\n this.meeting.mediaProperties.shareVideoStream,\n this.meeting.mediaProperties.shareAudioStream,\n ]);\n Trigger.trigger(\n this.meeting,\n {\n file: 'reconnection-manager/index',\n function: 'stopLocalShareStream',\n },\n EVENT_TRIGGERS.MEETING_STOPPED_SHARING_LOCAL,\n {\n reason,\n }\n );\n }\n\n /**\n * @public\n * @memberof ReconnectionManager\n * @returns {Boolean} true if reconnection operation is in progress\n */\n isReconnectInProgress() {\n return this.status === RECONNECTION.STATE.IN_PROGRESS;\n }\n\n /**\n * Sets the reconnection status\n *\n * @public\n * @param {RECONNECTION_STATE} status\n * @memberof ReconnectionManager\n * @returns {undefined}\n */\n public setStatus(status: RECONNECTION_STATE) {\n this.status = status;\n }\n\n /**\n * @returns {Boolean}\n * @throws {ReconnectionError}\n * @private\n * @memberof ReconnectionManager\n */\n private validate() {\n if (this.meeting.config.reconnection.enabled) {\n if (\n this.status === RECONNECTION.STATE.DEFAULT_STATUS ||\n this.status === RECONNECTION.STATE.COMPLETE\n ) {\n return true;\n }\n\n LoggerProxy.logger.info(\n 'ReconnectionManager:index#validate --> Reconnection already in progress.'\n );\n\n throw new ReconnectInProgress('Reconnection already in progress.');\n }\n\n LoggerProxy.logger.info('ReconnectionManager:index#validate --> Reconnection is not enabled.');\n\n throw new ReconnectionError('Reconnection is not enabled.');\n }\n\n /**\n * Initiates a media reconnect for the active meeting\n * @param {Object} reconnectOptions\n * @param {boolean} [reconnectOptions.networkDisconnect=false] indicates if a network disconnect event happened\n * @param {boolean} [reconnectOptions.networkRetry=false] indicates if we are retrying the reconnect\n * @returns {Promise}\n * @public\n * @memberof ReconnectionManager\n */\n public async reconnect({\n networkDisconnect = false,\n networkRetry = false,\n }: {\n networkDisconnect?: boolean;\n networkRetry?: boolean;\n } = {}) {\n LoggerProxy.logger.info(\n `ReconnectionManager:index#reconnect --> Reconnection start for meeting ${this.meeting.id}.`\n );\n // First, validate that we can reconnect, if not, it will throw an error\n try {\n this.validate();\n } catch (error) {\n LoggerProxy.logger.info(\n 'ReconnectionManager:index#reconnect --> Reconnection unable to begin.',\n error\n );\n throw error;\n }\n\n if (!networkRetry) {\n // Only log START metrics on the initial reconnect\n LoggerProxy.logger.info(\n 'ReconnectionManager:index#reconnect --> Sending reconnect start metric.'\n );\n\n // @ts-ignore\n this.webex.internal.newMetrics.submitClientEvent({\n name: 'client.media.reconnecting',\n options: {\n meetingId: this.meeting.id,\n },\n });\n }\n\n try {\n await this.webex.meetings.startReachability();\n } catch (err) {\n LoggerProxy.logger.info(\n 'ReconnectionManager:index#reconnect --> Reachability failed, continuing with reconnection attempt, err: ',\n err\n );\n }\n\n try {\n const media = await this.executeReconnection({networkDisconnect});\n\n return media;\n } catch (reconnectError) {\n if (reconnectError instanceof NeedsRetryError) {\n LoggerProxy.logger.info(\n 'ReconnectionManager:index#reconnect --> Reconnection not successful, retrying.'\n );\n // Reset our reconnect status since we are looping back to the beginning\n this.status = RECONNECTION.STATE.DEFAULT_STATUS;\n\n // This is a network retry, so we should not log START metrics again\n return this.reconnect({networkDisconnect: true, networkRetry: true});\n }\n\n // Reconnect has failed\n LoggerProxy.logger.error(\n 'ReconnectionManager:index#reconnect --> Reconnection failed.',\n reconnectError.message\n );\n LoggerProxy.logger.info(\n 'ReconnectionManager:index#reconnect --> Sending reconnect abort metric.'\n );\n\n // send call aborted event with catogery as expected as we are trying to rejoin\n // @ts-ignore\n this.webex.internal.newMetrics.submitClientEvent({\n name: 'client.call.aborted',\n payload: {\n errors: [\n {\n category: 'expected',\n errorCode: 2008,\n fatal: true,\n name: 'media-engine',\n shownToUser: false,\n },\n ],\n },\n options: {\n meetingId: this.meeting.id,\n },\n });\n\n if (reconnectError instanceof NeedsRejoinError && this.autoRejoinEnabled) {\n return this.rejoinMeeting(reconnectError.wasSharing);\n }\n\n throw reconnectError;\n }\n }\n\n /**\n * @param {Object} reconnectOptions\n * @param {boolean} [reconnectOptions.networkDisconnect=false] indicates if a network disconnect event happened\n * @returns {Promise}\n * @throws {NeedsRetryError}\n * @private\n * @memberof ReconnectionManager\n */\n private async executeReconnection({networkDisconnect = false}: {networkDisconnect?: boolean}) {\n this.status = RECONNECTION.STATE.IN_PROGRESS;\n\n LoggerProxy.logger.info(\n 'ReconnectionManager:index#executeReconnection --> Attempting to reconnect to meeting.'\n );\n\n const wasSharing = this.meeting.shareStatus === SHARE_STATUS.LOCAL_SHARE_ACTIVE;\n\n if (wasSharing) {\n await this.stopLocalShareStream(SHARE_STOPPED_REASON.MEDIA_RECONNECTION);\n }\n\n if (networkDisconnect) {\n try {\n await this.reconnectMercuryWebSocket();\n LoggerProxy.logger.error(\n 'ReconnectionManager:index#executeReconnection --> Websocket reconnected.',\n this.webex.internal.device.url\n );\n } catch (error) {\n LoggerProxy.logger.error(\n 'ReconnectionManager:index#executeReconnection --> Unable to reconnect to websocket, giving up.'\n );\n this.status = RECONNECTION.STATE.FAILURE;\n throw error;\n }\n }\n\n try {\n LoggerProxy.logger.info(\n 'ReconnectionManager:index#executeReconnection --> Updating meeting data from server.'\n );\n await this.webex.meetings.syncMeetings({keepOnlyLocusMeetings: false});\n } catch (syncError) {\n LoggerProxy.logger.info(\n 'ReconnectionManager:index#executeReconnection --> Unable to sync meetings, reconnecting.',\n syncError\n );\n throw new NeedsRetryError(syncError);\n }\n\n // TODO: try to improve this logic as the reconnection manager saves the instance of deleted meeting object\n // So that on rejoin it known what parametrs it was using\n if (!this.meeting || !this.webex.meetings.getMeetingByType(_ID_, this.meeting.id)) {\n LoggerProxy.logger.info(\n 'ReconnectionManager:index#executeReconnection --> Meeting got deleted due to inactivity or ended remotely.'\n );\n\n throw new Error('Unable to rejoin a meeting already ended or inactive.');\n }\n\n LoggerProxy.logger.info(\n `ReconnectionManager:index#executeReconnection --> Current state of meeting is ${this.meeting.state}`\n );\n\n // If the meeting state was left, no longer reconnect media\n if (this.meeting.state === _LEFT_) {\n if (this.meeting.type === _CALL_) {\n throw new Error('Unable to rejoin a call in LEFT state.');\n }\n\n throw new NeedsRejoinError({wasSharing});\n }\n\n try {\n const media = await this.reconnectMedia();\n\n LoggerProxy.logger.log(\n 'ReconnectionManager:index#executeReconnection --> webRTC media connection renewed and local sdp offer sent'\n );\n\n return media;\n } catch (error) {\n LoggerProxy.logger.error(\n 'ReconnectionManager:index#executeReconnection --> failed to renew webRTC media connection or initiate offer'\n );\n this.status = RECONNECTION.STATE.FAILURE;\n\n throw error;\n }\n }\n\n /**\n * Rejoins a meeting after detecting the member was in a LEFT state\n *\n * @async\n * @param {boolean} wasSharing\n * @returns {Promise}\n */\n async rejoinMeeting(wasSharing = false) {\n try {\n LoggerProxy.logger.info(\n 'ReconnectionManager:index#rejoinMeeting --> attemping meeting rejoin'\n );\n\n await this.meeting.join({rejoin: true});\n LoggerProxy.logger.info('ReconnectionManager:index#rejoinMeeting --> meeting rejoined');\n\n if (wasSharing) {\n await this.stopLocalShareStream(SHARE_STOPPED_REASON.MEETING_REJOIN);\n }\n } catch (joinError) {\n this.rejoinAttempts += 1;\n if (this.rejoinAttempts <= this.maxRejoinAttempts) {\n LoggerProxy.logger.info(\n `ReconnectionManager:index#rejoinMeeting --> Unable to rejoin meeting, attempt #${this.rejoinAttempts}, retrying.`,\n joinError\n );\n this.rejoinMeeting();\n } else {\n LoggerProxy.logger.error(\n 'ReconnectionManager:index#rejoinMeeting --> Unable to rejoin meeting after max attempts.',\n joinError\n );\n Metrics.sendBehavioralMetric(BEHAVIORAL_METRICS.MEETING_MAX_REJOIN_FAILURE, {\n locus_id: this.meeting.locusUrl.split('/').pop(),\n reason: joinError.message,\n stack: joinError.stack,\n });\n this.status = RECONNECTION.STATE.FAILURE;\n throw joinError;\n }\n }\n\n try {\n await this.reconnectMedia();\n } catch (mediaError) {\n LoggerProxy.logger.error(\n 'ReconnectionManager:index#rejoinMeeting --> Unable to reestablish media after rejoining.',\n mediaError\n );\n throw mediaError;\n }\n }\n\n /**\n * @returns {Promise}\n * @private\n * @memberof ReconnectionManager\n */\n async reconnectMedia() {\n LoggerProxy.logger.log('ReconnectionManager:index#reconnectMedia --> do turn discovery');\n\n // do the TURN server discovery again and ignore reachability results since the TURN server might change\n const turnServerResult = await this.meeting.roap.doTurnDiscovery(this.meeting, true, true);\n\n const iceServers = [];\n\n if (turnServerResult.turnServerInfo) {\n iceServers.push({\n urls: turnServerResult.turnServerInfo.url,\n username: turnServerResult.turnServerInfo.username || '',\n credential: turnServerResult.turnServerInfo.password || '',\n });\n }\n\n LoggerProxy.logger.log(\n 'ReconnectionManager:index#reconnectMedia --> renew webRTC media connection and send local sdp offer'\n );\n\n await this.meeting.mediaProperties.webrtcMediaConnection.reconnect(iceServers);\n\n // resend media requests\n if (this.meeting.isMultistream) {\n Object.values(this.meeting.mediaRequestManagers).forEach(\n (mediaRequestManager: MediaRequestManager) => {\n mediaRequestManager.clearPreviousRequests();\n mediaRequestManager.commit();\n }\n );\n }\n }\n\n /**\n * Attempt to Reconnect Mercury Websocket\n * @returns {Promise}\n * @private\n * @memberof ReconnectionManager\n */\n private async reconnectMercuryWebSocket() {\n LoggerProxy.logger.info(\n 'ReconnectionManager:index#reconnectMercuryWebSocket --> Reconnecting websocket.'\n );\n // First, attempt to disconnect if we think we are already connected.\n if (this.webex.internal.mercury.connected) {\n LoggerProxy.logger.info(\n 'ReconnectionManager:index#reconnectMercuryWebSocket --> Disconnecting existing websocket.'\n );\n try {\n await this.webex.internal.mercury.disconnect();\n LoggerProxy.logger.info(\n 'ReconnectionManager:index#reconnectMercuryWebSocket --> Websocket disconnected successfully.'\n );\n } catch (disconnectError) {\n // If we can't disconnect, the sdk is in such a bad state that reconnecting is not going to happen.\n LoggerProxy.logger.error(\n 'ReconnectionManager:index#reconnectMercuryWebSocket --> Unable to disconnect from websocket, giving up.',\n disconnectError\n );\n throw disconnectError;\n }\n }\n\n try {\n LoggerProxy.logger.info(\n 'ReconnectionManager:index#reconnectMercuryWebSocket --> Connecting websocket.'\n );\n await this.webex.internal.mercury.connect();\n LoggerProxy.logger.info(\n 'ReconnectionManager:index#reconnectMercuryWebSocket --> Websocket connected successfully.'\n );\n } catch (connectError) {\n LoggerProxy.logger.error(\n 'ReconnectionManager:index#reconnectMercuryWebSocket --> Unable to connect to websocket, giving up.',\n connectError\n );\n\n throw connectError;\n }\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAMA;AACA;AACA;AAUA;AACA;AACA;AAGA;AAA8D;AAAA;AAE9D;AACA;AACA;AACA;AACA;AACA;AALA,IAMMA,eAAe;EAAA;EAAA;EAAA;IAAA;IAAA;EAAA;EAAA;AAAA,+CAASC,KAAK;AAEnC;AACA;AACA;AACA;AACA;AACA;AALA,IAMMC,gBAAgB;EAAA;EAAA;EAGpB;AACF;AACA;AACA;AACA;AACA;AACA;EACE,gCAMG;IAAA;IAAA,IALDC,UAAU,QAAVA,UAAU;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BAAmB,CAACC,qBAAqB,EAAE;kBAC3CD,mBAAmB,CAACE,MAAM,EAAE;gBAC9B,CAAC,CACF;cACH;YAAC;YAAA;cAAA;UAAA;QAAA;MAAA,CACF;MAAA;QAAA;MAAA;MAAA;IAAA;IAED;AACF;AACA;AACA;AACA;AACA;EALE;IAAA;IAAA;MAAA,yGAMA;QAAA;UAAA;YAAA;cACE7F,oBAAW,CAACC,MAAM,CAACmB,IAAI,CACrB,iFAAiF,CAClF;cACD;cAAA,KACI,IAAI,CAAC3B,KAAK,CAACkC,QAAQ,CAACmE,OAAO,CAACC,SAAS;gBAAA;gBAAA;cAAA;cACvC/F,oBAAW,CAACC,MAAM,CAACmB,IAAI,CACrB,2FAA2F,CAC5F;cAAC;cAAA;cAAA,OAEM,IAAI,CAAC3B,KAAK,CAACkC,QAAQ,CAACmE,OAAO,CAACE,UAAU,EAAE;YAAA;cAC9ChG,oBAAW,CAACC,MAAM,CAACmB,IAAI,CACrB,8FAA8F,CAC/F;cAAC;cAAA;YAAA;cAAA;cAAA;cAEF;cACApB,oBAAW,CAACC,MAAM,CAAC1B,KAAK,CACtB,yGAAyG,eAE1G;cAAC;YAAA;cAAA;cAMJyB,oBAAW,CAACC,MAAM,CAACmB,IAAI,CACrB,+EAA+E,CAChF;cAAC;cAAA,OACI,IAAI,CAAC3B,KAAK,CAACkC,QAAQ,CAACmE,OAAO,CAACG,OAAO,EAAE;YAAA;cAC3CjG,oBAAW,CAACC,MAAM,CAACmB,IAAI,CACrB,2FAA2F,CAC5F;cAAC;cAAA;YAAA;cAAA;cAAA;cAEFpB,oBAAW,CAACC,MAAM,CAAC1B,KAAK,CACtB,oGAAoG,eAErG;cAAC;YAAA;YAAA;cAAA;UAAA;QAAA;MAAA,CAIL;MAAA;QAAA;MAAA;MAAA;IAAA;EAAA;EAAA;AAAA;AAAA"}
1
+ {"version":3,"names":["NeedsRetryError","Error","NeedsRejoinError","wasSharing","error","ReconnectionManager","meeting","iceState","disconnected","resolve","timer","undefined","timeoutDuration","config","reconnection","iceReconnectionTimeout","status","RECONNECTION","STATE","DEFAULT_STATUS","tryCount","DEFAULT_TRY_COUNT","webex","maxRejoinAttempts","rejoinAttempts","autoRejoinEnabled","autoRejoin","reset","clearTimeout","LoggerProxy","logger","log","resetReconnectionTimer","reject","setTimeout","reason","unpublishStreams","mediaProperties","shareVideoStream","shareAudioStream","Trigger","trigger","file","function","EVENT_TRIGGERS","MEETING_STOPPED_SHARING_LOCAL","IN_PROGRESS","enabled","COMPLETE","info","ReconnectInProgress","ReconnectionError","networkDisconnect","networkRetry","id","validate","internal","newMetrics","submitClientEvent","name","options","meetingId","meetings","startReachability","executeReconnection","media","reconnect","message","payload","errors","category","errorCode","fatal","shownToUser","rejoinMeeting","shareStatus","SHARE_STATUS","LOCAL_SHARE_ACTIVE","stopLocalShareStream","SHARE_STOPPED_REASON","MEDIA_RECONNECTION","reconnectMercuryWebSocket","device","url","FAILURE","syncMeetings","keepOnlyLocusMeetings","getMeetingByType","_ID_","state","_LEFT_","type","_CALL_","reconnectMedia","join","rejoin","MEETING_REJOIN","Metrics","sendBehavioralMetric","BEHAVIORAL_METRICS","MEETING_MAX_REJOIN_FAILURE","locus_id","locusUrl","split","pop","stack","roap","doTurnDiscovery","turnServerResult","iceServers","turnServerInfo","push","urls","username","credential","password","webrtcMediaConnection","isMultistream","mediaRequestManagers","forEach","mediaRequestManager","clearPreviousRequests","commit","mercury","connected","disconnect","connect"],"sources":["index.ts"],"sourcesContent":["/*!\n * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.\n */\n\n/* eslint-disable no-warning-comments */\n\nimport LoggerProxy from '../common/logs/logger-proxy';\nimport Trigger from '../common/events/trigger-proxy';\nimport {\n EVENT_TRIGGERS,\n RECONNECTION,\n SHARE_STATUS,\n SHARE_STOPPED_REASON,\n _CALL_,\n _LEFT_,\n _ID_,\n RECONNECTION_STATE,\n} from '../constants';\nimport BEHAVIORAL_METRICS from '../metrics/constants';\nimport ReconnectInProgress from '../common/errors/reconnection-in-progress';\nimport Metrics from '../metrics';\nimport Meeting from '../meeting';\nimport {MediaRequestManager} from '../multistream/mediaRequestManager';\nimport ReconnectionError from '../common/errors/reconnection';\n\n/**\n * Used to indicate that the reconnect logic needs to be retried.\n *\n * @class NeedsRetryError\n * @extends {Error}\n */\nclass NeedsRetryError extends Error {}\n\n/**\n * Used to indicate that the meeting needs to be rejoined, not just media reconnected\n *\n * @class NeedsRejoinError\n * @extends {Error}\n */\nclass NeedsRejoinError extends Error {\n wasSharing: any;\n\n /**\n * Creates an instance of NeedsRejoinError.\n * @param {Object} params\n * @param {boolean} params.wasSharing\n * @param {Error} params.error\n * @memberof NeedsRejoinError\n */\n constructor({\n wasSharing,\n error = new Error('Meeting needs to be rejoined'),\n }: {\n wasSharing?: boolean;\n error?: Error;\n }) {\n // @ts-ignore\n super(error);\n\n this.wasSharing = wasSharing;\n }\n}\n\n/**\n * @export\n * @class ReconnectionManager\n */\nexport default class ReconnectionManager {\n autoRejoinEnabled: any;\n iceState: any;\n maxRejoinAttempts: any;\n meeting: any;\n rejoinAttempts: any;\n shareStatus: any;\n status: any;\n tryCount: any;\n webex: any;\n /**\n * @param {Meeting} meeting\n */\n constructor(meeting: Meeting) {\n /**\n * Stores ICE reconnection state data.\n *\n * @instance\n * @type {Object}\n * @private\n * @memberof ReconnectionManager\n */\n this.iceState = {\n disconnected: false,\n resolve: () => {},\n timer: undefined,\n // @ts-ignore\n timeoutDuration: meeting.config.reconnection.iceReconnectionTimeout,\n };\n\n /**\n * @instance\n * @type {RECONNECTION_STATE}\n * @private\n * @memberof ReconnectionManager\n */\n this.status = RECONNECTION.STATE.DEFAULT_STATUS;\n /**\n * @instance\n * @type {Number}\n * @private\n * @memberof ReconnectionManager\n */\n this.tryCount = RECONNECTION.STATE.DEFAULT_TRY_COUNT;\n /**\n * @instance\n * @type {Object}\n * @private\n * @memberof ReconnectionManager\n */\n // TODO : change this logic to not save the meeting instance\n // It gets complicated when meeting ends on remote side , We have a old meeting instance which is not up to date\n // @ts-ignore\n this.webex = meeting.webex;\n /**\n * @instance\n * @type {Meeting}\n * @private\n * @memberof ReconnectionManager\n */\n // TODO: try removing the circular dependency for meeting and reconnection manager\n // try moving this to meetings collection\n this.meeting = meeting;\n\n // @ts-ignore\n this.maxRejoinAttempts = meeting.config.reconnection.maxRejoinAttempts;\n this.rejoinAttempts = RECONNECTION.STATE.DEFAULT_TRY_COUNT;\n // @ts-ignore\n this.autoRejoinEnabled = meeting.config.reconnection.autoRejoin;\n\n // Make sure reconnection state is in default\n this.reset();\n }\n\n /**\n * @public\n * @memberof ReconnectionManager\n * @returns {void}\n */\n resetReconnectionTimer() {\n this.iceState.resolve();\n this.iceState.resolve = () => {};\n\n if (this.iceState.timer) {\n clearTimeout(this.iceState.timer);\n delete this.iceState.timer;\n }\n }\n\n /**\n * Sets the iceState to connected and clears any disconnect timeouts and\n * related timeout data within the iceState.\n *\n * @returns {undefined}\n * @public\n * @memberof ReconnectionManager\n */\n public iceReconnected() {\n if (this.iceState.disconnected) {\n LoggerProxy.logger.log('ReconnectionManager:index#iceReconnected --> ice has reconnected');\n\n this.resetReconnectionTimer();\n\n this.iceState.disconnected = false;\n }\n }\n\n /**\n * Set the iceState to disconnected and generates a timeout that waits for the\n * iceState to reconnect and then resolves. If the ice state is already\n * processing a reconnect, it immediately resolves. Rejects if the timeout\n * duration is reached.\n *\n * @returns {Promise<undefined>}\n * @public\n * @memberof ReconnectionManager\n */\n public waitForIceReconnect() {\n if (!this.iceState.disconnected) {\n LoggerProxy.logger.log(\n 'ReconnectionManager:index#waitForIceReconnect --> waiting for ice reconnect'\n );\n\n this.iceState.disconnected = true;\n\n return new Promise<void>((resolve, reject) => {\n this.iceState.timer = setTimeout(() => {\n if (this.iceState.disconnected === false) {\n resolve();\n } else {\n this.iceState.disconnected = false;\n reject(\n new Error(`ice reconnection did not occur in ${this.iceState.timeoutDuration}ms`)\n );\n }\n }, this.iceState.timeoutDuration);\n\n this.iceState.resolve = resolve;\n });\n }\n\n // return a resolved promise to prevent multiple catch executions of reconnect\n return Promise.resolve();\n }\n\n /**\n * @returns {undefined}\n * @public\n * @memberof ReconnectionManager\n */\n public reset() {\n this.status = RECONNECTION.STATE.DEFAULT_STATUS;\n this.tryCount = RECONNECTION.STATE.DEFAULT_TRY_COUNT;\n this.rejoinAttempts = RECONNECTION.STATE.DEFAULT_TRY_COUNT;\n }\n\n /**\n * @returns {undefined}\n * @public\n * @memberof ReconnectionManager\n */\n public cleanUp() {\n this.reset();\n }\n\n /**\n * Stop the local share stream.\n *\n * @param {string} reason a {@link SHARE_STOPPED_REASON}\n * @returns {undefined}\n * @private\n * @memberof ReconnectionManager\n */\n private async stopLocalShareStream(reason: string) {\n await this.meeting.unpublishStreams([\n this.meeting.mediaProperties.shareVideoStream,\n this.meeting.mediaProperties.shareAudioStream,\n ]);\n Trigger.trigger(\n this.meeting,\n {\n file: 'reconnection-manager/index',\n function: 'stopLocalShareStream',\n },\n EVENT_TRIGGERS.MEETING_STOPPED_SHARING_LOCAL,\n {\n reason,\n }\n );\n }\n\n /**\n * @public\n * @memberof ReconnectionManager\n * @returns {Boolean} true if reconnection operation is in progress\n */\n isReconnectInProgress() {\n return this.status === RECONNECTION.STATE.IN_PROGRESS;\n }\n\n /**\n * Sets the reconnection status\n *\n * @public\n * @param {RECONNECTION_STATE} status\n * @memberof ReconnectionManager\n * @returns {undefined}\n */\n public setStatus(status: RECONNECTION_STATE) {\n this.status = status;\n }\n\n /**\n * @returns {Boolean}\n * @throws {ReconnectionError}\n * @private\n * @memberof ReconnectionManager\n */\n private validate() {\n if (this.meeting.config.reconnection.enabled) {\n if (\n this.status === RECONNECTION.STATE.DEFAULT_STATUS ||\n this.status === RECONNECTION.STATE.COMPLETE\n ) {\n return true;\n }\n\n LoggerProxy.logger.info(\n 'ReconnectionManager:index#validate --> Reconnection already in progress.'\n );\n\n throw new ReconnectInProgress('Reconnection already in progress.');\n }\n\n LoggerProxy.logger.info('ReconnectionManager:index#validate --> Reconnection is not enabled.');\n\n throw new ReconnectionError('Reconnection is not enabled.');\n }\n\n /**\n * Initiates a media reconnect for the active meeting\n * @param {Object} reconnectOptions\n * @param {boolean} [reconnectOptions.networkDisconnect=false] indicates if a network disconnect event happened\n * @param {boolean} [reconnectOptions.networkRetry=false] indicates if we are retrying the reconnect\n * @returns {Promise}\n * @public\n * @memberof ReconnectionManager\n */\n public async reconnect({\n networkDisconnect = false,\n networkRetry = false,\n }: {\n networkDisconnect?: boolean;\n networkRetry?: boolean;\n } = {}) {\n LoggerProxy.logger.info(\n `ReconnectionManager:index#reconnect --> Reconnection start for meeting ${this.meeting.id}.`\n );\n // First, validate that we can reconnect, if not, it will throw an error\n try {\n this.validate();\n } catch (error) {\n LoggerProxy.logger.info(\n 'ReconnectionManager:index#reconnect --> Reconnection unable to begin.',\n error\n );\n throw error;\n }\n\n if (!networkRetry) {\n // Only log START metrics on the initial reconnect\n LoggerProxy.logger.info(\n 'ReconnectionManager:index#reconnect --> Sending reconnect start metric.'\n );\n\n // @ts-ignore\n this.webex.internal.newMetrics.submitClientEvent({\n name: 'client.media.reconnecting',\n options: {\n meetingId: this.meeting.id,\n },\n });\n }\n\n try {\n await this.webex.meetings.startReachability();\n } catch (err) {\n LoggerProxy.logger.info(\n 'ReconnectionManager:index#reconnect --> Reachability failed, continuing with reconnection attempt, err: ',\n err\n );\n }\n\n try {\n const media = await this.executeReconnection({networkDisconnect});\n\n return media;\n } catch (reconnectError) {\n if (reconnectError instanceof NeedsRetryError) {\n LoggerProxy.logger.info(\n 'ReconnectionManager:index#reconnect --> Reconnection not successful, retrying.'\n );\n // Reset our reconnect status since we are looping back to the beginning\n this.status = RECONNECTION.STATE.DEFAULT_STATUS;\n\n // This is a network retry, so we should not log START metrics again\n return this.reconnect({networkDisconnect: true, networkRetry: true});\n }\n\n // Reconnect has failed\n LoggerProxy.logger.error(\n 'ReconnectionManager:index#reconnect --> Reconnection failed.',\n reconnectError.message\n );\n LoggerProxy.logger.info(\n 'ReconnectionManager:index#reconnect --> Sending reconnect abort metric.'\n );\n\n // send call aborted event with catogery as expected as we are trying to rejoin\n // @ts-ignore\n this.webex.internal.newMetrics.submitClientEvent({\n name: 'client.call.aborted',\n payload: {\n errors: [\n {\n category: 'expected',\n errorCode: 2008,\n fatal: true,\n name: 'media-engine',\n shownToUser: false,\n },\n ],\n },\n options: {\n meetingId: this.meeting.id,\n },\n });\n\n if (reconnectError instanceof NeedsRejoinError && this.autoRejoinEnabled) {\n return this.rejoinMeeting(reconnectError.wasSharing);\n }\n\n throw reconnectError;\n }\n }\n\n /**\n * @param {Object} reconnectOptions\n * @param {boolean} [reconnectOptions.networkDisconnect=false] indicates if a network disconnect event happened\n * @returns {Promise}\n * @throws {NeedsRetryError}\n * @private\n * @memberof ReconnectionManager\n */\n private async executeReconnection({networkDisconnect = false}: {networkDisconnect?: boolean}) {\n this.status = RECONNECTION.STATE.IN_PROGRESS;\n\n LoggerProxy.logger.info(\n 'ReconnectionManager:index#executeReconnection --> Attempting to reconnect to meeting.'\n );\n\n const wasSharing = this.meeting.shareStatus === SHARE_STATUS.LOCAL_SHARE_ACTIVE;\n\n if (wasSharing) {\n await this.stopLocalShareStream(SHARE_STOPPED_REASON.MEDIA_RECONNECTION);\n }\n\n if (networkDisconnect) {\n try {\n await this.reconnectMercuryWebSocket();\n LoggerProxy.logger.error(\n 'ReconnectionManager:index#executeReconnection --> Websocket reconnected.',\n this.webex.internal.device.url\n );\n } catch (error) {\n LoggerProxy.logger.error(\n 'ReconnectionManager:index#executeReconnection --> Unable to reconnect to websocket, giving up.'\n );\n this.status = RECONNECTION.STATE.FAILURE;\n throw error;\n }\n }\n\n try {\n LoggerProxy.logger.info(\n 'ReconnectionManager:index#executeReconnection --> Updating meeting data from server.'\n );\n await this.webex.meetings.syncMeetings({keepOnlyLocusMeetings: false});\n } catch (syncError) {\n LoggerProxy.logger.info(\n 'ReconnectionManager:index#executeReconnection --> Unable to sync meetings, reconnecting.',\n syncError\n );\n throw new NeedsRetryError(syncError);\n }\n\n // TODO: try to improve this logic as the reconnection manager saves the instance of deleted meeting object\n // So that on rejoin it known what parametrs it was using\n if (!this.meeting || !this.webex.meetings.getMeetingByType(_ID_, this.meeting.id)) {\n LoggerProxy.logger.info(\n 'ReconnectionManager:index#executeReconnection --> Meeting got deleted due to inactivity or ended remotely.'\n );\n\n throw new Error('Unable to rejoin a meeting already ended or inactive.');\n }\n\n LoggerProxy.logger.info(\n `ReconnectionManager:index#executeReconnection --> Current state of meeting is ${this.meeting.state}`\n );\n\n // If the meeting state was left, no longer reconnect media\n if (this.meeting.state === _LEFT_) {\n if (this.meeting.type === _CALL_) {\n throw new Error('Unable to rejoin a call in LEFT state.');\n }\n\n throw new NeedsRejoinError({wasSharing});\n }\n\n try {\n const media = await this.reconnectMedia();\n\n LoggerProxy.logger.log(\n 'ReconnectionManager:index#executeReconnection --> webRTC media connection renewed and local sdp offer sent'\n );\n\n return media;\n } catch (error) {\n LoggerProxy.logger.error(\n 'ReconnectionManager:index#executeReconnection --> failed to renew webRTC media connection or initiate offer'\n );\n this.status = RECONNECTION.STATE.FAILURE;\n\n throw error;\n }\n }\n\n /**\n * Rejoins a meeting after detecting the member was in a LEFT state\n *\n * @async\n * @param {boolean} wasSharing\n * @returns {Promise}\n */\n async rejoinMeeting(wasSharing = false) {\n try {\n LoggerProxy.logger.info(\n 'ReconnectionManager:index#rejoinMeeting --> attemping meeting rejoin'\n );\n\n await this.meeting.join({rejoin: true});\n LoggerProxy.logger.info('ReconnectionManager:index#rejoinMeeting --> meeting rejoined');\n\n if (wasSharing) {\n await this.stopLocalShareStream(SHARE_STOPPED_REASON.MEETING_REJOIN);\n }\n } catch (joinError) {\n this.rejoinAttempts += 1;\n if (this.rejoinAttempts <= this.maxRejoinAttempts) {\n LoggerProxy.logger.info(\n `ReconnectionManager:index#rejoinMeeting --> Unable to rejoin meeting, attempt #${this.rejoinAttempts}, retrying.`,\n joinError\n );\n this.rejoinMeeting();\n } else {\n LoggerProxy.logger.error(\n 'ReconnectionManager:index#rejoinMeeting --> Unable to rejoin meeting after max attempts.',\n joinError\n );\n Metrics.sendBehavioralMetric(BEHAVIORAL_METRICS.MEETING_MAX_REJOIN_FAILURE, {\n locus_id: this.meeting.locusUrl.split('/').pop(),\n reason: joinError.message,\n stack: joinError.stack,\n });\n this.status = RECONNECTION.STATE.FAILURE;\n throw joinError;\n }\n }\n\n try {\n await this.reconnectMedia();\n } catch (mediaError) {\n LoggerProxy.logger.error(\n 'ReconnectionManager:index#rejoinMeeting --> Unable to reestablish media after rejoining.',\n mediaError\n );\n throw mediaError;\n }\n }\n\n /**\n * @returns {Promise}\n * @private\n * @memberof ReconnectionManager\n */\n async reconnectMedia() {\n LoggerProxy.logger.log('ReconnectionManager:index#reconnectMedia --> do turn discovery');\n\n // do the TURN server discovery again and ignore reachability results since the TURN server might change\n const turnServerResult = await this.meeting.roap.doTurnDiscovery(this.meeting, true, true);\n\n const iceServers = [];\n\n if (turnServerResult.turnServerInfo?.url) {\n iceServers.push({\n urls: turnServerResult.turnServerInfo.url,\n username: turnServerResult.turnServerInfo.username || '',\n credential: turnServerResult.turnServerInfo.password || '',\n });\n }\n\n LoggerProxy.logger.log(\n 'ReconnectionManager:index#reconnectMedia --> renew webRTC media connection and send local sdp offer'\n );\n\n await this.meeting.mediaProperties.webrtcMediaConnection.reconnect(iceServers);\n\n // resend media requests\n if (this.meeting.isMultistream) {\n Object.values(this.meeting.mediaRequestManagers).forEach(\n (mediaRequestManager: MediaRequestManager) => {\n mediaRequestManager.clearPreviousRequests();\n mediaRequestManager.commit();\n }\n );\n }\n }\n\n /**\n * Attempt to Reconnect Mercury Websocket\n * @returns {Promise}\n * @private\n * @memberof ReconnectionManager\n */\n private async reconnectMercuryWebSocket() {\n LoggerProxy.logger.info(\n 'ReconnectionManager:index#reconnectMercuryWebSocket --> Reconnecting websocket.'\n );\n // First, attempt to disconnect if we think we are already connected.\n if (this.webex.internal.mercury.connected) {\n LoggerProxy.logger.info(\n 'ReconnectionManager:index#reconnectMercuryWebSocket --> Disconnecting existing websocket.'\n );\n try {\n await this.webex.internal.mercury.disconnect();\n LoggerProxy.logger.info(\n 'ReconnectionManager:index#reconnectMercuryWebSocket --> Websocket disconnected successfully.'\n );\n } catch (disconnectError) {\n // If we can't disconnect, the sdk is in such a bad state that reconnecting is not going to happen.\n LoggerProxy.logger.error(\n 'ReconnectionManager:index#reconnectMercuryWebSocket --> Unable to disconnect from websocket, giving up.',\n disconnectError\n );\n throw disconnectError;\n }\n }\n\n try {\n LoggerProxy.logger.info(\n 'ReconnectionManager:index#reconnectMercuryWebSocket --> Connecting websocket.'\n );\n await this.webex.internal.mercury.connect();\n LoggerProxy.logger.info(\n 'ReconnectionManager:index#reconnectMercuryWebSocket --> Websocket connected successfully.'\n );\n } catch (connectError) {\n LoggerProxy.logger.error(\n 'ReconnectionManager:index#reconnectMercuryWebSocket --> Unable to connect to websocket, giving up.',\n connectError\n );\n\n throw connectError;\n }\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAMA;AACA;AACA;AAUA;AACA;AACA;AAGA;AAA8D;AAAA;AAE9D;AACA;AACA;AACA;AACA;AACA;AALA,IAMMA,eAAe;EAAA;EAAA;EAAA;IAAA;IAAA;EAAA;EAAA;AAAA,+CAASC,KAAK;AAEnC;AACA;AACA;AACA;AACA;AACA;AALA,IAMMC,gBAAgB;EAAA;EAAA;EAGpB;AACF;AACA;AACA;AACA;AACA;AACA;EACE,gCAMG;IAAA;IAAA,IALDC,UAAU,QAAVA,UAAU;MAAA,kBACVC,KAAK;MAALA,KAAK,2BAAG,IAAIH,KAAK,CAAC,8BAA8B,CAAC;IAAA;IAKjD;IACA,2BAAMG,KAAK;IAAE;IAEb,MAAKD,UAAU,GAAGA,UAAU;IAAC;EAC/B;EAAC;AAAA,+CArB4BF,KAAK;AAwBpC;AACA;AACA;AACA;AAHA,IAIqBI,mBAAmB;EAUtC;AACF;AACA;EACE,6BAAYC,OAAgB,EAAE;I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F,oBAAW,CAACC,MAAM,CAACmB,IAAI,CACrB,iFAAiF,CAClF;cACD;cAAA,KACI,IAAI,CAAC3B,KAAK,CAACkC,QAAQ,CAACmE,OAAO,CAACC,SAAS;gBAAA;gBAAA;cAAA;cACvC/F,oBAAW,CAACC,MAAM,CAACmB,IAAI,CACrB,2FAA2F,CAC5F;cAAC;cAAA;cAAA,OAEM,IAAI,CAAC3B,KAAK,CAACkC,QAAQ,CAACmE,OAAO,CAACE,UAAU,EAAE;YAAA;cAC9ChG,oBAAW,CAACC,MAAM,CAACmB,IAAI,CACrB,8FAA8F,CAC/F;cAAC;cAAA;YAAA;cAAA;cAAA;cAEF;cACApB,oBAAW,CAACC,MAAM,CAAC1B,KAAK,CACtB,yGAAyG,eAE1G;cAAC;YAAA;cAAA;cAMJyB,oBAAW,CAACC,MAAM,CAACmB,IAAI,CACrB,+EAA+E,CAChF;cAAC;cAAA,OACI,IAAI,CAAC3B,KAAK,CAACkC,QAAQ,CAACmE,OAAO,CAACG,OAAO,EAAE;YAAA;cAC3CjG,oBAAW,CAACC,MAAM,CAACmB,IAAI,CACrB,2FAA2F,CAC5F;cAAC;cAAA;YAAA;cAAA;cAAA;cAEFpB,oBAAW,CAACC,MAAM,CAAC1B,KAAK,CACtB,oGAAoG,eAErG;cAAC;YAAA;YAAA;cAAA;UAAA;QAAA;MAAA,CAIL;MAAA;QAAA;MAAA;MAAA;IAAA;EAAA;EAAA;AAAA;AAAA"}
@@ -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.0.0-beta.386"
65
+ version: "3.0.0-beta.388"
66
66
  });
67
67
  var _default = Webinar;
68
68
  exports.default = _default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webex/plugin-meetings",
3
- "version": "3.0.0-beta.386",
3
+ "version": "3.0.0-beta.388",
4
4
  "description": "",
5
5
  "license": "Cisco EULA (https://www.cisco.com/c/en/us/products/end-user-license-agreement.html)",
6
6
  "contributors": [
@@ -33,12 +33,12 @@
33
33
  },
34
34
  "devDependencies": {
35
35
  "@peculiar/webcrypto": "^1.4.3",
36
- "@webex/plugin-meetings": "3.0.0-beta.386",
37
- "@webex/test-helper-chai": "3.0.0-beta.386",
38
- "@webex/test-helper-mocha": "3.0.0-beta.386",
39
- "@webex/test-helper-mock-webex": "3.0.0-beta.386",
40
- "@webex/test-helper-retry": "3.0.0-beta.386",
41
- "@webex/test-helper-test-users": "3.0.0-beta.386",
36
+ "@webex/plugin-meetings": "3.0.0-beta.388",
37
+ "@webex/test-helper-chai": "3.0.0-beta.388",
38
+ "@webex/test-helper-mocha": "3.0.0-beta.388",
39
+ "@webex/test-helper-mock-webex": "3.0.0-beta.388",
40
+ "@webex/test-helper-retry": "3.0.0-beta.388",
41
+ "@webex/test-helper-test-users": "3.0.0-beta.388",
42
42
  "chai": "^4.3.4",
43
43
  "chai-as-promised": "^7.1.1",
44
44
  "jsdom-global": "3.0.2",
@@ -47,19 +47,19 @@
47
47
  "typescript": "^4.7.4"
48
48
  },
49
49
  "dependencies": {
50
- "@webex/common": "3.0.0-beta.386",
50
+ "@webex/common": "3.0.0-beta.388",
51
51
  "@webex/internal-media-core": "2.2.9",
52
- "@webex/internal-plugin-conversation": "3.0.0-beta.386",
53
- "@webex/internal-plugin-device": "3.0.0-beta.386",
54
- "@webex/internal-plugin-llm": "3.0.0-beta.386",
55
- "@webex/internal-plugin-mercury": "3.0.0-beta.386",
56
- "@webex/internal-plugin-metrics": "3.0.0-beta.386",
57
- "@webex/internal-plugin-support": "3.0.0-beta.386",
58
- "@webex/internal-plugin-user": "3.0.0-beta.386",
59
- "@webex/media-helpers": "3.0.0-beta.386",
60
- "@webex/plugin-people": "3.0.0-beta.386",
61
- "@webex/plugin-rooms": "3.0.0-beta.386",
62
- "@webex/webex-core": "3.0.0-beta.386",
52
+ "@webex/internal-plugin-conversation": "3.0.0-beta.388",
53
+ "@webex/internal-plugin-device": "3.0.0-beta.388",
54
+ "@webex/internal-plugin-llm": "3.0.0-beta.388",
55
+ "@webex/internal-plugin-mercury": "3.0.0-beta.388",
56
+ "@webex/internal-plugin-metrics": "3.0.0-beta.388",
57
+ "@webex/internal-plugin-support": "3.0.0-beta.388",
58
+ "@webex/internal-plugin-user": "3.0.0-beta.388",
59
+ "@webex/media-helpers": "3.0.0-beta.388",
60
+ "@webex/plugin-people": "3.0.0-beta.388",
61
+ "@webex/plugin-rooms": "3.0.0-beta.388",
62
+ "@webex/webex-core": "3.0.0-beta.388",
63
63
  "ampersand-collection": "^2.0.2",
64
64
  "bowser": "^2.11.0",
65
65
  "btoa": "^1.2.1",
@@ -160,7 +160,9 @@ Media.createMediaConnection = (
160
160
 
161
161
  const iceServers = [];
162
162
 
163
- if (turnServerInfo) {
163
+ // we might not have any TURN server if TURN discovery failed or wasn't done or
164
+ // we might get an empty TURN url if we land on a video mesh node
165
+ if (turnServerInfo?.url) {
164
166
  iceServers.push({
165
167
  urls: turnServerInfo.url,
166
168
  username: turnServerInfo.username || '',
@@ -568,7 +568,7 @@ export default class ReconnectionManager {
568
568
 
569
569
  const iceServers = [];
570
570
 
571
- if (turnServerResult.turnServerInfo) {
571
+ if (turnServerResult.turnServerInfo?.url) {
572
572
  iceServers.push({
573
573
  urls: turnServerResult.turnServerInfo.url,
574
574
  username: turnServerResult.turnServerInfo.username || '',
@@ -165,37 +165,15 @@ describe('createMediaConnection', () => {
165
165
  );
166
166
  });
167
167
 
168
- it('passes empty ICE servers array to MultistreamRoapMediaConnection if turnServerInfo is undefined (multistream enabled)', () => {
169
- const multistreamRoapMediaConnectionConstructorStub = sinon
170
- .stub(internalMediaModule, 'MultistreamRoapMediaConnection')
171
- .returns(fakeRoapMediaConnection);
172
-
173
- Media.createMediaConnection(true, 'debug string', webex, 'meeting id', 'correlationId', {
174
- mediaProperties: {
175
- mediaDirection: {
176
- sendAudio: true,
177
- sendVideo: true,
178
- sendShare: false,
179
- receiveAudio: true,
180
- receiveVideo: true,
181
- receiveShare: true,
182
- },
183
- },
184
- });
185
- assert.calledOnce(multistreamRoapMediaConnectionConstructorStub);
186
- assert.calledWith(
187
- multistreamRoapMediaConnectionConstructorStub,
188
- {
189
- iceServers: [],
190
- },
191
- 'meeting id'
192
- );
193
-
194
- it('does not pass bundlePolicy to MultistreamRoapMediaConnection if bundlePolicy is undefined', () => {
168
+ [
169
+ {testCase: 'turnServerInfo is undefined', turnServerInfo: undefined},
170
+ {testCase: 'turnServerInfo.url is empty string', turnServerInfo: {url: '', username: 'turn username', password: 'turn password'}},
171
+ ].forEach(({testCase, turnServerInfo}) => {
172
+ it(`passes empty ICE servers array to MultistreamRoapMediaConnection if ${testCase} (multistream enabled)`, () => {
195
173
  const multistreamRoapMediaConnectionConstructorStub = sinon
196
174
  .stub(internalMediaModule, 'MultistreamRoapMediaConnection')
197
175
  .returns(fakeRoapMediaConnection);
198
-
176
+
199
177
  Media.createMediaConnection(true, 'debug string', webex, 'meeting id', 'correlationId', {
200
178
  mediaProperties: {
201
179
  mediaDirection: {
@@ -207,7 +185,7 @@ describe('createMediaConnection', () => {
207
185
  receiveShare: true,
208
186
  },
209
187
  },
210
- bundlePolicy: undefined,
188
+ turnServerInfo,
211
189
  });
212
190
  assert.calledOnce(multistreamRoapMediaConnectionConstructorStub);
213
191
  assert.calledWith(
@@ -216,75 +194,108 @@ describe('createMediaConnection', () => {
216
194
  iceServers: [],
217
195
  },
218
196
  'meeting id'
219
- );
197
+ );
220
198
  });
221
199
  });
222
-
223
- it('passes empty ICE servers array to RoapMediaConnection if turnServerInfo is undefined (multistream disabled)', () => {
224
- const roapMediaConnectionConstructorStub = sinon
225
- .stub(internalMediaModule, 'RoapMediaConnection')
200
+
201
+ it('does not pass bundlePolicy to MultistreamRoapMediaConnection if bundlePolicy is undefined', () => {
202
+ const multistreamRoapMediaConnectionConstructorStub = sinon
203
+ .stub(internalMediaModule, 'MultistreamRoapMediaConnection')
226
204
  .returns(fakeRoapMediaConnection);
227
205
 
228
- StaticConfig.set({bandwidth: {audio: 123, video: 456, startBitrate: 999}});
229
-
230
- const ENABLE_EXTMAP = false;
231
- const ENABLE_RTX = true;
232
-
233
- Media.createMediaConnection(false, 'some debug id', webex, 'meeting id', 'correlationId', {
206
+ Media.createMediaConnection(true, 'debug string', webex, 'meeting id', 'correlationId', {
234
207
  mediaProperties: {
235
208
  mediaDirection: {
236
209
  sendAudio: true,
237
210
  sendVideo: true,
238
- sendShare: true,
211
+ sendShare: false,
239
212
  receiveAudio: true,
240
213
  receiveVideo: true,
241
214
  receiveShare: true,
242
215
  },
243
- audioStream: fakeAudioStream,
244
- videoStream: null,
245
- shareVideoStream: fakeShareVideoStream,
246
- shareAudioStream: fakeShareAudioStream,
247
216
  },
248
- remoteQualityLevel: 'HIGH',
249
- enableRtx: ENABLE_RTX,
250
- enableExtmap: ENABLE_EXTMAP,
251
- turnServerInfo: undefined,
217
+ bundlePolicy: undefined,
252
218
  });
253
- assert.calledOnce(roapMediaConnectionConstructorStub);
219
+ assert.calledOnce(multistreamRoapMediaConnectionConstructorStub);
254
220
  assert.calledWith(
255
- roapMediaConnectionConstructorStub,
221
+ multistreamRoapMediaConnectionConstructorStub,
256
222
  {
257
223
  iceServers: [],
258
- skipInactiveTransceivers: false,
259
- requireH264: true,
260
- sdpMunging: {
261
- convertPort9to0: false,
262
- addContentSlides: true,
263
- bandwidthLimits: {
264
- audio: 123,
265
- video: 456,
224
+ },
225
+ 'meeting id'
226
+ );
227
+ });
228
+
229
+ [
230
+ {testCase: 'turnServerInfo is undefined', turnServerInfo: undefined},
231
+ {testCase: 'turnServerInfo.url is empty string', turnServerInfo: {url: '', username: 'turn username', password: 'turn password'}},
232
+ ].forEach(({testCase, turnServerInfo}) => {
233
+ it(`passes empty ICE servers array to RoapMediaConnection if ${testCase} (multistream disabled)`, () => {
234
+ const roapMediaConnectionConstructorStub = sinon
235
+ .stub(internalMediaModule, 'RoapMediaConnection')
236
+ .returns(fakeRoapMediaConnection);
237
+
238
+ StaticConfig.set({bandwidth: {audio: 123, video: 456, startBitrate: 999}});
239
+
240
+ const ENABLE_EXTMAP = false;
241
+ const ENABLE_RTX = true;
242
+
243
+ Media.createMediaConnection(false, 'some debug id', webex, 'meeting id', 'correlationId', {
244
+ mediaProperties: {
245
+ mediaDirection: {
246
+ sendAudio: true,
247
+ sendVideo: true,
248
+ sendShare: true,
249
+ receiveAudio: true,
250
+ receiveVideo: true,
251
+ receiveShare: true,
266
252
  },
267
- startBitrate: 999,
268
- periodicKeyframes: 20,
269
- disableExtmap: !ENABLE_EXTMAP,
270
- disableRtx: !ENABLE_RTX,
253
+ audioStream: fakeAudioStream,
254
+ videoStream: null,
255
+ shareVideoStream: fakeShareVideoStream,
256
+ shareAudioStream: fakeShareAudioStream,
271
257
  },
272
- },
273
- {
274
- localTracks: {
275
- audio: fakeTrack,
276
- video: undefined,
277
- screenShareVideo: fakeTrack,
278
- screenShareAudio: fakeTrack,
258
+ remoteQualityLevel: 'HIGH',
259
+ enableRtx: ENABLE_RTX,
260
+ enableExtmap: ENABLE_EXTMAP,
261
+ turnServerInfo,
262
+ });
263
+ assert.calledOnce(roapMediaConnectionConstructorStub);
264
+ assert.calledWith(
265
+ roapMediaConnectionConstructorStub,
266
+ {
267
+ iceServers: [],
268
+ skipInactiveTransceivers: false,
269
+ requireH264: true,
270
+ sdpMunging: {
271
+ convertPort9to0: false,
272
+ addContentSlides: true,
273
+ bandwidthLimits: {
274
+ audio: 123,
275
+ video: 456,
276
+ },
277
+ startBitrate: 999,
278
+ periodicKeyframes: 20,
279
+ disableExtmap: !ENABLE_EXTMAP,
280
+ disableRtx: !ENABLE_RTX,
281
+ },
279
282
  },
280
- direction: {
281
- audio: 'sendrecv',
282
- video: 'sendrecv',
283
- screenShareVideo: 'sendrecv',
283
+ {
284
+ localTracks: {
285
+ audio: fakeTrack,
286
+ video: undefined,
287
+ screenShareVideo: fakeTrack,
288
+ screenShareAudio: fakeTrack,
289
+ },
290
+ direction: {
291
+ audio: 'sendrecv',
292
+ video: 'sendrecv',
293
+ screenShareVideo: 'sendrecv',
294
+ },
295
+ remoteQualityLevel: 'HIGH',
284
296
  },
285
- remoteQualityLevel: 'HIGH',
286
- },
287
- 'some debug id'
288
- );
297
+ 'some debug id'
298
+ );
299
+ });
289
300
  });
290
301
  });
@@ -2652,7 +2652,7 @@ describe('plugin-meetings', () => {
2652
2652
  meeting.webex.meetings.geoHintInfo = {regionCode: 'EU', countryCode: 'UK'};
2653
2653
  meeting.roap.doTurnDiscovery = sinon
2654
2654
  .stub()
2655
- .resolves({turnServerInfo: {}, turnDiscoverySkippedReason: 'reachability'});
2655
+ .resolves({turnServerInfo: { url: 'turn-url', username: 'turn user', password: 'turn password'}, turnDiscoverySkippedReason: 'reachability'});
2656
2656
  meeting.deferSDPAnswer = new Defer();
2657
2657
  meeting.deferSDPAnswer.resolve();
2658
2658
  meeting.webex.meetings.meetingCollection = new MeetingCollection();
@@ -2663,7 +2663,7 @@ describe('plugin-meetings', () => {
2663
2663
  // setup things that are expected to be the same across all the tests and are actually irrelevant for these tests
2664
2664
  expectedDebugId = `MC-${meeting.id.substring(0, 4)}`;
2665
2665
  expectedMediaConnectionConfig = {
2666
- iceServers: [{urls: undefined, username: '', credential: ''}],
2666
+ iceServers: [{urls: 'turn-url', username: 'turn user', credential: 'turn password'}],
2667
2667
  skipInactiveTransceivers: false,
2668
2668
  requireH264: true,
2669
2669
  sdpMunging: {
@@ -144,6 +144,34 @@ describe('plugin-meetings', () => {
144
144
  });
145
145
  });
146
146
 
147
+ // this can happen when we land on a video mesh node
148
+ it('does not use TURN server if TURN url is an empty string', async () => {
149
+ const rm = new ReconnectionManager(fakeMeeting);
150
+
151
+ fakeMeeting.roap.doTurnDiscovery.resolves({
152
+ turnServerInfo: {
153
+ url: '',
154
+ username: 'whatever',
155
+ password: 'whatever',
156
+ },
157
+ turnDiscoverySkippedReason: undefined,
158
+ });
159
+
160
+ await rm.reconnect();
161
+
162
+ assert.calledOnce(fakeMeeting.roap.doTurnDiscovery);
163
+ assert.calledWith(fakeMeeting.roap.doTurnDiscovery, fakeMeeting, true, true);
164
+ assert.calledOnce(fakeMediaConnection.reconnect);
165
+ assert.calledWith(fakeMediaConnection.reconnect, []);
166
+
167
+ assert.calledWith(fakeMeeting.webex.internal.newMetrics.submitClientEvent, {
168
+ name: 'client.media.reconnecting',
169
+ options: {
170
+ meetingId: rm.meeting.id,
171
+ },
172
+ });
173
+ });
174
+
147
175
  it('does not clear previous requests and re-request media for non-multistream meetings', async () => {
148
176
  fakeMeeting.isMultistream = false;
149
177
  const rm = new ReconnectionManager(fakeMeeting);