@webex/plugin-meetings 3.0.0-beta.111 → 3.0.0-beta.113

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.
Files changed (44) hide show
  1. package/README.md +45 -1
  2. package/dist/breakouts/breakout.js +1 -1
  3. package/dist/breakouts/index.js +1 -1
  4. package/dist/media/index.js +0 -21
  5. package/dist/media/index.js.map +1 -1
  6. package/dist/meeting/index.js +19 -0
  7. package/dist/meeting/index.js.map +1 -1
  8. package/dist/meeting/locusMediaRequest.js +288 -0
  9. package/dist/meeting/locusMediaRequest.js.map +1 -0
  10. package/dist/meeting/muteState.js +49 -34
  11. package/dist/meeting/muteState.js.map +1 -1
  12. package/dist/meeting/request.js +12 -47
  13. package/dist/meeting/request.js.map +1 -1
  14. package/dist/meeting/util.js +20 -19
  15. package/dist/meeting/util.js.map +1 -1
  16. package/dist/roap/index.js +4 -19
  17. package/dist/roap/index.js.map +1 -1
  18. package/dist/roap/request.js +23 -39
  19. package/dist/roap/request.js.map +1 -1
  20. package/dist/roap/turnDiscovery.js +2 -10
  21. package/dist/roap/turnDiscovery.js.map +1 -1
  22. package/dist/types/meeting/index.d.ts +3 -0
  23. package/dist/types/meeting/locusMediaRequest.d.ts +68 -0
  24. package/dist/types/meeting/muteState.d.ts +3 -2
  25. package/dist/types/meeting/request.d.ts +4 -18
  26. package/dist/types/roap/request.d.ts +6 -8
  27. package/dist/types/roap/turnDiscovery.d.ts +4 -1
  28. package/package.json +19 -19
  29. package/src/media/index.ts +0 -23
  30. package/src/meeting/index.ts +22 -0
  31. package/src/meeting/locusMediaRequest.ts +303 -0
  32. package/src/meeting/muteState.ts +24 -9
  33. package/src/meeting/request.ts +15 -51
  34. package/src/meeting/util.ts +17 -13
  35. package/src/roap/index.ts +4 -16
  36. package/src/roap/request.ts +22 -42
  37. package/src/roap/turnDiscovery.ts +2 -8
  38. package/test/unit/spec/meeting/locusMediaRequest.ts +414 -0
  39. package/test/unit/spec/meeting/muteState.js +97 -71
  40. package/test/unit/spec/meeting/request.js +19 -0
  41. package/test/unit/spec/meeting/utils.js +31 -37
  42. package/test/unit/spec/roap/index.ts +2 -37
  43. package/test/unit/spec/roap/request.ts +27 -57
  44. package/test/unit/spec/roap/turnDiscovery.ts +3 -5
