@webex/plugin-meetings 3.7.0-next.14 → 3.7.0-next.16
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/interpretation/index.js +1 -1
- package/dist/interpretation/siLanguage.js +1 -1
- package/dist/multistream/remoteMedia.js +30 -15
- package/dist/multistream/remoteMedia.js.map +1 -1
- package/dist/webinar/index.js +1 -1
- package/package.json +21 -21
- package/src/multistream/remoteMedia.ts +28 -15
- package/test/unit/spec/multistream/remoteMedia.ts +11 -7
package/dist/breakouts/index.js
CHANGED
|
@@ -1046,7 +1046,7 @@ var Breakouts = _webexCore.WebexPlugin.extend({
|
|
|
1046
1046
|
this.trigger(_constants.BREAKOUTS.EVENTS.ASK_RETURN_TO_MAIN);
|
|
1047
1047
|
}
|
|
1048
1048
|
},
|
|
1049
|
-
version: "3.7.0-next.
|
|
1049
|
+
version: "3.7.0-next.16"
|
|
1050
1050
|
});
|
|
1051
1051
|
var _default = exports.default = Breakouts;
|
|
1052
1052
|
//# sourceMappingURL=index.js.map
|
|
@@ -373,7 +373,7 @@ var SimultaneousInterpretation = _webexCore.WebexPlugin.extend({
|
|
|
373
373
|
throw error;
|
|
374
374
|
});
|
|
375
375
|
},
|
|
376
|
-
version: "3.7.0-next.
|
|
376
|
+
version: "3.7.0-next.16"
|
|
377
377
|
});
|
|
378
378
|
var _default = exports.default = SimultaneousInterpretation;
|
|
379
379
|
//# sourceMappingURL=index.js.map
|
|
@@ -18,7 +18,7 @@ var SILanguage = _webexCore.WebexPlugin.extend({
|
|
|
18
18
|
languageCode: 'number',
|
|
19
19
|
languageName: 'string'
|
|
20
20
|
},
|
|
21
|
-
version: "3.7.0-next.
|
|
21
|
+
version: "3.7.0-next.16"
|
|
22
22
|
});
|
|
23
23
|
var _default = exports.default = SILanguage;
|
|
24
24
|
//# sourceMappingURL=siLanguage.js.map
|
|
@@ -26,6 +26,14 @@ var RemoteMediaEvents = exports.RemoteMediaEvents = {
|
|
|
26
26
|
};
|
|
27
27
|
// highest possible resolution
|
|
28
28
|
|
|
29
|
+
var MAX_FS_VALUES = {
|
|
30
|
+
'90p': 60,
|
|
31
|
+
'180p': 240,
|
|
32
|
+
'360p': 920,
|
|
33
|
+
'720p': 3600,
|
|
34
|
+
'1080p': 8192
|
|
35
|
+
};
|
|
36
|
+
|
|
29
37
|
/**
|
|
30
38
|
* Converts pane size into h264 maxFs
|
|
31
39
|
* @param {PaneSize} paneSize
|
|
@@ -35,26 +43,26 @@ function getMaxFs(paneSize) {
|
|
|
35
43
|
var maxFs;
|
|
36
44
|
switch (paneSize) {
|
|
37
45
|
case 'thumbnail':
|
|
38
|
-
maxFs =
|
|
46
|
+
maxFs = MAX_FS_VALUES['90p'];
|
|
39
47
|
break;
|
|
40
48
|
case 'very small':
|
|
41
|
-
maxFs =
|
|
49
|
+
maxFs = MAX_FS_VALUES['180p'];
|
|
42
50
|
break;
|
|
43
51
|
case 'small':
|
|
44
|
-
maxFs =
|
|
52
|
+
maxFs = MAX_FS_VALUES['360p'];
|
|
45
53
|
break;
|
|
46
54
|
case 'medium':
|
|
47
|
-
maxFs =
|
|
55
|
+
maxFs = MAX_FS_VALUES['720p'];
|
|
48
56
|
break;
|
|
49
57
|
case 'large':
|
|
50
|
-
maxFs =
|
|
58
|
+
maxFs = MAX_FS_VALUES['1080p'];
|
|
51
59
|
break;
|
|
52
60
|
case 'best':
|
|
53
|
-
maxFs =
|
|
61
|
+
maxFs = MAX_FS_VALUES['1080p']; // for now 'best' is 1080p, so same as 'large'
|
|
54
62
|
break;
|
|
55
63
|
default:
|
|
56
64
|
_loggerProxy.default.logger.warn("RemoteMedia#getMaxFs --> unsupported paneSize: ".concat(paneSize, ", using \"medium\" instead"));
|
|
57
|
-
maxFs =
|
|
65
|
+
maxFs = MAX_FS_VALUES['720p'];
|
|
58
66
|
}
|
|
59
67
|
return maxFs;
|
|
60
68
|
}
|
|
@@ -110,16 +118,23 @@ var RemoteMedia = exports.RemoteMedia = /*#__PURE__*/function (_EventsScope) {
|
|
|
110
118
|
if (width === 0 || height === 0) {
|
|
111
119
|
return;
|
|
112
120
|
}
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
121
|
+
|
|
122
|
+
// we switch to the next resolution level when the height is 10% more than the current resolution height
|
|
123
|
+
// except for 1080p - we switch to it immediately when the height is more than 720p
|
|
124
|
+
var threshold = 1.1;
|
|
125
|
+
var getThresholdHeight = function getThresholdHeight(h) {
|
|
126
|
+
return Math.round(h * threshold);
|
|
127
|
+
};
|
|
128
|
+
if (height < getThresholdHeight(90)) {
|
|
129
|
+
fs = MAX_FS_VALUES['90p'];
|
|
130
|
+
} else if (height < getThresholdHeight(180)) {
|
|
131
|
+
fs = MAX_FS_VALUES['180p'];
|
|
132
|
+
} else if (height < getThresholdHeight(360)) {
|
|
133
|
+
fs = MAX_FS_VALUES['360p'];
|
|
119
134
|
} else if (height <= 720) {
|
|
120
|
-
fs =
|
|
135
|
+
fs = MAX_FS_VALUES['720p'];
|
|
121
136
|
} else {
|
|
122
|
-
fs =
|
|
137
|
+
fs = MAX_FS_VALUES['1080p'];
|
|
123
138
|
}
|
|
124
139
|
(_this$receiveSlot = this.receiveSlot) === null || _this$receiveSlot === void 0 ? void 0 : _this$receiveSlot.setMaxFs(fs);
|
|
125
140
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_loggerProxy","_interopRequireDefault","require","_eventsScope","_receiveSlot","_createSuper","Derived","hasNativeReflectConstruct","_isNativeReflectConstruct","_createSuperInternal","Super","_getPrototypeOf2","default","result","NewTarget","constructor","_Reflect$construct","arguments","apply","_possibleConstructorReturn2","Reflect","sham","Proxy","Boolean","prototype","valueOf","call","e","RemoteMediaEvents","exports","SourceUpdate","ReceiveSlotEvents","Stopped","getMaxFs","paneSize","maxFs","LoggerProxy","logger","warn","concat","remoteMediaCounter","RemoteMedia","_EventsScope","_inherits2","_super","receiveSlot","mediaRequestManager","options","_this","_classCallCheck2","_defineProperty2","_assertThisInitialized2","setupEventListeners","id","_createClass2","key","value","setSizeHint","width","height","_this$receiveSlot","fs","setMaxFs","stop","_this$receiveSlot2","commit","length","undefined","cancelMediaRequest","removeAllListeners","emit","file","function","sendMediaRequest","csi","mediaRequestId","Error","addRequest","policyInfo","policy","receiveSlots","codecInfo","resolution","codec","cancelRequest","_this2","scope","on","data","get","_this$receiveSlot3","mediaType","_this$receiveSlot4","memberId","_this$receiveSlot5","_this$receiveSlot6","sourceState","_this$receiveSlot7","stream","getUnderlyingReceiveSlot","EventsScope"],"sources":["remoteMedia.ts"],"sourcesContent":["/* eslint-disable valid-jsdoc */\nimport {MediaType, StreamState} 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 * @note width/height of 0 will be ignored\n */\n public setSizeHint(width, height) {\n // only base on height for now\n let fs: number;\n\n if (width === 0 || height === 0) {\n return;\n }\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(): StreamState {\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 getUnderlying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,IAAAQ,kBAAA;MAClB,QAAAA,kBAAA,GAAO,IAAI,CAACpD,WAAW,cAAAoD,kBAAA,uBAAhBA,kBAAA,CAAkBC,MAAM;IACjC;;IAEA;AACF;AACA;AACA;EAHE;IAAA3C,GAAA;IAAAC,KAAA,EAIA,SAAA2C,yBAAA,EAAkC;MAChC,OAAO,IAAI,CAACtD,WAAW;IACzB;EAAC;EAAA,OAAAJ,WAAA;AAAA,EAzL8B2D,oBAAW"}
|
|
1
|
+
{"version":3,"names":["_loggerProxy","_interopRequireDefault","require","_eventsScope","_receiveSlot","_createSuper","Derived","hasNativeReflectConstruct","_isNativeReflectConstruct","_createSuperInternal","Super","_getPrototypeOf2","default","result","NewTarget","constructor","_Reflect$construct","arguments","apply","_possibleConstructorReturn2","Reflect","sham","Proxy","Boolean","prototype","valueOf","call","e","RemoteMediaEvents","exports","SourceUpdate","ReceiveSlotEvents","Stopped","MAX_FS_VALUES","getMaxFs","paneSize","maxFs","LoggerProxy","logger","warn","concat","remoteMediaCounter","RemoteMedia","_EventsScope","_inherits2","_super","receiveSlot","mediaRequestManager","options","_this","_classCallCheck2","_defineProperty2","_assertThisInitialized2","setupEventListeners","id","_createClass2","key","value","setSizeHint","width","height","_this$receiveSlot","fs","threshold","getThresholdHeight","h","Math","round","setMaxFs","stop","_this$receiveSlot2","commit","length","undefined","cancelMediaRequest","removeAllListeners","emit","file","function","sendMediaRequest","csi","mediaRequestId","Error","addRequest","policyInfo","policy","receiveSlots","codecInfo","resolution","codec","cancelRequest","_this2","scope","on","data","get","_this$receiveSlot3","mediaType","_this$receiveSlot4","memberId","_this$receiveSlot5","_this$receiveSlot6","sourceState","_this$receiveSlot7","stream","getUnderlyingReceiveSlot","EventsScope"],"sources":["remoteMedia.ts"],"sourcesContent":["/* eslint-disable valid-jsdoc */\nimport {MediaType, StreamState} 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\nconst MAX_FS_VALUES = {\n '90p': 60,\n '180p': 240,\n '360p': 920,\n '720p': 3600,\n '1080p': 8192,\n};\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 = MAX_FS_VALUES['90p'];\n break;\n case 'very small':\n maxFs = MAX_FS_VALUES['180p'];\n break;\n case 'small':\n maxFs = MAX_FS_VALUES['360p'];\n break;\n case 'medium':\n maxFs = MAX_FS_VALUES['720p'];\n break;\n case 'large':\n maxFs = MAX_FS_VALUES['1080p'];\n break;\n case 'best':\n maxFs = MAX_FS_VALUES['1080p']; // 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 = MAX_FS_VALUES['720p'];\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 * @note width/height of 0 will be ignored\n */\n public setSizeHint(width, height) {\n // only base on height for now\n let fs: number;\n\n if (width === 0 || height === 0) {\n return;\n }\n\n // we switch to the next resolution level when the height is 10% more than the current resolution height\n // except for 1080p - we switch to it immediately when the height is more than 720p\n const threshold = 1.1;\n const getThresholdHeight = (h: number) => Math.round(h * threshold);\n\n if (height < getThresholdHeight(90)) {\n fs = MAX_FS_VALUES['90p'];\n } else if (height < getThresholdHeight(180)) {\n fs = MAX_FS_VALUES['180p'];\n } else if (height < getThresholdHeight(360)) {\n fs = MAX_FS_VALUES['360p'];\n } else if (height <= 720) {\n fs = MAX_FS_VALUES['720p'];\n } else {\n fs = MAX_FS_VALUES['1080p'];\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(): StreamState {\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,IAAAA,YAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAF,sBAAA,CAAAC,OAAA;AAGA,IAAAE,YAAA,G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;AACF;AACA;EAFE;IAAA3C,GAAA;IAAAuC,GAAA,EAGA,SAAAA,IAAA,EAAiB;MAAA,IAAAK,kBAAA;MACf,QAAAA,kBAAA,GAAO,IAAI,CAACtD,WAAW,cAAAsD,kBAAA,uBAAhBA,kBAAA,CAAkBpB,GAAG;IAC9B;;IAEA;AACF;AACA;EAFE;IAAAxB,GAAA;IAAAuC,GAAA,EAGA,SAAAA,IAAA,EAAsC;MAAA,IAAAM,kBAAA;MACpC,QAAAA,kBAAA,GAAO,IAAI,CAACvD,WAAW,cAAAuD,kBAAA,uBAAhBA,kBAAA,CAAkBC,WAAW;IACtC;;IAEA;AACF;AACA;EAFE;IAAA9C,GAAA;IAAAuC,GAAA,EAGA,SAAAA,IAAA,EAAoB;MAAA,IAAAQ,kBAAA;MAClB,QAAAA,kBAAA,GAAO,IAAI,CAACzD,WAAW,cAAAyD,kBAAA,uBAAhBA,kBAAA,CAAkBC,MAAM;IACjC;;IAEA;AACF;AACA;AACA;EAHE;IAAAhD,GAAA;IAAAC,KAAA,EAIA,SAAAgD,yBAAA,EAAkC;MAChC,OAAO,IAAI,CAAC3D,WAAW;IACzB;EAAC;EAAA,OAAAJ,WAAA;AAAA,EA9L8BgE,oBAAW"}
|
package/dist/webinar/index.js
CHANGED
package/package.json
CHANGED
|
@@ -43,13 +43,13 @@
|
|
|
43
43
|
"@webex/eslint-config-legacy": "0.0.0",
|
|
44
44
|
"@webex/jest-config-legacy": "0.0.0",
|
|
45
45
|
"@webex/legacy-tools": "0.0.0",
|
|
46
|
-
"@webex/plugin-meetings": "3.7.0-next.
|
|
47
|
-
"@webex/plugin-rooms": "3.7.0-next.
|
|
48
|
-
"@webex/test-helper-chai": "3.7.0-next.
|
|
49
|
-
"@webex/test-helper-mocha": "3.7.0-next.
|
|
50
|
-
"@webex/test-helper-mock-webex": "3.7.0-next.
|
|
51
|
-
"@webex/test-helper-retry": "3.7.0-next.
|
|
52
|
-
"@webex/test-helper-test-users": "3.7.0-next.
|
|
46
|
+
"@webex/plugin-meetings": "3.7.0-next.16",
|
|
47
|
+
"@webex/plugin-rooms": "3.7.0-next.5",
|
|
48
|
+
"@webex/test-helper-chai": "3.7.0-next.3",
|
|
49
|
+
"@webex/test-helper-mocha": "3.7.0-next.3",
|
|
50
|
+
"@webex/test-helper-mock-webex": "3.7.0-next.3",
|
|
51
|
+
"@webex/test-helper-retry": "3.7.0-next.3",
|
|
52
|
+
"@webex/test-helper-test-users": "3.7.0-next.3",
|
|
53
53
|
"chai": "^4.3.4",
|
|
54
54
|
"chai-as-promised": "^7.1.1",
|
|
55
55
|
"eslint": "^8.24.0",
|
|
@@ -61,21 +61,21 @@
|
|
|
61
61
|
"typescript": "^4.7.4"
|
|
62
62
|
},
|
|
63
63
|
"dependencies": {
|
|
64
|
-
"@webex/common": "3.7.0-next.
|
|
64
|
+
"@webex/common": "3.7.0-next.3",
|
|
65
65
|
"@webex/internal-media-core": "2.12.2",
|
|
66
|
-
"@webex/internal-plugin-conversation": "3.7.0-next.
|
|
67
|
-
"@webex/internal-plugin-device": "3.7.0-next.
|
|
68
|
-
"@webex/internal-plugin-llm": "3.7.0-next.
|
|
69
|
-
"@webex/internal-plugin-mercury": "3.7.0-next.
|
|
70
|
-
"@webex/internal-plugin-metrics": "3.7.0-next.
|
|
71
|
-
"@webex/internal-plugin-support": "3.7.0-next.
|
|
72
|
-
"@webex/internal-plugin-user": "3.7.0-next.
|
|
73
|
-
"@webex/internal-plugin-voicea": "3.7.0-next.
|
|
74
|
-
"@webex/media-helpers": "3.7.0-next.
|
|
75
|
-
"@webex/plugin-people": "3.7.0-next.
|
|
76
|
-
"@webex/plugin-rooms": "3.7.0-next.
|
|
66
|
+
"@webex/internal-plugin-conversation": "3.7.0-next.5",
|
|
67
|
+
"@webex/internal-plugin-device": "3.7.0-next.3",
|
|
68
|
+
"@webex/internal-plugin-llm": "3.7.0-next.3",
|
|
69
|
+
"@webex/internal-plugin-mercury": "3.7.0-next.3",
|
|
70
|
+
"@webex/internal-plugin-metrics": "3.7.0-next.3",
|
|
71
|
+
"@webex/internal-plugin-support": "3.7.0-next.6",
|
|
72
|
+
"@webex/internal-plugin-user": "3.7.0-next.3",
|
|
73
|
+
"@webex/internal-plugin-voicea": "3.7.0-next.16",
|
|
74
|
+
"@webex/media-helpers": "3.7.0-next.3",
|
|
75
|
+
"@webex/plugin-people": "3.7.0-next.3",
|
|
76
|
+
"@webex/plugin-rooms": "3.7.0-next.5",
|
|
77
77
|
"@webex/web-capabilities": "^1.4.0",
|
|
78
|
-
"@webex/webex-core": "3.7.0-next.
|
|
78
|
+
"@webex/webex-core": "3.7.0-next.3",
|
|
79
79
|
"ampersand-collection": "^2.0.2",
|
|
80
80
|
"bowser": "^2.11.0",
|
|
81
81
|
"btoa": "^1.2.1",
|
|
@@ -91,5 +91,5 @@
|
|
|
91
91
|
"//": [
|
|
92
92
|
"TODO: upgrade jwt-decode when moving to node 18"
|
|
93
93
|
],
|
|
94
|
-
"version": "3.7.0-next.
|
|
94
|
+
"version": "3.7.0-next.16"
|
|
95
95
|
}
|
|
@@ -19,6 +19,14 @@ export type RemoteVideoResolution =
|
|
|
19
19
|
| 'large' // 1080p or less
|
|
20
20
|
| 'best'; // highest possible resolution
|
|
21
21
|
|
|
22
|
+
const MAX_FS_VALUES = {
|
|
23
|
+
'90p': 60,
|
|
24
|
+
'180p': 240,
|
|
25
|
+
'360p': 920,
|
|
26
|
+
'720p': 3600,
|
|
27
|
+
'1080p': 8192,
|
|
28
|
+
};
|
|
29
|
+
|
|
22
30
|
/**
|
|
23
31
|
* Converts pane size into h264 maxFs
|
|
24
32
|
* @param {PaneSize} paneSize
|
|
@@ -29,28 +37,28 @@ export function getMaxFs(paneSize: RemoteVideoResolution): number {
|
|
|
29
37
|
|
|
30
38
|
switch (paneSize) {
|
|
31
39
|
case 'thumbnail':
|
|
32
|
-
maxFs =
|
|
40
|
+
maxFs = MAX_FS_VALUES['90p'];
|
|
33
41
|
break;
|
|
34
42
|
case 'very small':
|
|
35
|
-
maxFs =
|
|
43
|
+
maxFs = MAX_FS_VALUES['180p'];
|
|
36
44
|
break;
|
|
37
45
|
case 'small':
|
|
38
|
-
maxFs =
|
|
46
|
+
maxFs = MAX_FS_VALUES['360p'];
|
|
39
47
|
break;
|
|
40
48
|
case 'medium':
|
|
41
|
-
maxFs =
|
|
49
|
+
maxFs = MAX_FS_VALUES['720p'];
|
|
42
50
|
break;
|
|
43
51
|
case 'large':
|
|
44
|
-
maxFs =
|
|
52
|
+
maxFs = MAX_FS_VALUES['1080p'];
|
|
45
53
|
break;
|
|
46
54
|
case 'best':
|
|
47
|
-
maxFs =
|
|
55
|
+
maxFs = MAX_FS_VALUES['1080p']; // for now 'best' is 1080p, so same as 'large'
|
|
48
56
|
break;
|
|
49
57
|
default:
|
|
50
58
|
LoggerProxy.logger.warn(
|
|
51
59
|
`RemoteMedia#getMaxFs --> unsupported paneSize: ${paneSize}, using "medium" instead`
|
|
52
60
|
);
|
|
53
|
-
maxFs =
|
|
61
|
+
maxFs = MAX_FS_VALUES['720p'];
|
|
54
62
|
}
|
|
55
63
|
|
|
56
64
|
return maxFs;
|
|
@@ -117,16 +125,21 @@ export class RemoteMedia extends EventsScope {
|
|
|
117
125
|
return;
|
|
118
126
|
}
|
|
119
127
|
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
128
|
+
// we switch to the next resolution level when the height is 10% more than the current resolution height
|
|
129
|
+
// except for 1080p - we switch to it immediately when the height is more than 720p
|
|
130
|
+
const threshold = 1.1;
|
|
131
|
+
const getThresholdHeight = (h: number) => Math.round(h * threshold);
|
|
132
|
+
|
|
133
|
+
if (height < getThresholdHeight(90)) {
|
|
134
|
+
fs = MAX_FS_VALUES['90p'];
|
|
135
|
+
} else if (height < getThresholdHeight(180)) {
|
|
136
|
+
fs = MAX_FS_VALUES['180p'];
|
|
137
|
+
} else if (height < getThresholdHeight(360)) {
|
|
138
|
+
fs = MAX_FS_VALUES['360p'];
|
|
126
139
|
} else if (height <= 720) {
|
|
127
|
-
fs =
|
|
140
|
+
fs = MAX_FS_VALUES['720p'];
|
|
128
141
|
} else {
|
|
129
|
-
fs =
|
|
142
|
+
fs = MAX_FS_VALUES['1080p'];
|
|
130
143
|
}
|
|
131
144
|
|
|
132
145
|
this.receiveSlot?.setMaxFs(fs);
|
|
@@ -249,14 +249,18 @@ describe('RemoteMedia', () => {
|
|
|
249
249
|
|
|
250
250
|
forEach(
|
|
251
251
|
[
|
|
252
|
-
{height:
|
|
253
|
-
{height:
|
|
254
|
-
{height:
|
|
255
|
-
{height:
|
|
256
|
-
{height:
|
|
257
|
-
{height:
|
|
252
|
+
{height: 90, fs: 60}, // 90p
|
|
253
|
+
{height: 98, fs: 60},
|
|
254
|
+
{height: 99, fs: 240}, // 180p
|
|
255
|
+
{height: 180, fs: 240},
|
|
256
|
+
{height: 197, fs: 240},
|
|
257
|
+
{height: 198, fs: 920}, // 360p
|
|
258
|
+
{height: 360, fs: 920},
|
|
259
|
+
{height: 395, fs: 920},
|
|
260
|
+
{height: 396, fs: 3600}, // 720p
|
|
258
261
|
{height: 720, fs: 3600},
|
|
259
|
-
{height: 721, fs: 8192},
|
|
262
|
+
{height: 721, fs: 8192}, // 1080p
|
|
263
|
+
{height: 1080, fs: 8192},
|
|
260
264
|
],
|
|
261
265
|
({height, fs}) => {
|
|
262
266
|
it(`sets the max fs to ${fs} correctly when height is ${height}`, () => {
|