@webex/plugin-meetings 3.0.0-beta.54 → 3.0.0-beta.56
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/controls-options-manager/index.js +41 -22
- package/dist/controls-options-manager/index.js.map +1 -1
- package/dist/multistream/remoteMedia.js +3 -1
- package/dist/multistream/remoteMedia.js.map +1 -1
- package/package.json +18 -18
- package/src/controls-options-manager/index.ts +41 -25
- package/src/multistream/remoteMedia.ts +3 -1
- package/test/unit/spec/multistream/remoteMedia.ts +2 -0
package/dist/breakouts/index.js
CHANGED
|
@@ -1,13 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
var _Object$keys2 = require("@babel/runtime-corejs2/core-js/object/keys");
|
|
4
|
+
var _Object$getOwnPropertySymbols = require("@babel/runtime-corejs2/core-js/object/get-own-property-symbols");
|
|
5
|
+
var _Object$getOwnPropertyDescriptor = require("@babel/runtime-corejs2/core-js/object/get-own-property-descriptor");
|
|
6
|
+
var _Object$getOwnPropertyDescriptors = require("@babel/runtime-corejs2/core-js/object/get-own-property-descriptors");
|
|
7
|
+
var _Object$defineProperties = require("@babel/runtime-corejs2/core-js/object/define-properties");
|
|
3
8
|
var _Object$defineProperty = require("@babel/runtime-corejs2/core-js/object/define-property");
|
|
4
9
|
var _interopRequireDefault = require("@babel/runtime-corejs2/helpers/interopRequireDefault");
|
|
5
10
|
_Object$defineProperty(exports, "__esModule", {
|
|
6
11
|
value: true
|
|
7
12
|
});
|
|
8
13
|
exports.default = void 0;
|
|
9
|
-
var
|
|
14
|
+
var _stringify = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/json/stringify"));
|
|
10
15
|
var _entries = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/object/entries"));
|
|
16
|
+
var _keys = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/object/keys"));
|
|
11
17
|
var _promise = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/promise"));
|
|
12
18
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/slicedToArray"));
|
|
13
19
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/classCallCheck"));
|
|
@@ -20,6 +26,8 @@ var _loggerProxy = _interopRequireDefault(require("../common/logs/logger-proxy")
|
|
|
20
26
|
var _enums = _interopRequireDefault(require("./enums"));
|
|
21
27
|
var _util = _interopRequireDefault(require("./util"));
|
|
22
28
|
var _constants2 = require("./constants");
|
|
29
|
+
function ownKeys(object, enumerableOnly) { var keys = _Object$keys2(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
30
|
+
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; }
|
|
23
31
|
/**
|
|
24
32
|
* docs
|
|
25
33
|
* https://sqbu-github.cisco.com/pages/WebExSquared/locus/guides/mute.html
|
|
@@ -163,28 +171,39 @@ var ControlsOptionsManager = /*#__PURE__*/function () {
|
|
|
163
171
|
}, {
|
|
164
172
|
key: "setControls",
|
|
165
173
|
value: function setControls(setting) {
|
|
166
|
-
var
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
var
|
|
172
|
-
key =
|
|
173
|
-
value =
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
if (
|
|
178
|
-
|
|
179
|
-
body.audio[(0, _camelCase2.default)(key)] = value;
|
|
180
|
-
} else {
|
|
181
|
-
return _promise.default.reject(new _permission.default("".concat(_enums.default.muted, " [").concat(value, "] not allowed, due to moderator property.")));
|
|
182
|
-
}
|
|
183
|
-
} else if (_util.default !== null && _util.default !== void 0 && _util.default["".concat(value ? _constants2.CAN_SET : _constants2.CAN_UNSET).concat(key)](this.displayHints)) {
|
|
184
|
-
body[(0, _camelCase2.default)(key)] = (0, _defineProperty2.default)({}, _constants2.ENABLED, value);
|
|
185
|
-
} else {
|
|
186
|
-
return _promise.default.reject(new _permission.default("".concat(key, " [").concat(value, "] not allowed, due to moderator property.")));
|
|
174
|
+
var _this = this;
|
|
175
|
+
_loggerProxy.default.logger.log("ControlsOptionsManager:index#setControls --> ".concat((0, _stringify.default)(setting)));
|
|
176
|
+
var body = {};
|
|
177
|
+
var error;
|
|
178
|
+
(0, _entries.default)(setting).forEach(function (_ref) {
|
|
179
|
+
var _ref2 = (0, _slicedToArray2.default)(_ref, 2),
|
|
180
|
+
key = _ref2[0],
|
|
181
|
+
value = _ref2[1];
|
|
182
|
+
if (!(_util.default !== null && _util.default !== void 0 && _util.default["".concat(value ? _constants2.CAN_SET : _constants2.CAN_UNSET).concat(key)](_this.displayHints))) {
|
|
183
|
+
error = new _permission.default("".concat(key, " [").concat(value, "] not allowed, due to moderator property."));
|
|
184
|
+
}
|
|
185
|
+
if (error) {
|
|
186
|
+
return;
|
|
187
187
|
}
|
|
188
|
+
switch (key) {
|
|
189
|
+
case _enums.default.muted:
|
|
190
|
+
body.audio = body.audio ? _objectSpread(_objectSpread({}, body.audio), {}, (0, _defineProperty2.default)({}, (0, _camelCase2.default)(key), value)) : (0, _defineProperty2.default)({}, (0, _camelCase2.default)(key), value);
|
|
191
|
+
break;
|
|
192
|
+
case _enums.default.disallowUnmute:
|
|
193
|
+
case _enums.default.muteOnEntry:
|
|
194
|
+
if ((0, _keys.default)(setting).includes(_enums.default.muted)) {
|
|
195
|
+
body.audio = body.audio ? _objectSpread(_objectSpread({}, body.audio), {}, (0, _defineProperty2.default)({}, (0, _camelCase2.default)(key), value)) : (0, _defineProperty2.default)({}, (0, _camelCase2.default)(key), value);
|
|
196
|
+
body.audio[(0, _camelCase2.default)(key)] = value;
|
|
197
|
+
} else {
|
|
198
|
+
body[(0, _camelCase2.default)(key)] = (0, _defineProperty2.default)({}, _constants2.ENABLED, value);
|
|
199
|
+
}
|
|
200
|
+
break;
|
|
201
|
+
default:
|
|
202
|
+
error = new _permission.default("".concat(key, " [").concat(value, "] not allowed, due to moderator property."));
|
|
203
|
+
}
|
|
204
|
+
});
|
|
205
|
+
if (error) {
|
|
206
|
+
return _promise.default.reject(error);
|
|
188
207
|
}
|
|
189
208
|
|
|
190
209
|
// @ts-ignore
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["ControlsOptionsManager","request","options","initialize","set","extract","url","locusUrl","hints","displayHints","setDisplayHints","setLocusUrl","setting","
|
|
1
|
+
{"version":3,"names":["ControlsOptionsManager","request","options","initialize","set","extract","url","locusUrl","hints","displayHints","setDisplayHints","setLocusUrl","setting","LoggerProxy","logger","log","body","error","forEach","key","value","Util","CAN_SET","CAN_UNSET","PermissionError","Setting","muted","audio","disallowUnmute","muteOnEntry","includes","ENABLED","reject","uri","CONTROLS","method","HTTP_VERBS","PATCH","enabled","setControls","mutedEnabled","disallowUnmuteEnabled","muteOnEntryEnabled"],"sources":["index.ts"],"sourcesContent":["import {camelCase} from 'lodash';\nimport PermissionError from '../common/errors/permission';\nimport {CONTROLS, HTTP_VERBS} from '../constants';\nimport MeetingRequest from '../meeting/request';\nimport LoggerProxy from '../common/logs/logger-proxy';\nimport Setting from './enums';\nimport Util from './util';\nimport {CAN_SET, CAN_UNSET, ENABLED} from './constants';\n\n/**\n * docs\n * https://sqbu-github.cisco.com/pages/WebExSquared/locus/guides/mute.html\n * https://confluence-eng-gpk2.cisco.com/conf/display/LOCUS/Hard+Mute+and+Audio+Privacy#HardMuteandAudioPrivacy-SelfMuteonEntry\n * https://confluence-eng-gpk2.cisco.com/conf/pages/viewpage.action?spaceKey=UC&title=WEBEX-124454%3A+UCF%3A+Hard+mute+support+for+Teams+joining+Webex+meeting\n * https://jira-eng-gpk2.cisco.com/jira/browse/SPARK-180867\n * https://jira-eng-gpk2.cisco.com/jira/browse/SPARK-393351\n */\n\n/**\n * @description ControlsOptionsManager is responsible for handling the behavior of participant controls when somebody joins a meeting\n * @export\n * @private\n * @class Recording\n */\nexport default class ControlsOptionsManager {\n /**\n * @instance\n * @type {MeetingRequest}\n * @private\n * @memberof ControlsOptionsManager\n */\n private request: MeetingRequest;\n\n /**\n * @instance\n * @type {Array}\n * @private\n * @memberof ControlsOptionsManager\n */\n private displayHints: Array<string> = [];\n\n /**\n * @instance\n * @type {string}\n * @private\n * @memberof ControlsOptionsManager\n */\n private locusUrl: string;\n\n /**\n * @param {MeetingRequest} request\n * @param {Object} options\n * @constructor\n * @memberof ControlsOptionsManager\n */\n constructor(\n request: MeetingRequest,\n options?: {\n locusUrl: string;\n displayHints?: Array<string>;\n }\n ) {\n this.initialize(request);\n this.set(options);\n }\n\n /**\n * @param {MeetingRequest} request\n * @returns {void}\n * @private\n * @memberof ControlsOptionsManager\n */\n private initialize(request: MeetingRequest) {\n this.request = request;\n }\n\n /**\n * @param {Object} options\n * @returns {void}\n * @public\n * @memberof ControlsOptionsManager\n */\n public set(options?: {locusUrl: string; displayHints?: Array<string>}) {\n this.extract(options);\n }\n\n /**\n * @param {string} url\n * @returns {void}\n * @public\n * @memberof ControlsOptionsManager\n */\n public setLocusUrl(url: string) {\n this.locusUrl = url;\n }\n\n /**\n * @param {Array} hints\n * @returns {void}\n * @public\n * @memberof ControlsOptionsManager\n */\n public setDisplayHints(hints: Array<string>) {\n this.displayHints = hints;\n }\n\n /**\n * @returns {string}\n * @public\n * @memberof ControlsOptionsManager\n */\n public getLocusUrl() {\n return this.locusUrl;\n }\n\n /**\n * @returns {Array}\n * @public\n * @memberof ControlsOptionsManager\n */\n public getDisplayHints() {\n return this.displayHints;\n }\n\n /**\n * @param {Object} options\n * @returns {void}\n * @private\n * @memberof ControlsOptionsManager\n */\n private extract(options?: {locusUrl: string; displayHints?: Array<string>}) {\n this.setDisplayHints(options?.displayHints);\n this.setLocusUrl(options?.locusUrl);\n }\n\n /**\n * @param {Setting} setting\n * @private\n * @memberof ControlsOptionsManager\n * @returns {Promise}\n */\n private setControls(setting: {[key in Setting]?: boolean}): Promise<any> {\n LoggerProxy.logger.log(\n `ControlsOptionsManager:index#setControls --> ${JSON.stringify(setting)}`\n );\n\n const body: Record<string, any> = {};\n let error: PermissionError;\n\n Object.entries(setting).forEach(([key, value]) => {\n if (!Util?.[`${value ? CAN_SET : CAN_UNSET}${key}`](this.displayHints)) {\n error = new PermissionError(`${key} [${value}] not allowed, due to moderator property.`);\n }\n\n if (error) {\n return;\n }\n\n switch (key) {\n case Setting.muted:\n body.audio = body.audio\n ? {...body.audio, [camelCase(key)]: value}\n : {[camelCase(key)]: value};\n break;\n\n case Setting.disallowUnmute:\n case Setting.muteOnEntry:\n if (Object.keys(setting).includes(Setting.muted)) {\n body.audio = body.audio\n ? {...body.audio, [camelCase(key)]: value}\n : {[camelCase(key)]: value};\n body.audio[camelCase(key)] = value;\n } else {\n body[camelCase(key)] = {[ENABLED]: value};\n }\n break;\n\n default:\n error = new PermissionError(`${key} [${value}] not allowed, due to moderator property.`);\n }\n });\n\n if (error) {\n return Promise.reject(error);\n }\n\n // @ts-ignore\n return this.request.request({\n uri: `${this.locusUrl}/${CONTROLS}`,\n body,\n method: HTTP_VERBS.PATCH,\n });\n }\n\n /**\n * @public\n * @param {boolean} enabled\n * @memberof ControlsOptionsManager\n * @returns {Promise}\n */\n public setMuteOnEntry(enabled: boolean): Promise<any> {\n return this.setControls({[Setting.muteOnEntry]: enabled});\n }\n\n /**\n * @public\n * @param {boolean} enabled\n * @memberof ControlsOptionsManager\n * @returns {Promise}\n */\n public setDisallowUnmute(enabled: boolean): Promise<any> {\n return this.setControls({[Setting.disallowUnmute]: enabled});\n }\n\n /**\n * @public\n * @param {boolean} mutedEnabled\n * @param {boolean} disallowUnmuteEnabled\n * @param {boolean} muteOnEntryEnabled\n * @memberof ControlsOptionsManager\n * @returns {Promise}\n */\n public setMuteAll(\n mutedEnabled: boolean,\n disallowUnmuteEnabled: boolean,\n muteOnEntryEnabled: boolean\n ): Promise<any> {\n return this.setControls({\n [Setting.muted]: mutedEnabled,\n [Setting.disallowUnmute]: disallowUnmuteEnabled,\n [Setting.muteOnEntry]: muteOnEntryEnabled,\n });\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AACA;AACA;AAEA;AACA;AACA;AACA;AAAwD;AAAA;AAExD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AALA,IAMqBA,sBAAsB;EACzC;AACF;AACA;AACA;AACA;AACA;;EAGE;AACF;AACA;AACA;AACA;AACA;;EAGE;AACF;AACA;AACA;AACA;AACA;;EAGE;AACF;AACA;AACA;AACA;AACA;EACE,gCACEC,OAAuB,EACvBC,OAGC,EACD;IAAA;IAAA;IAAA,oDAtBoC,EAAE;IAAA;IAuBtC,IAAI,CAACC,UAAU,CAACF,OAAO,CAAC;IACxB,IAAI,CAACG,GAAG,CAACF,OAAO,CAAC;EACnB;;EAEA;AACF;AACA;AACA;AACA;AACA;EALE;IAAA;IAAA,OAMA,oBAAmBD,OAAuB,EAAE;MAC1C,IAAI,CAACA,OAAO,GAAGA,OAAO;IACxB;;IAEA;AACF;AACA;AACA;AACA;AACA;EALE;IAAA;IAAA,OAMA,aAAWC,OAA0D,EAAE;MACrE,IAAI,CAACG,OAAO,CAACH,OAAO,CAAC;IACvB;;IAEA;AACF;AACA;AACA;AACA;AACA;EALE;IAAA;IAAA,OAMA,qBAAmBI,GAAW,EAAE;MAC9B,IAAI,CAACC,QAAQ,GAAGD,GAAG;IACrB;;IAEA;AACF;AACA;AACA;AACA;AAC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,WAAW,mCAAGd,cAAO,CAACG,cAAc,EAAGU,OAAO,EAAE;IAC9D;;IAEA;AACF;AACA;AACA;AACA;AACA;AACA;AACA;EAPE;IAAA;IAAA,OAQA,oBACEE,YAAqB,EACrBC,qBAA8B,EAC9BC,kBAA2B,EACb;MAAA;MACd,OAAO,IAAI,CAACH,WAAW,6EACpBd,cAAO,CAACC,KAAK,EAAGc,YAAY,qDAC5Bf,cAAO,CAACG,cAAc,EAAGa,qBAAqB,qDAC9ChB,cAAO,CAACI,WAAW,EAAGa,kBAAkB,uBACzC;IACJ;EAAC;EAAA;AAAA;AAAA"}
|
|
@@ -113,8 +113,10 @@ var RemoteMedia = /*#__PURE__*/function (_EventsScope) {
|
|
|
113
113
|
fs = 240;
|
|
114
114
|
} else if (height < 540) {
|
|
115
115
|
fs = 920;
|
|
116
|
-
} else {
|
|
116
|
+
} else if (height <= 720) {
|
|
117
117
|
fs = 3600;
|
|
118
|
+
} else {
|
|
119
|
+
fs = 8192;
|
|
118
120
|
}
|
|
119
121
|
(_this$receiveSlot = this.receiveSlot) === null || _this$receiveSlot === void 0 ? void 0 : _this$receiveSlot.setMaxFs(fs);
|
|
120
122
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["RemoteMediaEvents","SourceUpdate","ReceiveSlotEvents","Stopped","getMaxFs","paneSize","maxFs","LoggerProxy","logger","warn","remoteMediaCounter","RemoteMedia","receiveSlot","mediaRequestManager","options","setupEventListeners","id","width","height","fs","setMaxFs","commit","cancelMediaRequest","removeAllListeners","undefined","emit","file","function","csi","mediaRequestId","Error","addRequest","policyInfo","policy","receiveSlots","codecInfo","resolution","codec","cancelRequest","scope","on","data","mediaType","memberId","sourceState","stream","EventsScope"],"sources":["remoteMedia.ts"],"sourcesContent":["/* eslint-disable valid-jsdoc */\nimport {MediaType, SourceState} from '@webex/internal-media-core';\nimport LoggerProxy from '../common/logs/logger-proxy';\nimport EventsScope from '../common/events/events-scope';\n\nimport {MediaRequestId, MediaRequestManager} from './mediaRequestManager';\nimport {CSI, ReceiveSlot, ReceiveSlotEvents} from './receiveSlot';\n\nexport const RemoteMediaEvents = {\n SourceUpdate: ReceiveSlotEvents.SourceUpdate,\n Stopped: 'stopped',\n};\n\nexport type RemoteVideoResolution =\n | 'thumbnail' // the smallest possible resolution, 90p or less\n | 'very small' // 180p or less\n | 'small' // 360p or less\n | 'medium' // 720p or less\n | 'large' // 1080p or less\n | 'best'; // highest possible resolution\n\n/**\n * Converts pane size into h264 maxFs\n * @param {PaneSize} paneSize\n * @returns {number}\n */\nexport function getMaxFs(paneSize: RemoteVideoResolution): number {\n let maxFs;\n\n switch (paneSize) {\n case 'thumbnail':\n maxFs = 60;\n break;\n case 'very small':\n maxFs = 240;\n break;\n case 'small':\n maxFs = 920;\n break;\n case 'medium':\n maxFs = 3600;\n break;\n case 'large':\n maxFs = 8192;\n break;\n case 'best':\n maxFs = 8192; // for now 'best' is 1080p, so same as 'large'\n break;\n default:\n LoggerProxy.logger.warn(\n `RemoteMedia#getMaxFs --> unsupported paneSize: ${paneSize}, using \"medium\" instead`\n );\n maxFs = 3600;\n }\n\n return maxFs;\n}\n\ntype Options = {\n resolution?: RemoteVideoResolution; // applies only to groups of type MediaType.VideoMain and MediaType.VideoSlides\n};\n\nexport type RemoteMediaId = string;\n\nlet remoteMediaCounter = 0;\n\n/**\n * Class representing a remote audio/video stream.\n *\n * Internally it is associated with a specific receive slot\n * and a media request for it.\n */\nexport class RemoteMedia extends EventsScope {\n private receiveSlot?: ReceiveSlot;\n\n private readonly mediaRequestManager: MediaRequestManager;\n\n private readonly options: Options;\n\n private mediaRequestId?: MediaRequestId;\n\n public readonly id: RemoteMediaId;\n\n /**\n * Constructs RemoteMedia instance\n *\n * @param receiveSlot\n * @param mediaRequestManager\n * @param options\n */\n constructor(\n receiveSlot: ReceiveSlot,\n mediaRequestManager: MediaRequestManager,\n options?: Options\n ) {\n super();\n remoteMediaCounter += 1;\n this.receiveSlot = receiveSlot;\n this.mediaRequestManager = mediaRequestManager;\n this.options = options || {};\n this.setupEventListeners();\n this.id = `RM${remoteMediaCounter}-${this.receiveSlot.id}`;\n }\n\n /**\n * Supply the width and height of the video element\n * to restrict the requested resolution to this size\n * @param width width of the video element\n * @param height height of the video element\n */\n public setSizeHint(width, height) {\n // only base on height for now\n let fs: number;\n\n if (height < 135) {\n fs = 60;\n } else if (height < 270) {\n fs = 240;\n } else if (height < 540) {\n fs = 920;\n } else {\n fs = 3600;\n }\n\n this.receiveSlot?.setMaxFs(fs);\n }\n\n /**\n * Invalidates the remote media by clearing the reference to a receive slot and\n * cancelling the media request.\n * After this call the remote media is unusable.\n *\n * @param {boolean} commit - whether to commit the cancellation of the media request\n * @internal\n */\n public stop(commit = true) {\n this.cancelMediaRequest(commit);\n this.receiveSlot?.removeAllListeners();\n this.receiveSlot = undefined;\n this.emit(\n {\n file: 'multistream/remoteMedia',\n function: 'stop',\n },\n RemoteMediaEvents.Stopped,\n {}\n );\n }\n\n /**\n * Sends a new media request. This method can only be used for receiver-selected policy,\n * because only in that policy we have a 1-1 relationship between RemoteMedia and MediaRequest\n * and the request id is then stored in this RemoteMedia instance.\n * For active-speaker policy, the same request is shared among many RemoteMedia instances,\n * so it's managed through RemoteMediaGroup\n *\n * @internal\n */\n public sendMediaRequest(csi: CSI, commit: boolean) {\n if (this.mediaRequestId) {\n this.cancelMediaRequest(false);\n }\n\n if (!this.receiveSlot) {\n throw new Error('sendMediaRequest() called on an invalidated RemoteMedia instance');\n }\n\n this.mediaRequestId = this.mediaRequestManager.addRequest(\n {\n policyInfo: {\n policy: 'receiver-selected',\n csi,\n },\n receiveSlots: [this.receiveSlot],\n codecInfo: this.options.resolution && {\n codec: 'h264',\n maxFs: getMaxFs(this.options.resolution),\n },\n },\n commit\n );\n }\n\n /**\n * @internal\n */\n public cancelMediaRequest(commit: boolean) {\n if (this.mediaRequestId) {\n this.mediaRequestManager.cancelRequest(this.mediaRequestId, commit);\n this.mediaRequestId = undefined;\n }\n }\n\n /**\n * registers event listeners on the receive slot and forwards all the events\n */\n private setupEventListeners() {\n if (this.receiveSlot) {\n const scope = {\n file: 'multistream/remoteMedia',\n function: 'setupEventListeners',\n };\n\n this.receiveSlot.on(ReceiveSlotEvents.SourceUpdate, (data) => {\n this.emit(scope, RemoteMediaEvents.SourceUpdate, data);\n });\n }\n }\n\n /**\n * Getter for mediaType\n */\n public get mediaType(): MediaType {\n return this.receiveSlot?.mediaType;\n }\n\n /**\n * Getter for memberId\n */\n public get memberId() {\n return this.receiveSlot?.memberId;\n }\n\n /**\n * Getter for csi\n */\n public get csi() {\n return this.receiveSlot?.csi;\n }\n\n /**\n * Getter for source state\n */\n public get sourceState(): SourceState {\n return this.receiveSlot?.sourceState;\n }\n\n /**\n * Getter for remote media stream\n */\n public get stream() {\n return this.receiveSlot?.stream;\n }\n\n /**\n * @internal\n * @returns {ReceiveSlot}\n */\n public getUnderlyingReceiveSlot() {\n return this.receiveSlot;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAEA;AACA;AAGA;AAAkE;AAAA;AAE3D,IAAMA,iBAAiB,GAAG;EAC/BC,YAAY,EAAEC,8BAAiB,CAACD,YAAY;EAC5CE,OAAO,EAAE;AACX,CAAC;AAAC;AAQU;;AAEZ;AACA;AACA;AACA;AACA;AACO,SAASC,QAAQ,CAACC,QAA+B,EAAU;EAChE,IAAIC,KAAK;EAET,QAAQD,QAAQ;IACd,KAAK,WAAW;MACdC,KAAK,GAAG,EAAE;MACV;IACF,KAAK,YAAY;MACfA,KAAK,GAAG,GAAG;MACX;IACF,KAAK,OAAO;MACVA,KAAK,GAAG,GAAG;MACX;IACF,KAAK,QAAQ;MACXA,KAAK,GAAG,IAAI;MACZ;IACF,KAAK,OAAO;MACVA,KAAK,GAAG,IAAI;MACZ;IACF,KAAK,MAAM;MACTA,KAAK,GAAG,IAAI,CAAC,CAAC;MACd;IACF;MACEC,oBAAW,CAACC,MAAM,CAACC,IAAI,0DAC6BJ,QAAQ,gCAC3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AQ,EAAE;QACZ,CAAC;QAED,IAAI,CAACf,WAAW,CAAC4B,EAAE,CAACtC,8BAAiB,CAACD,YAAY,EAAE,UAACwC,IAAI,EAAK;UAC5D,MAAI,CAAChB,IAAI,CAACc,KAAK,EAAEvC,iBAAiB,CAACC,YAAY,EAAEwC,IAAI,CAAC;QACxD,CAAC,CAAC;MACJ;IACF;;IAEA;AACF;AACA;EAFE;IAAA;IAAA,KAGA,eAAkC;MAAA;MAChC,6BAAO,IAAI,CAAC7B,WAAW,uDAAhB,mBAAkB8B,SAAS;IACpC;;IAEA;AACF;AACA;EAFE;IAAA;IAAA,KAGA,eAAsB;MAAA;MACpB,6BAAO,IAAI,CAAC9B,WAAW,uDAAhB,mBAAkB+B,QAAQ;IACnC;;IAEA;AACF;AACA;EAFE;IAAA;IAAA,KAGA,eAAiB;MAAA;MACf,6BAAO,IAAI,CAAC/B,WAAW,uDAAhB,mBAAkBgB,GAAG;IAC9B;;IAEA;AACF;AACA;EAFE;IAAA;IAAA,KAGA,eAAsC;MAAA;MACpC,6BAAO,IAAI,CAAChB,WAAW,uDAAhB,mBAAkBgC,WAAW;IACtC;;IAEA;AACF;AACA;EAFE;IAAA;IAAA,KAGA,eAAoB;MAAA;MAClB,6BAAO,IAAI,CAAChC,WAAW,uDAAhB,mBAAkBiC,MAAM;IACjC;;IAEA;AACF;AACA;AACA;EAHE;IAAA;IAAA,OAIA,oCAAkC;MAChC,OAAO,IAAI,CAACjC,WAAW;IACzB;EAAC;EAAA;AAAA,EAlL8BkC,oBAAW;AAAA"}
|
|
1
|
+
{"version":3,"names":["RemoteMediaEvents","SourceUpdate","ReceiveSlotEvents","Stopped","getMaxFs","paneSize","maxFs","LoggerProxy","logger","warn","remoteMediaCounter","RemoteMedia","receiveSlot","mediaRequestManager","options","setupEventListeners","id","width","height","fs","setMaxFs","commit","cancelMediaRequest","removeAllListeners","undefined","emit","file","function","csi","mediaRequestId","Error","addRequest","policyInfo","policy","receiveSlots","codecInfo","resolution","codec","cancelRequest","scope","on","data","mediaType","memberId","sourceState","stream","EventsScope"],"sources":["remoteMedia.ts"],"sourcesContent":["/* eslint-disable valid-jsdoc */\nimport {MediaType, SourceState} from '@webex/internal-media-core';\nimport LoggerProxy from '../common/logs/logger-proxy';\nimport EventsScope from '../common/events/events-scope';\n\nimport {MediaRequestId, MediaRequestManager} from './mediaRequestManager';\nimport {CSI, ReceiveSlot, ReceiveSlotEvents} from './receiveSlot';\n\nexport const RemoteMediaEvents = {\n SourceUpdate: ReceiveSlotEvents.SourceUpdate,\n Stopped: 'stopped',\n};\n\nexport type RemoteVideoResolution =\n | 'thumbnail' // the smallest possible resolution, 90p or less\n | 'very small' // 180p or less\n | 'small' // 360p or less\n | 'medium' // 720p or less\n | 'large' // 1080p or less\n | 'best'; // highest possible resolution\n\n/**\n * Converts pane size into h264 maxFs\n * @param {PaneSize} paneSize\n * @returns {number}\n */\nexport function getMaxFs(paneSize: RemoteVideoResolution): number {\n let maxFs;\n\n switch (paneSize) {\n case 'thumbnail':\n maxFs = 60;\n break;\n case 'very small':\n maxFs = 240;\n break;\n case 'small':\n maxFs = 920;\n break;\n case 'medium':\n maxFs = 3600;\n break;\n case 'large':\n maxFs = 8192;\n break;\n case 'best':\n maxFs = 8192; // for now 'best' is 1080p, so same as 'large'\n break;\n default:\n LoggerProxy.logger.warn(\n `RemoteMedia#getMaxFs --> unsupported paneSize: ${paneSize}, using \"medium\" instead`\n );\n maxFs = 3600;\n }\n\n return maxFs;\n}\n\ntype Options = {\n resolution?: RemoteVideoResolution; // applies only to groups of type MediaType.VideoMain and MediaType.VideoSlides\n};\n\nexport type RemoteMediaId = string;\n\nlet remoteMediaCounter = 0;\n\n/**\n * Class representing a remote audio/video stream.\n *\n * Internally it is associated with a specific receive slot\n * and a media request for it.\n */\nexport class RemoteMedia extends EventsScope {\n private receiveSlot?: ReceiveSlot;\n\n private readonly mediaRequestManager: MediaRequestManager;\n\n private readonly options: Options;\n\n private mediaRequestId?: MediaRequestId;\n\n public readonly id: RemoteMediaId;\n\n /**\n * Constructs RemoteMedia instance\n *\n * @param receiveSlot\n * @param mediaRequestManager\n * @param options\n */\n constructor(\n receiveSlot: ReceiveSlot,\n mediaRequestManager: MediaRequestManager,\n options?: Options\n ) {\n super();\n remoteMediaCounter += 1;\n this.receiveSlot = receiveSlot;\n this.mediaRequestManager = mediaRequestManager;\n this.options = options || {};\n this.setupEventListeners();\n this.id = `RM${remoteMediaCounter}-${this.receiveSlot.id}`;\n }\n\n /**\n * Supply the width and height of the video element\n * to restrict the requested resolution to this size\n * @param width width of the video element\n * @param height height of the video element\n */\n public setSizeHint(width, height) {\n // only base on height for now\n let fs: number;\n\n if (height < 135) {\n fs = 60;\n } else if (height < 270) {\n fs = 240;\n } else if (height < 540) {\n fs = 920;\n } else if (height <= 720) {\n fs = 3600;\n } else {\n fs = 8192;\n }\n\n this.receiveSlot?.setMaxFs(fs);\n }\n\n /**\n * Invalidates the remote media by clearing the reference to a receive slot and\n * cancelling the media request.\n * After this call the remote media is unusable.\n *\n * @param {boolean} commit - whether to commit the cancellation of the media request\n * @internal\n */\n public stop(commit = true) {\n this.cancelMediaRequest(commit);\n this.receiveSlot?.removeAllListeners();\n this.receiveSlot = undefined;\n this.emit(\n {\n file: 'multistream/remoteMedia',\n function: 'stop',\n },\n RemoteMediaEvents.Stopped,\n {}\n );\n }\n\n /**\n * Sends a new media request. This method can only be used for receiver-selected policy,\n * because only in that policy we have a 1-1 relationship between RemoteMedia and MediaRequest\n * and the request id is then stored in this RemoteMedia instance.\n * For active-speaker policy, the same request is shared among many RemoteMedia instances,\n * so it's managed through RemoteMediaGroup\n *\n * @internal\n */\n public sendMediaRequest(csi: CSI, commit: boolean) {\n if (this.mediaRequestId) {\n this.cancelMediaRequest(false);\n }\n\n if (!this.receiveSlot) {\n throw new Error('sendMediaRequest() called on an invalidated RemoteMedia instance');\n }\n\n this.mediaRequestId = this.mediaRequestManager.addRequest(\n {\n policyInfo: {\n policy: 'receiver-selected',\n csi,\n },\n receiveSlots: [this.receiveSlot],\n codecInfo: this.options.resolution && {\n codec: 'h264',\n maxFs: getMaxFs(this.options.resolution),\n },\n },\n commit\n );\n }\n\n /**\n * @internal\n */\n public cancelMediaRequest(commit: boolean) {\n if (this.mediaRequestId) {\n this.mediaRequestManager.cancelRequest(this.mediaRequestId, commit);\n this.mediaRequestId = undefined;\n }\n }\n\n /**\n * registers event listeners on the receive slot and forwards all the events\n */\n private setupEventListeners() {\n if (this.receiveSlot) {\n const scope = {\n file: 'multistream/remoteMedia',\n function: 'setupEventListeners',\n };\n\n this.receiveSlot.on(ReceiveSlotEvents.SourceUpdate, (data) => {\n this.emit(scope, RemoteMediaEvents.SourceUpdate, data);\n });\n }\n }\n\n /**\n * Getter for mediaType\n */\n public get mediaType(): MediaType {\n return this.receiveSlot?.mediaType;\n }\n\n /**\n * Getter for memberId\n */\n public get memberId() {\n return this.receiveSlot?.memberId;\n }\n\n /**\n * Getter for csi\n */\n public get csi() {\n return this.receiveSlot?.csi;\n }\n\n /**\n * Getter for source state\n */\n public get sourceState(): SourceState {\n return this.receiveSlot?.sourceState;\n }\n\n /**\n * Getter for remote media stream\n */\n public get stream() {\n return this.receiveSlot?.stream;\n }\n\n /**\n * @internal\n * @returns {ReceiveSlot}\n */\n public getUnderlyingReceiveSlot() {\n return this.receiveSlot;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAEA;AACA;AAGA;AAAkE;AAAA;AAE3D,IAAMA,iBAAiB,GAAG;EAC/BC,YAAY,EAAEC,8BAAiB,CAACD,YAAY;EAC5CE,OAAO,EAAE;AACX,CAAC;AAAC;AAQU;;AAEZ;AACA;AACA;AACA;AACA;AACO,SAASC,QAAQ,CAACC,QAA+B,EAAU;EAChE,IAAIC,KAAK;EAET,QAAQD,QAAQ;IACd,KAAK,WAAW;MACdC,KAAK,GAAG,EAAE;MACV;IACF,KAAK,YAAY;MACfA,KAAK,GAAG,GAAG;MACX;IACF,KAAK,OAAO;MACVA,KAAK,GA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;AAAA,EApL8BkC,oBAAW;AAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webex/plugin-meetings",
|
|
3
|
-
"version": "3.0.0-beta.
|
|
3
|
+
"version": "3.0.0-beta.56",
|
|
4
4
|
"description": "",
|
|
5
5
|
"license": "Cisco EULA (https://www.cisco.com/c/en/us/products/end-user-license-agreement.html)",
|
|
6
6
|
"contributors": [
|
|
@@ -32,12 +32,12 @@
|
|
|
32
32
|
"build": "yarn run -T tsc --declaration true --declarationDir ./dist/types"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
|
-
"@webex/plugin-meetings": "3.0.0-beta.
|
|
36
|
-
"@webex/test-helper-chai": "3.0.0-beta.
|
|
37
|
-
"@webex/test-helper-mocha": "3.0.0-beta.
|
|
38
|
-
"@webex/test-helper-mock-webex": "3.0.0-beta.
|
|
39
|
-
"@webex/test-helper-retry": "3.0.0-beta.
|
|
40
|
-
"@webex/test-helper-test-users": "3.0.0-beta.
|
|
35
|
+
"@webex/plugin-meetings": "3.0.0-beta.56",
|
|
36
|
+
"@webex/test-helper-chai": "3.0.0-beta.56",
|
|
37
|
+
"@webex/test-helper-mocha": "3.0.0-beta.56",
|
|
38
|
+
"@webex/test-helper-mock-webex": "3.0.0-beta.56",
|
|
39
|
+
"@webex/test-helper-retry": "3.0.0-beta.56",
|
|
40
|
+
"@webex/test-helper-test-users": "3.0.0-beta.56",
|
|
41
41
|
"chai": "^4.3.4",
|
|
42
42
|
"chai-as-promised": "^7.1.1",
|
|
43
43
|
"jsdom-global": "3.0.2",
|
|
@@ -46,18 +46,18 @@
|
|
|
46
46
|
"typescript": "^4.7.4"
|
|
47
47
|
},
|
|
48
48
|
"dependencies": {
|
|
49
|
-
"@webex/common": "3.0.0-beta.
|
|
49
|
+
"@webex/common": "3.0.0-beta.56",
|
|
50
50
|
"@webex/internal-media-core": "1.35.3",
|
|
51
|
-
"@webex/internal-plugin-conversation": "3.0.0-beta.
|
|
52
|
-
"@webex/internal-plugin-device": "3.0.0-beta.
|
|
53
|
-
"@webex/internal-plugin-llm": "3.0.0-beta.
|
|
54
|
-
"@webex/internal-plugin-mercury": "3.0.0-beta.
|
|
55
|
-
"@webex/internal-plugin-metrics": "3.0.0-beta.
|
|
56
|
-
"@webex/internal-plugin-support": "3.0.0-beta.
|
|
57
|
-
"@webex/internal-plugin-user": "3.0.0-beta.
|
|
58
|
-
"@webex/plugin-people": "3.0.0-beta.
|
|
59
|
-
"@webex/plugin-rooms": "3.0.0-beta.
|
|
60
|
-
"@webex/webex-core": "3.0.0-beta.
|
|
51
|
+
"@webex/internal-plugin-conversation": "3.0.0-beta.56",
|
|
52
|
+
"@webex/internal-plugin-device": "3.0.0-beta.56",
|
|
53
|
+
"@webex/internal-plugin-llm": "3.0.0-beta.56",
|
|
54
|
+
"@webex/internal-plugin-mercury": "3.0.0-beta.56",
|
|
55
|
+
"@webex/internal-plugin-metrics": "3.0.0-beta.56",
|
|
56
|
+
"@webex/internal-plugin-support": "3.0.0-beta.56",
|
|
57
|
+
"@webex/internal-plugin-user": "3.0.0-beta.56",
|
|
58
|
+
"@webex/plugin-people": "3.0.0-beta.56",
|
|
59
|
+
"@webex/plugin-rooms": "3.0.0-beta.56",
|
|
60
|
+
"@webex/webex-core": "3.0.0-beta.56",
|
|
61
61
|
"ampersand-collection": "^2.0.2",
|
|
62
62
|
"bowser": "^2.11.0",
|
|
63
63
|
"btoa": "^1.2.1",
|
|
@@ -140,32 +140,48 @@ export default class ControlsOptionsManager {
|
|
|
140
140
|
* @returns {Promise}
|
|
141
141
|
*/
|
|
142
142
|
private setControls(setting: {[key in Setting]?: boolean}): Promise<any> {
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
)
|
|
158
|
-
);
|
|
159
|
-
}
|
|
160
|
-
} else if (Util?.[`${value ? CAN_SET : CAN_UNSET}${key}`](this.displayHints)) {
|
|
161
|
-
body[camelCase(key)] = {
|
|
162
|
-
[ENABLED]: value,
|
|
163
|
-
};
|
|
164
|
-
} else {
|
|
165
|
-
return Promise.reject(
|
|
166
|
-
new PermissionError(`${key} [${value}] not allowed, due to moderator property.`)
|
|
167
|
-
);
|
|
143
|
+
LoggerProxy.logger.log(
|
|
144
|
+
`ControlsOptionsManager:index#setControls --> ${JSON.stringify(setting)}`
|
|
145
|
+
);
|
|
146
|
+
|
|
147
|
+
const body: Record<string, any> = {};
|
|
148
|
+
let error: PermissionError;
|
|
149
|
+
|
|
150
|
+
Object.entries(setting).forEach(([key, value]) => {
|
|
151
|
+
if (!Util?.[`${value ? CAN_SET : CAN_UNSET}${key}`](this.displayHints)) {
|
|
152
|
+
error = new PermissionError(`${key} [${value}] not allowed, due to moderator property.`);
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
if (error) {
|
|
156
|
+
return;
|
|
168
157
|
}
|
|
158
|
+
|
|
159
|
+
switch (key) {
|
|
160
|
+
case Setting.muted:
|
|
161
|
+
body.audio = body.audio
|
|
162
|
+
? {...body.audio, [camelCase(key)]: value}
|
|
163
|
+
: {[camelCase(key)]: value};
|
|
164
|
+
break;
|
|
165
|
+
|
|
166
|
+
case Setting.disallowUnmute:
|
|
167
|
+
case Setting.muteOnEntry:
|
|
168
|
+
if (Object.keys(setting).includes(Setting.muted)) {
|
|
169
|
+
body.audio = body.audio
|
|
170
|
+
? {...body.audio, [camelCase(key)]: value}
|
|
171
|
+
: {[camelCase(key)]: value};
|
|
172
|
+
body.audio[camelCase(key)] = value;
|
|
173
|
+
} else {
|
|
174
|
+
body[camelCase(key)] = {[ENABLED]: value};
|
|
175
|
+
}
|
|
176
|
+
break;
|
|
177
|
+
|
|
178
|
+
default:
|
|
179
|
+
error = new PermissionError(`${key} [${value}] not allowed, due to moderator property.`);
|
|
180
|
+
}
|
|
181
|
+
});
|
|
182
|
+
|
|
183
|
+
if (error) {
|
|
184
|
+
return Promise.reject(error);
|
|
169
185
|
}
|
|
170
186
|
|
|
171
187
|
// @ts-ignore
|
|
@@ -240,6 +240,8 @@ describe('RemoteMedia', () => {
|
|
|
240
240
|
{height: 270, fs: 920},
|
|
241
241
|
{height: 539, fs: 920},
|
|
242
242
|
{height: 540, fs: 3600},
|
|
243
|
+
{height: 720, fs: 3600},
|
|
244
|
+
{height: 721, fs: 8192},
|
|
243
245
|
],
|
|
244
246
|
({height, fs}) => {
|
|
245
247
|
it(`sets the max fs to ${fs} correctly when height is ${height}`, () => {
|