@webex/plugin-meetings 3.0.0-beta.81 → 3.0.0-beta.83
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/breakouts/breakout.js +1 -1
- package/dist/breakouts/index.js +1 -1
- package/dist/media/index.js +5 -3
- package/dist/media/index.js.map +1 -1
- package/dist/meeting/index.js +12 -6
- package/dist/meeting/index.js.map +1 -1
- package/dist/types/media/index.d.ts +2 -0
- package/dist/types/meeting/index.d.ts +3 -1
- package/package.json +18 -18
- package/src/media/index.ts +15 -1
- package/src/meeting/index.ts +9 -3
- package/test/unit/spec/media/index.ts +4 -0
- package/test/unit/spec/meeting/index.js +46 -0
package/dist/breakouts/index.js
CHANGED
package/dist/media/index.js
CHANGED
|
@@ -25,7 +25,6 @@ function ownKeys(object, enumerableOnly) { var keys = _Object$keys(object); if (
|
|
|
25
25
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
26
26
|
var _BrowserDetection = (0, _browserDetection.default)(),
|
|
27
27
|
isBrowser = _BrowserDetection.isBrowser;
|
|
28
|
-
|
|
29
28
|
/**
|
|
30
29
|
* MediaDirection
|
|
31
30
|
* @typedef {Object} MediaDirection
|
|
@@ -113,6 +112,7 @@ Media.getLocalMedia = function (options, config) {
|
|
|
113
112
|
* @param {boolean} [options.enableRtx] applicable only to non-multistream connections
|
|
114
113
|
* @param {boolean} [options.enableExtmap] applicable only to non-multistream connections
|
|
115
114
|
* @param {Object} [options.turnServerInfo]
|
|
115
|
+
* @param {BundlePolicy} [options.bundlePolicy]
|
|
116
116
|
* @returns {RoapMediaConnection | MultistreamRoapMediaConnection}
|
|
117
117
|
*/
|
|
118
118
|
Media.createMediaConnection = function (isMultistream, debugId, options) {
|
|
@@ -120,7 +120,8 @@ Media.createMediaConnection = function (isMultistream, debugId, options) {
|
|
|
120
120
|
remoteQualityLevel = options.remoteQualityLevel,
|
|
121
121
|
enableRtx = options.enableRtx,
|
|
122
122
|
enableExtmap = options.enableExtmap,
|
|
123
|
-
turnServerInfo = options.turnServerInfo
|
|
123
|
+
turnServerInfo = options.turnServerInfo,
|
|
124
|
+
bundlePolicy = options.bundlePolicy;
|
|
124
125
|
var iceServers = [];
|
|
125
126
|
if (turnServerInfo) {
|
|
126
127
|
iceServers.push({
|
|
@@ -134,7 +135,8 @@ Media.createMediaConnection = function (isMultistream, debugId, options) {
|
|
|
134
135
|
return new _internalMediaCore.MultistreamRoapMediaConnection({
|
|
135
136
|
iceServers: iceServers,
|
|
136
137
|
enableMainAudio: ((_mediaProperties$medi = mediaProperties.mediaDirection) === null || _mediaProperties$medi === void 0 ? void 0 : _mediaProperties$medi.sendAudio) || ((_mediaProperties$medi2 = mediaProperties.mediaDirection) === null || _mediaProperties$medi2 === void 0 ? void 0 : _mediaProperties$medi2.receiveAudio),
|
|
137
|
-
enableMainVideo: ((_mediaProperties$medi3 = mediaProperties.mediaDirection) === null || _mediaProperties$medi3 === void 0 ? void 0 : _mediaProperties$medi3.sendVideo) || ((_mediaProperties$medi4 = mediaProperties.mediaDirection) === null || _mediaProperties$medi4 === void 0 ? void 0 : _mediaProperties$medi4.receiveVideo)
|
|
138
|
+
enableMainVideo: ((_mediaProperties$medi3 = mediaProperties.mediaDirection) === null || _mediaProperties$medi3 === void 0 ? void 0 : _mediaProperties$medi3.sendVideo) || ((_mediaProperties$medi4 = mediaProperties.mediaDirection) === null || _mediaProperties$medi4 === void 0 ? void 0 : _mediaProperties$medi4.receiveVideo),
|
|
139
|
+
bundlePolicy: bundlePolicy
|
|
138
140
|
}, debugId);
|
|
139
141
|
}
|
|
140
142
|
if (!mediaProperties) {
|
package/dist/media/index.js.map
CHANGED
|
@@ -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","iceServers","push","urls","url","username","credential","password","MultistreamRoapMediaConnection","enableMainAudio","mediaDirection","receiveAudio","enableMainVideo","receiveVideo","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 {\n LocalCameraTrack,\n LocalDisplayTrack,\n LocalMicrophoneTrack,\n RoapMediaConnection,\n MultistreamRoapMediaConnection,\n} from '@webex/internal-media-core';\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\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 * @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 }\n) => {\n const {mediaProperties, remoteQualityLevel, enableRtx, enableExtmap, turnServerInfo} = 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 return new MultistreamRoapMediaConnection(\n {\n iceServers,\n enableMainAudio:\n mediaProperties.mediaDirection?.sendAudio || mediaProperties.mediaDirection?.receiveAudio,\n enableMainVideo:\n mediaProperties.mediaDirection?.sendVideo || mediaProperties.mediaDirection?.receiveVideo,\n },\n debugId\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, 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;AAOA;AACA;AACA;AACA;AACA;AACA;AAA2D;AAAA;AAE3D,wBAAoB,IAAAA,yBAAgB,GAAE;EAA/BC,SAAS,qBAATA,SAAS;;AAEhB;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,EAAK;EACtD,IAAOC,SAAS,GAAuDF,OAAO,CAAvEE,SAAS;IAAEC,SAAS,GAA4CH,OAAO,CAA5DG,SAAS;IAAEC,SAAS,GAAiCJ,OAAO,CAAjDI,SAAS;IAAEC,gBAAgB,GAAeL,OAAO,CAAtCK,gBAAgB;IAAEC,SAAS,GAAIN,OAAO,CAApBM,SAAS;EAEnE,IAAIJ,SAAS,IAAIC,SAAS,EAAE;IAC1B,OAAOV,KAAK,CAACc,QAAQ,CAACL,SAAS,EAAEC,SAAS,EAAEF,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AAS,GAAG,KAAK;IACtFC,SAAS,EAAE2H,YAAY,CAAC3H,SAAS,GAAG4H,UAAU,CAAChF,KAAK,IAAI+E,YAAY,CAAC3H,SAAS,GAAG;EACnF,CAAC,EACDF,MAAM,CACP,CAACiF,IAAI,CAAC,UAAC8C,WAAW;IAAA,OACjBvI,KAAK,CAACM,aAAa,CACjB;MACEK,SAAS,EAAE0H,YAAY,CAAC1H,SAAS;MACjCE,SAAS,EAAEwH,YAAY,CAACxH,SAAS;MACjCD,gBAAgB,EAAhBA;IACF,CAAC,EACDJ,MAAM,CACP,CAACiF,IAAI,CAAC,UAAC+C,WAAW;MAAA,OAAK,CAACD,WAAW,EAAEC,WAAW,CAAC;IAAA,EAAC;EAAA,EACpD;AAAA;AAAC,eAEWxI,KAAK;AAAA"}
|
|
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","MultistreamRoapMediaConnection","enableMainAudio","mediaDirection","receiveAudio","enableMainVideo","receiveVideo","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 {\n LocalCameraTrack,\n LocalDisplayTrack,\n LocalMicrophoneTrack,\n RoapMediaConnection,\n MultistreamRoapMediaConnection,\n} from '@webex/internal-media-core';\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\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 return new MultistreamRoapMediaConnection(\n {\n iceServers,\n enableMainAudio:\n mediaProperties.mediaDirection?.sendAudio || mediaProperties.mediaDirection?.receiveAudio,\n enableMainVideo:\n mediaProperties.mediaDirection?.sendVideo || mediaProperties.mediaDirection?.receiveVideo,\n bundlePolicy,\n },\n debugId\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, 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;AAOA;AACA;AACA;AACA;AACA;AACA;AAA2D;AAAA;AAE3D,wBAAoB,IAAAA,yBAAgB,GAAE;EAA/BC,SAAS,qBAATA,SAAS;AAMhB;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,E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,OAAO,iBAAQlH,OAAO,EAAE;EAC1B;EAEA,OAAO,iBAAQA,OAAO,EAAE,CAAC0E,IAAI,CAAC,YAAM;IAClC,IAAIwC,KAAK,IAAIA,KAAK,CAACC,IAAI,EAAE;MACvB,IAAI;QACFD,KAAK,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"}
|
package/dist/meeting/index.js
CHANGED
|
@@ -4867,11 +4867,12 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
|
|
|
4867
4867
|
* Creates a webrtc media connection
|
|
4868
4868
|
*
|
|
4869
4869
|
* @param {Object} turnServerInfo TURN server information
|
|
4870
|
+
* @param {BundlePolicy} [bundlePolicy] Bundle policy settings
|
|
4870
4871
|
* @returns {RoapMediaConnection | MultistreamRoapMediaConnection}
|
|
4871
4872
|
*/
|
|
4872
4873
|
}, {
|
|
4873
4874
|
key: "createMediaConnection",
|
|
4874
|
-
value: function createMediaConnection(turnServerInfo) {
|
|
4875
|
+
value: function createMediaConnection(turnServerInfo, bundlePolicy) {
|
|
4875
4876
|
var mc = _media.default.createMediaConnection(this.isMultistream, this.getMediaConnectionDebugId(), {
|
|
4876
4877
|
mediaProperties: this.mediaProperties,
|
|
4877
4878
|
remoteQualityLevel: this.mediaProperties.remoteQualityLevel,
|
|
@@ -4879,7 +4880,8 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
|
|
|
4879
4880
|
enableRtx: this.config.enableRtx,
|
|
4880
4881
|
// @ts-ignore - config coming from registerPlugin
|
|
4881
4882
|
enableExtmap: this.config.enableExtmap,
|
|
4882
|
-
turnServerInfo: turnServerInfo
|
|
4883
|
+
turnServerInfo: turnServerInfo,
|
|
4884
|
+
bundlePolicy: bundlePolicy
|
|
4883
4885
|
});
|
|
4884
4886
|
this.mediaProperties.setMediaPeerConnection(mc);
|
|
4885
4887
|
this.setupMediaConnectionListeners();
|
|
@@ -4914,6 +4916,7 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
|
|
|
4914
4916
|
* @param {MediaDirection} options.mediaSettings pass media options
|
|
4915
4917
|
* @param {MediaStream} options.localStream
|
|
4916
4918
|
* @param {MediaStream} options.localShare
|
|
4919
|
+
* @param {BundlePolicy} options.bundlePolicy bundle policy for multistream meetings
|
|
4917
4920
|
* @param {RemoteMediaManagerConfig} options.remoteMediaManagerConfig only applies if multistream is enabled
|
|
4918
4921
|
* @returns {Promise}
|
|
4919
4922
|
* @public
|
|
@@ -4941,7 +4944,8 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
|
|
|
4941
4944
|
var localStream = options.localStream,
|
|
4942
4945
|
localShare = options.localShare,
|
|
4943
4946
|
mediaSettings = options.mediaSettings,
|
|
4944
|
-
remoteMediaManagerConfig = options.remoteMediaManagerConfig
|
|
4947
|
+
remoteMediaManagerConfig = options.remoteMediaManagerConfig,
|
|
4948
|
+
bundlePolicy = options.bundlePolicy;
|
|
4945
4949
|
_loggerProxy.default.logger.info("".concat(LOG_HEADER, " Adding Media."));
|
|
4946
4950
|
_metrics.default.postEvent({
|
|
4947
4951
|
event: _config.eventType.MEDIA_CAPABILITIES,
|
|
@@ -4972,7 +4976,7 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
|
|
|
4972
4976
|
turnServerUsed = !turnDiscoverySkippedReason;
|
|
4973
4977
|
var turnServerInfo = turnDiscoveryObject.turnServerInfo;
|
|
4974
4978
|
_this40.preMedia(localStream, localShare, mediaSettings);
|
|
4975
|
-
var mc = _this40.createMediaConnection(turnServerInfo);
|
|
4979
|
+
var mc = _this40.createMediaConnection(turnServerInfo, bundlePolicy);
|
|
4976
4980
|
if (_this40.isMultistream) {
|
|
4977
4981
|
_this40.remoteMediaManager = new _remoteMediaManager.RemoteMediaManager(_this40.receiveSlotManager, _this40.mediaRequestManagers, remoteMediaManagerConfig);
|
|
4978
4982
|
_this40.forwardEvent(_this40.remoteMediaManager, _remoteMediaManager.Event.AudioCreated, _constants.EVENT_TRIGGERS.REMOTE_MEDIA_AUDIO_CREATED);
|
|
@@ -5050,7 +5054,8 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
|
|
|
5050
5054
|
_metrics.default.sendBehavioralMetric(_constants2.default.ADD_MEDIA_SUCCESS, {
|
|
5051
5055
|
correlation_id: _this40.correlationId,
|
|
5052
5056
|
locus_id: _this40.locusUrl.split('/').pop(),
|
|
5053
|
-
connectionType: connectionType
|
|
5057
|
+
connectionType: connectionType,
|
|
5058
|
+
isMultistream: _this40.isMultistream
|
|
5054
5059
|
});
|
|
5055
5060
|
}).catch(function (error) {
|
|
5056
5061
|
// Clean up stats analyzer, peer connection, and turn off listeners
|
|
@@ -5069,7 +5074,8 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
|
|
|
5069
5074
|
stack: error.stack,
|
|
5070
5075
|
code: error.code,
|
|
5071
5076
|
turnDiscoverySkippedReason: turnDiscoverySkippedReason,
|
|
5072
|
-
turnServerUsed: turnServerUsed
|
|
5077
|
+
turnServerUsed: turnServerUsed,
|
|
5078
|
+
isMultistream: _this40.isMultistream
|
|
5073
5079
|
});
|
|
5074
5080
|
|
|
5075
5081
|
// Upload logs on error while adding media
|