package/README.md CHANGED
@@ -331,7 +331,6 @@ webex.meetings.on('meeting:added', (addedMeeting) => {
331
331
  addedMeeting.join().then(() => {});
332
332
  }
333
333
  ```
334
-
335
334
  ##### Reject an incoming meeting
336
335
 
337
336
  When listening to an added meeting, to determine if it is an "incoming" meeting, check the type property of the meeting:
@@ -457,6 +456,51 @@ audioOutputSelect.onchange = function () {
457
456
  attachSinkId(document.getElementById('remoteaudio'), audioOutputSelect.value);
458
457
  };
459
458
  ```
459
+ ##### Availabel joining options
460
+ ```
461
+ /**
462
+ * Make a network request to join a meeting
463
+ * @param {Object} options
464
+ * @param {String} options.sipUri
465
+ * @param {String} options.deviceUrl
466
+ * @param {String} options.locusUrl
467
+ * @param {String} options.resourceId,
468
+ * @param {String} options.correlationId
469
+ * @param {boolean} options.ensureConversation
470
+ * @param {boolean} options.moderator
471
+ * @param {boolean} options.pin
472
+ * @param {boolean} options.moveToResource
473
+ * @param {Object} options.roapMessage
474
+ * @param {boolean} options.breakoutsSupported
475
+ * @param {String} options.locale,
476
+ * @param {Array} options.deviceCapabilities
477
+ * @param {boolean} options.liveAnnotationSupported
478
+ * @returns {Promise}
479
+ */
480
+ ```
481
+ ##### options.deviceCapabilities
482
+ This option provides toggles that Locus service needs, and those toggles will control the performance or features of the meetings to be joined, see examples:
483
+ ###### Breakout Sessions
484
+ ```
485
+ if (breakoutsSupported) {
486
+ deviceCapabilities.push(BREAKOUTS.BREAKOUTS_SUPPORTED);
487
+ }
488
+ ```
489
+ ###### Live Annotation
490
+ ```
491
+ if (liveAnnotationSupported) {
492
+ deviceCapabilities.push(ANNOTATION.ANNOTATION_ON_SHARE_SUPPORTED);
493
+ }
494
+ ```
495
+ ###### Audio Disclaimer
496
+ ```
497
+ const joinOptions = {
498
+ locale: 'en_UK', // audio disclaimer language
499
+ deviceCapabilities: ['SERVER_AUDIO_ANNOUNCEMENT_SUPPORTED'], // audio disclaimer toggle
500
+ };
501
+
502
+ const joinMeeting = () => { meeting.join(joinOptions)}
503
+ ```
460
504
 
461
505
  ##### Record
462
506
 
@@ -169,7 +169,7 @@ var Breakout = _webexCore.WebexPlugin.extend({
169
169
  sessionId: this.sessionId
170
170
  });
171
171
  },
172
- version: "3.0.0-beta.111"
172
+ version: "3.0.0-beta.113"
173
173
  });
174
174
  var _default = Breakout;
175
175
  exports.default = _default;
@@ -937,7 +937,7 @@ var Breakouts = _webexCore.WebexPlugin.extend({
937
937
  this.trigger(_constants.BREAKOUTS.EVENTS.ASK_RETURN_TO_MAIN);
938
938
  }
939
939
  },
940
- version: "3.0.0-beta.111"
940
+ version: "3.0.0-beta.113"
941
941
  });
942
942
  var _default = Breakouts;
943
943
  exports.default = _default;
@@ -12,7 +12,6 @@ _Object$defineProperty(exports, "__esModule", {
12
12
  });
13
13
  exports.default = void 0;
14
14
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/defineProperty"));
15
- var _stringify = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/json/stringify"));
16
15
  var _promise = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/promise"));
17
16
  var _internalMediaCore = require("@webex/internal-media-core");
18
17
  var _loggerProxy = _interopRequireDefault(require("../common/logs/logger-proxy"));
@@ -55,26 +54,6 @@ var _BrowserDetection = (0, _browserDetection.default)(),
55
54
  */
56
55
  var Media = {};
57
56
 
58
- /**
59
- * format the media array for send
60
- * @param {String} mediaId
61
- * @param {Boolean} audioMuted
62
- * @param {Boolean} videoMuted
63
- * @returns {Array} medias
64
- */
65
- Media.generateLocalMedias = function (mediaId, audioMuted, videoMuted) {
66
- if (mediaId) {
67
- return [{
68
- localSdp: (0, _stringify.default)({
69
- audioMuted: audioMuted,
70
- videoMuted: videoMuted
71
- }),
72
- mediaId: mediaId
73
- }];
74
- }
75
- return [];
76
- };
77
-
78
57
  /**
79
58
  * make a browser call to get the media
80
59
  * @param {SendOptions} options
@@ -1 +1 @@
1
- {"version":3,"names":["BrowserDetection","isBrowser","Media","generateLocalMedias","mediaId","audioMuted","videoMuted","localSdp","getLocalMedia","options","config","sendAudio","sendVideo","sendShare","sharePreferences","isSharing","getMedia","getDisplayMedia","resolve","undefined","createMediaConnection","isMultistream","debugId","mediaProperties","remoteQualityLevel","enableRtx","enableExtmap","turnServerInfo","bundlePolicy","iceServers","push","urls","url","username","credential","password","enableMainAudio","mediaDirection","receiveAudio","enableMainVideo","receiveVideo","MultistreamRoapMediaConnection","Error","audioTrack","videoTrack","shareTrack","RoapMediaConnection","skipInactiveTransceivers","requireH264","sdpMunging","convertPort9to0","addContentSlides","bandwidthLimits","audio","StaticConfig","meetings","bandwidth","video","startBitrate","periodicKeyframes","disableExtmap","disableRtx","send","underlyingTrack","screenShareVideo","receive","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","getSupportedDevice","enumerateDevices","devices","supported","filter","device","kind","AUDIO_INPUT","VIDEO_INPUT","getDevices","reject","MediaError","toggleStream","stopTracks","track","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 {RoapMediaConnection, MultistreamRoapMediaConnection} from '@webex/internal-media-core';\nimport {LocalCameraTrack, LocalDisplayTrack, LocalMicrophoneTrack} from '@webex/media-helpers';\nimport LoggerProxy from '../common/logs/logger-proxy';\nimport {AUDIO_INPUT, VIDEO_INPUT, MEDIA_TRACK_CONSTRAINT} from '../constants';\nimport Config from '../config';\nimport StaticConfig from '../common/config';\nimport MediaError from '../common/errors/media';\nimport BrowserDetection from '../common/browser-detection';\n\nconst {isBrowser} = BrowserDetection();\n\ntype MultistreamConnectionConfig = ConstructorParameters<typeof MultistreamRoapMediaConnection>[0];\n\nexport type BundlePolicy = ConstructorParameters<\n typeof MultistreamRoapMediaConnection\n>[0]['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 * format the media array for send\n * @param {String} mediaId\n * @param {Boolean} audioMuted\n * @param {Boolean} videoMuted\n * @returns {Array} medias\n */\nMedia.generateLocalMedias = (mediaId: string, audioMuted: boolean, videoMuted: boolean) => {\n if (mediaId) {\n return [\n {\n localSdp: JSON.stringify({\n audioMuted,\n videoMuted,\n }),\n mediaId,\n },\n ];\n }\n\n return [];\n};\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\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} options\n * @param {Object} [options.mediaProperties] contains mediaDirection and local tracks:\n * audioTrack, videoTrack and shareTrack\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 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 audioTrack?: LocalMicrophoneTrack;\n videoTrack?: LocalCameraTrack;\n shareTrack?: LocalDisplayTrack;\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 enableMainAudio:\n mediaProperties.mediaDirection?.sendAudio || mediaProperties.mediaDirection?.receiveAudio,\n enableMainVideo:\n mediaProperties.mediaDirection?.sendVideo || mediaProperties.mediaDirection?.receiveVideo,\n };\n\n if (bundlePolicy) {\n config.bundlePolicy = bundlePolicy;\n }\n\n return new MultistreamRoapMediaConnection(config, debugId);\n }\n\n if (!mediaProperties) {\n throw new Error('mediaProperties have to be provided for non-multistream media connections');\n }\n\n const {mediaDirection, audioTrack, videoTrack, shareTrack} = 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 send: {\n audio: audioTrack?.underlyingTrack,\n video: videoTrack?.underlyingTrack,\n screenShareVideo: shareTrack?.underlyingTrack,\n },\n receive: {\n audio: mediaDirection.receiveAudio,\n video: mediaDirection.receiveVideo,\n screenShareVideo: mediaDirection.receiveShare,\n remoteQualityLevel,\n },\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 * Checks if the machine has at least one audio or video device (Dont use this for screen share)\n * @param {object} [options]\n * {\n * sendAudio: true/false,\n * sendVideo: true/false\n * }\n * @returns {Object} {\n * sendAudio: true/false,\n * sendVideo: true/false\n *}\n */\nMedia.getSupportedDevice = ({sendAudio, sendVideo}: {sendAudio: boolean; sendVideo: boolean}) =>\n Promise.resolve().then(() => {\n if (!navigator.mediaDevices || navigator.mediaDevices.enumerateDevices === undefined) {\n return {\n sendAudio: false,\n sendVideo: false,\n };\n }\n\n return navigator.mediaDevices.enumerateDevices().then((devices) => {\n const supported = {\n audio: devices.filter((device) => device.kind === AUDIO_INPUT).length > 0,\n video: devices.filter((device) => device.kind === VIDEO_INPUT).length > 0,\n };\n\n return {\n sendAudio: supported.audio && sendAudio,\n sendVideo: supported.video && sendVideo,\n };\n });\n });\n\n/**\n * proxy to browser navigator.mediaDevices.enumerateDevices()\n * @returns {Promise}\n */\nMedia.getDevices = () => {\n if (navigator && navigator.mediaDevices && navigator.mediaDevices.enumerateDevices) {\n return navigator.mediaDevices.enumerateDevices();\n }\n\n return Promise.reject(new MediaError('enumerateDevices not supported.'));\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 {MediaTrack} track A media stream\n * @returns {null}\n */\nMedia.stopTracks = (track: any) => {\n if (!track) {\n return Promise.resolve();\n }\n\n return Promise.resolve().then(() => {\n if (track && track.stop) {\n try {\n track.stop();\n } catch (e) {\n LoggerProxy.logger.error(\n `Media:index#stopTracks --> Unable to stop the track with state ${track.readyState}, error: ${e}`\n );\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;AAEA;AACA;AACA;AACA;AACA;AACA;AAA2D;AAAA;AAE3D,wBAAoB,IAAAA,yBAAgB,GAAE;EAA/BC,SAAS,qBAATA,SAAS;AAQhB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAMC,KAAU,GAAG,CAAC,CAAC;;AAErB;AACA;AACA;AACA;AACA;AACA;AACA;AACAA,KAAK,CAACC,mBAAmB,GAAG,UAACC,OAAe,EAAEC,UAAmB,EAAEC,UAAmB,EAAK;EACzF,IAAIF,OAAO,EAAE;IACX,OAAO,CACL;MACEG,QAAQ,EAAE,wBAAe;QACvBF,UAAU,EAAVA,UAAU;QACVC,UAAU,EAAVA;MACF,CAAC,CAAC;MACFF,OAAO,EAAPA;IACF,CAAC,CACF;EACH;EAEA,OAAO,EAAE;AACX,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACAF,KAAK,CAACM,aAAa,GAAG,UAACC,OAAY,EAAEC,MAAc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K,CAACC,IAAI,EAAE;MACd,CAAC,CAAC,OAAOC,CAAC,EAAE;QACVpB,oBAAW,CAACC,MAAM,CAACC,KAAK,0EAC4CgB,KAAK,CAACG,UAAU,sBAAYD,CAAC,EAChG;MACH;IACF;EACF,CAAC,CAAC;AACJ,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACApI,KAAK,CAAC4G,YAAY,GAAG,UACnB0B,YAKC,EACDC,UAGC,EACD3H,gBAGC,EACDJ,MAAc;EAAA,OAEdR,KAAK,CAACM,aAAa,CACjB;IACEG,SAAS,EAAE6H,YAAY,CAAC7H,SAAS,GAAG8H,UAAU,CAACpF,KAAK,IAAImF,YAAY,CAAC7H,SAAS,GAAG,KAAK;IACtFC,SAAS,EAAE4H,YAAY,CAAC5H,SAAS,GAAG6H,UAAU,CAAChF,KAAK,IAAI+E,YAAY,CAAC5H,SAAS,GAAG;EACnF,CAAC,EACDF,MAAM,CACP,CAACkF,IAAI,CAAC,UAAC8C,WAAW;IAAA,OACjBxI,KAAK,CAACM,aAAa,CACjB;MACEK,SAAS,EAAE2H,YAAY,CAAC3H,SAAS;MACjCE,SAAS,EAAEyH,YAAY,CAACzH,SAAS;MACjCD,gBAAgB,EAAhBA;IACF,CAAC,EACDJ,MAAM,CACP,CAACkF,IAAI,CAAC,UAAC+C,WAAW;MAAA,OAAK,CAACD,WAAW,EAAEC,WAAW,CAAC;IAAA,EAAC;EAAA,EACpD;AAAA;AAAC,eAEWzI,KAAK;AAAA"}
1
+ {"version":3,"names":["BrowserDetection","isBrowser","Media","getLocalMedia","options","config","sendAudio","sendVideo","sendShare","sharePreferences","isSharing","getMedia","getDisplayMedia","resolve","undefined","createMediaConnection","isMultistream","debugId","mediaProperties","remoteQualityLevel","enableRtx","enableExtmap","turnServerInfo","bundlePolicy","iceServers","push","urls","url","username","credential","password","enableMainAudio","mediaDirection","receiveAudio","enableMainVideo","receiveVideo","MultistreamRoapMediaConnection","Error","audioTrack","videoTrack","shareTrack","RoapMediaConnection","skipInactiveTransceivers","requireH264","sdpMunging","convertPort9to0","addContentSlides","bandwidthLimits","audio","StaticConfig","meetings","bandwidth","video","startBitrate","periodicKeyframes","disableExtmap","disableRtx","send","underlyingTrack","screenShareVideo","receive","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","getSupportedDevice","enumerateDevices","devices","supported","filter","device","kind","AUDIO_INPUT","VIDEO_INPUT","getDevices","reject","MediaError","toggleStream","stopTracks","track","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 {RoapMediaConnection, MultistreamRoapMediaConnection} from '@webex/internal-media-core';\nimport {LocalCameraTrack, LocalDisplayTrack, LocalMicrophoneTrack} from '@webex/media-helpers';\nimport LoggerProxy from '../common/logs/logger-proxy';\nimport {AUDIO_INPUT, VIDEO_INPUT, MEDIA_TRACK_CONSTRAINT} from '../constants';\nimport Config from '../config';\nimport StaticConfig from '../common/config';\nimport MediaError from '../common/errors/media';\nimport BrowserDetection from '../common/browser-detection';\n\nconst {isBrowser} = BrowserDetection();\n\ntype MultistreamConnectionConfig = ConstructorParameters<typeof MultistreamRoapMediaConnection>[0];\n\nexport type BundlePolicy = ConstructorParameters<\n typeof MultistreamRoapMediaConnection\n>[0]['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\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} options\n * @param {Object} [options.mediaProperties] contains mediaDirection and local tracks:\n * audioTrack, videoTrack and shareTrack\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 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 audioTrack?: LocalMicrophoneTrack;\n videoTrack?: LocalCameraTrack;\n shareTrack?: LocalDisplayTrack;\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 enableMainAudio:\n mediaProperties.mediaDirection?.sendAudio || mediaProperties.mediaDirection?.receiveAudio,\n enableMainVideo:\n mediaProperties.mediaDirection?.sendVideo || mediaProperties.mediaDirection?.receiveVideo,\n };\n\n if (bundlePolicy) {\n config.bundlePolicy = bundlePolicy;\n }\n\n return new MultistreamRoapMediaConnection(config, debugId);\n }\n\n if (!mediaProperties) {\n throw new Error('mediaProperties have to be provided for non-multistream media connections');\n }\n\n const {mediaDirection, audioTrack, videoTrack, shareTrack} = 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 send: {\n audio: audioTrack?.underlyingTrack,\n video: videoTrack?.underlyingTrack,\n screenShareVideo: shareTrack?.underlyingTrack,\n },\n receive: {\n audio: mediaDirection.receiveAudio,\n video: mediaDirection.receiveVideo,\n screenShareVideo: mediaDirection.receiveShare,\n remoteQualityLevel,\n },\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 * Checks if the machine has at least one audio or video device (Dont use this for screen share)\n * @param {object} [options]\n * {\n * sendAudio: true/false,\n * sendVideo: true/false\n * }\n * @returns {Object} {\n * sendAudio: true/false,\n * sendVideo: true/false\n *}\n */\nMedia.getSupportedDevice = ({sendAudio, sendVideo}: {sendAudio: boolean; sendVideo: boolean}) =>\n Promise.resolve().then(() => {\n if (!navigator.mediaDevices || navigator.mediaDevices.enumerateDevices === undefined) {\n return {\n sendAudio: false,\n sendVideo: false,\n };\n }\n\n return navigator.mediaDevices.enumerateDevices().then((devices) => {\n const supported = {\n audio: devices.filter((device) => device.kind === AUDIO_INPUT).length > 0,\n video: devices.filter((device) => device.kind === VIDEO_INPUT).length > 0,\n };\n\n return {\n sendAudio: supported.audio && sendAudio,\n sendVideo: supported.video && sendVideo,\n };\n });\n });\n\n/**\n * proxy to browser navigator.mediaDevices.enumerateDevices()\n * @returns {Promise}\n */\nMedia.getDevices = () => {\n if (navigator && navigator.mediaDevices && navigator.mediaDevices.enumerateDevices) {\n return navigator.mediaDevices.enumerateDevices();\n }\n\n return Promise.reject(new MediaError('enumerateDevices not supported.'));\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 {MediaTrack} track A media stream\n * @returns {null}\n */\nMedia.stopTracks = (track: any) => {\n if (!track) {\n return Promise.resolve();\n }\n\n return Promise.resolve().then(() => {\n if (track && track.stop) {\n try {\n track.stop();\n } catch (e) {\n LoggerProxy.logger.error(\n `Media:index#stopTracks --> Unable to stop the track with state ${track.readyState}, error: ${e}`\n );\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;AAEA;AACA;AACA;AACA;AACA;AACA;AAA2D;AAAA;AAE3D,wBAAoB,IAAAA,yBAAgB,GAAE;EAA/BC,SAAS,qBAATA,SAA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 -84,6 +84,7 @@ var _constants3 = require("../reactions/constants");
84
84
  var _recordingController = _interopRequireDefault(require("../recording-controller"));
85
85
  var _controlsOptionsManager = _interopRequireDefault(require("../controls-options-manager"));
86
86
  var _permission = _interopRequireDefault(require("../common/errors/permission"));
87
+ var _locusMediaRequest = require("./locusMediaRequest");
87
88
  function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof _Symbol !== "undefined" && o[_Symbol$iterator] || o["@@iterator"]; if (!it) { if (_Array$isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
88
89
  function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return _Array$from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
89
90
  function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
@@ -405,6 +406,8 @@ exports.MEDIA_UPDATE_TYPE = MEDIA_UPDATE_TYPE;
405
406
  var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
406
407
  (0, _inherits2.default)(Meeting, _StatelessWebexPlugin);
407
408
  var _super = _createSuper(Meeting);
409
+ // comes from Locus, initialized by updateMeetingObject()
410
+
408
411
  /**
409
412
  * @param {Object} attrs
410
413
  * @param {Object} options
@@ -451,6 +454,7 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
451
454
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "resource", void 0);
452
455
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "roap", void 0);
453
456
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "roapSeq", void 0);
457
+ (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "selfUrl", void 0);
454
458
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "sipUri", void 0);
455
459
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "type", void 0);
456
460
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "userId", void 0);
@@ -472,6 +476,7 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
472
476
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "keepAliveTimerId", void 0);
473
477
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "lastVideoLayoutInfo", void 0);
474
478
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "locusInfo", void 0);
479
+ (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "locusMediaRequest", void 0);
475
480
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "mediaProperties", void 0);
476
481
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "mediaRequestManagers", void 0);
477
482
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "meetingInfoFailureReason", void 0);
@@ -4007,6 +4012,7 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
4007
4012
  }, {
4008
4013
  key: "closePeerConnections",
4009
4014
  value: function closePeerConnections() {
4015
+ this.locusMediaRequest = undefined;
4010
4016
  if (this.mediaProperties.webrtcMediaConnection) {
4011
4017
  if (this.remoteMediaManager) {
4012
4018
  this.remoteMediaManager.stop();
@@ -5209,6 +5215,19 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
5209
5215
  }
5210
5216
  });
5211
5217
  return _util.default.validateOptions(options).then(function () {
5218
+ _this40.locusMediaRequest = new _locusMediaRequest.LocusMediaRequest({
5219
+ correlationId: _this40.correlationId,
5220
+ device: {
5221
+ url: _this40.deviceUrl,
5222
+ // @ts-ignore
5223
+ deviceType: _this40.config.deviceType
5224
+ },
5225
+ preferTranscoding: !_this40.isMultistream
5226
+ }, {
5227
+ // @ts-ignore
5228
+ parent: _this40.webex
5229
+ });
5230
+ }).then(function () {
5212
5231
  return _this40.roap.doTurnDiscovery(_this40, false);
5213
5232
  }).then(function (turnDiscoveryObject) {
5214
5233
  turnDiscoverySkippedReason = turnDiscoveryObject.turnDiscoverySkippedReason;