@webex/plugin-meetings 3.7.0-next.13 → 3.7.0-next.15
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/common/errors/{webinar-registration-error.js → join-webinar-error.js} +12 -12
- package/dist/common/errors/join-webinar-error.js.map +1 -0
- package/dist/constants.js +10 -4
- package/dist/constants.js.map +1 -1
- package/dist/index.js +7 -7
- package/dist/index.js.map +1 -1
- package/dist/interpretation/index.js +1 -1
- package/dist/interpretation/siLanguage.js +1 -1
- package/dist/meeting/index.js +18 -13
- package/dist/meeting/index.js.map +1 -1
- package/dist/meeting-info/meeting-info-v2.js +29 -17
- package/dist/meeting-info/meeting-info-v2.js.map +1 -1
- package/dist/meetings/index.js +2 -2
- package/dist/meetings/index.js.map +1 -1
- package/dist/metrics/constants.js +1 -1
- package/dist/metrics/constants.js.map +1 -1
- package/dist/multistream/remoteMedia.js +30 -15
- package/dist/multistream/remoteMedia.js.map +1 -1
- package/dist/types/common/errors/{webinar-registration-error.d.ts → join-webinar-error.d.ts} +2 -2
- package/dist/types/constants.d.ts +5 -1
- package/dist/types/index.d.ts +2 -2
- package/dist/types/meeting-info/meeting-info-v2.d.ts +4 -4
- package/dist/types/metrics/constants.d.ts +1 -1
- package/dist/webinar/index.js +1 -1
- package/package.json +3 -3
- package/src/common/errors/join-webinar-error.ts +24 -0
- package/src/constants.ts +7 -3
- package/src/index.ts +2 -2
- package/src/meeting/index.ts +11 -4
- package/src/meeting-info/meeting-info-v2.ts +23 -11
- package/src/meetings/index.ts +2 -2
- package/src/metrics/constants.ts +1 -1
- package/src/multistream/remoteMedia.ts +28 -15
- package/test/unit/spec/meeting/index.js +51 -6
- package/test/unit/spec/meeting-info/meetinginfov2.js +9 -4
- package/test/unit/spec/multistream/remoteMedia.ts +11 -7
- package/dist/common/errors/webinar-registration-error.js.map +0 -1
- package/src/common/errors/webinar-registration-error.ts +0 -27
|
@@ -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 {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SAAAA,IAAA,EAAoB;MAAA,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,O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AkBC,QAAQ;IACnC;;IAEA;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/types/common/errors/{webinar-registration-error.d.ts → join-webinar-error.d.ts}
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Error occurred while the webinar
|
|
2
|
+
* Error occurred while join the webinar
|
|
3
3
|
*/
|
|
4
|
-
export default class
|
|
4
|
+
export default class JoinWebinarError extends Error {
|
|
5
5
|
code: number;
|
|
6
6
|
error: any;
|
|
7
7
|
sdkMessage: string;
|
|
@@ -136,6 +136,8 @@ export declare const ICE_FAIL_TIMEOUT = 3000;
|
|
|
136
136
|
export declare const RETRY_TIMEOUT = 3000;
|
|
137
137
|
export declare const ICE_AND_DTLS_CONNECTION_TIMEOUT = 20000;
|
|
138
138
|
export declare const ROAP_OFFER_ANSWER_EXCHANGE_TIMEOUT = 35000;
|
|
139
|
+
export declare const WEBINAR_ERROR_WEBCAST: number[];
|
|
140
|
+
export declare const WEBINAR_ERROR_REGISTRATIONID: number[];
|
|
139
141
|
export declare const DIALER_REGEX: {
|
|
140
142
|
SIP_ADDRESS: RegExp;
|
|
141
143
|
PHONE_NUMBER: RegExp;
|
|
@@ -416,7 +418,7 @@ export declare const ERROR_DICTIONARY: {
|
|
|
416
418
|
MESSAGE: string;
|
|
417
419
|
CODE: number;
|
|
418
420
|
};
|
|
419
|
-
|
|
421
|
+
JoinWebinarError: {
|
|
420
422
|
NAME: string;
|
|
421
423
|
MESSAGE: string;
|
|
422
424
|
CODE: number;
|
|
@@ -1097,6 +1099,8 @@ export declare const MEETING_INFO_FAILURE_REASON: {
|
|
|
1097
1099
|
WRONG_CAPTCHA: string;
|
|
1098
1100
|
POLICY: string;
|
|
1099
1101
|
WEBINAR_REGISTRATION: string;
|
|
1102
|
+
NEED_JOIN_WITH_WEBCAST: string;
|
|
1103
|
+
WEBINAR_NEED_REGISTRATIONID: string;
|
|
1100
1104
|
OTHER: string;
|
|
1101
1105
|
};
|
|
1102
1106
|
export declare const BNR_STATUS: {
|
package/dist/types/index.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import CaptchaError from './common/errors/captcha-error';
|
|
|
3
3
|
import IntentToJoinError from './common/errors/intent-to-join';
|
|
4
4
|
import PasswordError from './common/errors/password-error';
|
|
5
5
|
import PermissionError from './common/errors/permission';
|
|
6
|
-
import
|
|
6
|
+
import JoinWebinarError from './common/errors/join-webinar-error';
|
|
7
7
|
import { ReclaimHostEmptyWrongKeyError, ReclaimHostIsHostAlreadyError, ReclaimHostNotAllowedError, ReclaimHostNotSupportedError } from './common/errors/reclaim-host-role-errors';
|
|
8
8
|
import Meeting from './meeting';
|
|
9
9
|
import MeetingInfoUtil from './meeting-info/utilv2';
|
|
@@ -15,6 +15,6 @@ export * as REACTIONS from './reactions/reactions';
|
|
|
15
15
|
export * as sdkAnnotationTypes from './annotation/annotation.types';
|
|
16
16
|
export * as MeetingInfoV2 from './meeting-info/meeting-info-v2';
|
|
17
17
|
export { type Reaction } from './reactions/reactions.type';
|
|
18
|
-
export { CaptchaError, IntentToJoinError, JoinMeetingError, PasswordError, PermissionError, ReclaimHostIsHostAlreadyError, ReclaimHostNotAllowedError, ReclaimHostNotSupportedError, ReclaimHostEmptyWrongKeyError, Meeting, MeetingInfoUtil,
|
|
18
|
+
export { CaptchaError, IntentToJoinError, JoinMeetingError, PasswordError, PermissionError, ReclaimHostIsHostAlreadyError, ReclaimHostNotAllowedError, ReclaimHostNotSupportedError, ReclaimHostEmptyWrongKeyError, Meeting, MeetingInfoUtil, JoinWebinarError, };
|
|
19
19
|
export { RemoteMedia } from './multistream/remoteMedia';
|
|
20
20
|
export { default as TriggerProxy } from './common/events/trigger-proxy';
|
|
@@ -65,9 +65,9 @@ export declare class MeetingInfoV2CaptchaError extends Error {
|
|
|
65
65
|
constructor(wbxAppApiErrorCode?: number, captchaInfo?: object, message?: string);
|
|
66
66
|
}
|
|
67
67
|
/**
|
|
68
|
-
* Error preventing join because of a webinar
|
|
68
|
+
* Error preventing join because of a webinar have some error
|
|
69
69
|
*/
|
|
70
|
-
export declare class
|
|
70
|
+
export declare class MeetingInfoV2JoinWebinarError extends Error {
|
|
71
71
|
meetingInfo: any;
|
|
72
72
|
sdkMessage: any;
|
|
73
73
|
wbxAppApiCode: any;
|
|
@@ -107,11 +107,11 @@ export default class MeetingInfoV2 {
|
|
|
107
107
|
*/
|
|
108
108
|
handlePolicyError: (err: any) => void;
|
|
109
109
|
/**
|
|
110
|
-
* Raises a
|
|
110
|
+
* Raises a handleJoinWebinarError for join webinar error codes
|
|
111
111
|
* @param {any} err the error from the request
|
|
112
112
|
* @returns {void}
|
|
113
113
|
*/
|
|
114
|
-
|
|
114
|
+
handleJoinWebinarError: (err: any) => void;
|
|
115
115
|
/**
|
|
116
116
|
* Creates adhoc space meetings for a space by fetching the conversation infomation
|
|
117
117
|
* @param {String} conversationUrl conversationUrl to start adhoc meeting on
|
|
@@ -67,7 +67,7 @@ declare const BEHAVIORAL_METRICS: {
|
|
|
67
67
|
ROAP_HTTP_RESPONSE_MISSING: string;
|
|
68
68
|
TURN_DISCOVERY_REQUIRES_OK: string;
|
|
69
69
|
REACHABILITY_COMPLETED: string;
|
|
70
|
-
|
|
70
|
+
JOIN_WEBINAR_ERROR: string;
|
|
71
71
|
GUEST_ENTERED_LOBBY: string;
|
|
72
72
|
GUEST_EXITED_LOBBY: string;
|
|
73
73
|
};
|
package/dist/webinar/index.js
CHANGED
package/package.json
CHANGED
|
@@ -43,7 +43,7 @@
|
|
|
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.
|
|
46
|
+
"@webex/plugin-meetings": "3.7.0-next.15",
|
|
47
47
|
"@webex/plugin-rooms": "3.7.0-next.4",
|
|
48
48
|
"@webex/test-helper-chai": "3.7.0-next.2",
|
|
49
49
|
"@webex/test-helper-mocha": "3.7.0-next.2",
|
|
@@ -70,7 +70,7 @@
|
|
|
70
70
|
"@webex/internal-plugin-metrics": "3.7.0-next.2",
|
|
71
71
|
"@webex/internal-plugin-support": "3.7.0-next.5",
|
|
72
72
|
"@webex/internal-plugin-user": "3.7.0-next.2",
|
|
73
|
-
"@webex/internal-plugin-voicea": "3.7.0-next.
|
|
73
|
+
"@webex/internal-plugin-voicea": "3.7.0-next.15",
|
|
74
74
|
"@webex/media-helpers": "3.7.0-next.2",
|
|
75
75
|
"@webex/plugin-people": "3.7.0-next.2",
|
|
76
76
|
"@webex/plugin-rooms": "3.7.0-next.4",
|
|
@@ -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.15"
|
|
95
95
|
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import {ERROR_DICTIONARY} from '../../constants';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Error occurred while join the webinar
|
|
5
|
+
*/
|
|
6
|
+
export default class JoinWebinarError extends Error {
|
|
7
|
+
code: number;
|
|
8
|
+
error: any;
|
|
9
|
+
sdkMessage: string;
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* @constructor
|
|
13
|
+
* @param {String} [message]
|
|
14
|
+
* @param {Object} [error]
|
|
15
|
+
*/
|
|
16
|
+
constructor(message: string = ERROR_DICTIONARY.JoinWebinarError.MESSAGE, error: any = null) {
|
|
17
|
+
super(message);
|
|
18
|
+
this.name = ERROR_DICTIONARY.JoinWebinarError.NAME;
|
|
19
|
+
this.sdkMessage = ERROR_DICTIONARY.JoinWebinarError.MESSAGE;
|
|
20
|
+
this.error = error;
|
|
21
|
+
this.stack = error ? error.stack : new Error().stack;
|
|
22
|
+
this.code = ERROR_DICTIONARY.JoinWebinarError.CODE;
|
|
23
|
+
}
|
|
24
|
+
}
|
package/src/constants.ts
CHANGED
|
@@ -198,6 +198,8 @@ export const RETRY_TIMEOUT = 3000;
|
|
|
198
198
|
|
|
199
199
|
export const ICE_AND_DTLS_CONNECTION_TIMEOUT = 20000;
|
|
200
200
|
export const ROAP_OFFER_ANSWER_EXCHANGE_TIMEOUT = 35000;
|
|
201
|
+
export const WEBINAR_ERROR_WEBCAST = [403026];
|
|
202
|
+
export const WEBINAR_ERROR_REGISTRATIONID = [403037, 403137];
|
|
201
203
|
|
|
202
204
|
// ******************** REGEX **********************
|
|
203
205
|
// Please alphabetize
|
|
@@ -536,9 +538,9 @@ export const ERROR_DICTIONARY = {
|
|
|
536
538
|
'Reconnection was not started, because there is one already in progress or reconnections are disabled in config.',
|
|
537
539
|
CODE: 15,
|
|
538
540
|
},
|
|
539
|
-
|
|
540
|
-
NAME: '
|
|
541
|
-
MESSAGE: 'An error occurred while the webinar
|
|
541
|
+
JoinWebinarError: {
|
|
542
|
+
NAME: 'JoinWebinarError',
|
|
543
|
+
MESSAGE: 'An error occurred while the join webinar.',
|
|
542
544
|
CODE: 16,
|
|
543
545
|
},
|
|
544
546
|
};
|
|
@@ -1317,6 +1319,8 @@ export const MEETING_INFO_FAILURE_REASON = {
|
|
|
1317
1319
|
WRONG_CAPTCHA: 'WRONG_CAPTCHA', // wbxappapi requires a captcha code or a wrong captcha code was provided
|
|
1318
1320
|
POLICY: 'POLICY', // meeting info request violates some meeting policy
|
|
1319
1321
|
WEBINAR_REGISTRATION: 'WEBINAR_REGISTRATION', // webinar need registration
|
|
1322
|
+
NEED_JOIN_WITH_WEBCAST: 'NEED_JOIN_WITH_WEBCAST', // webinar need using webcast join
|
|
1323
|
+
WEBINAR_NEED_REGISTRATIONID: 'WEBINAR_NEED_REGISTRATIONID', // webinar need registrationID
|
|
1320
1324
|
OTHER: 'OTHER', // any other error (network, etc)
|
|
1321
1325
|
};
|
|
1322
1326
|
|
package/src/index.ts
CHANGED
|
@@ -8,7 +8,7 @@ import CaptchaError from './common/errors/captcha-error';
|
|
|
8
8
|
import IntentToJoinError from './common/errors/intent-to-join';
|
|
9
9
|
import PasswordError from './common/errors/password-error';
|
|
10
10
|
import PermissionError from './common/errors/permission';
|
|
11
|
-
import
|
|
11
|
+
import JoinWebinarError from './common/errors/join-webinar-error';
|
|
12
12
|
import {
|
|
13
13
|
ReclaimHostEmptyWrongKeyError,
|
|
14
14
|
ReclaimHostIsHostAlreadyError,
|
|
@@ -69,7 +69,7 @@ export {
|
|
|
69
69
|
ReclaimHostEmptyWrongKeyError,
|
|
70
70
|
Meeting,
|
|
71
71
|
MeetingInfoUtil,
|
|
72
|
-
|
|
72
|
+
JoinWebinarError,
|
|
73
73
|
};
|
|
74
74
|
|
|
75
75
|
export {RemoteMedia} from './multistream/remoteMedia';
|
package/src/meeting/index.ts
CHANGED
|
@@ -122,6 +122,8 @@ import {
|
|
|
122
122
|
MEETING_PERMISSION_TOKEN_REFRESH_REASON,
|
|
123
123
|
ROAP_OFFER_ANSWER_EXCHANGE_TIMEOUT,
|
|
124
124
|
NAMED_MEDIA_GROUP_TYPE_AUDIO,
|
|
125
|
+
WEBINAR_ERROR_WEBCAST,
|
|
126
|
+
WEBINAR_ERROR_REGISTRATIONID,
|
|
125
127
|
} from '../constants';
|
|
126
128
|
import BEHAVIORAL_METRICS from '../metrics/constants';
|
|
127
129
|
import ParameterError from '../common/errors/parameter';
|
|
@@ -129,7 +131,7 @@ import {
|
|
|
129
131
|
MeetingInfoV2PasswordError,
|
|
130
132
|
MeetingInfoV2CaptchaError,
|
|
131
133
|
MeetingInfoV2PolicyError,
|
|
132
|
-
|
|
134
|
+
MeetingInfoV2JoinWebinarError,
|
|
133
135
|
} from '../meeting-info/meeting-info-v2';
|
|
134
136
|
import {CSI, ReceiveSlotManager} from '../multistream/receiveSlotManager';
|
|
135
137
|
import SendSlotManager from '../multistream/sendSlotManager';
|
|
@@ -158,7 +160,7 @@ import ControlsOptionsManager from '../controls-options-manager';
|
|
|
158
160
|
import PermissionError from '../common/errors/permission';
|
|
159
161
|
import {LocusMediaRequest} from './locusMediaRequest';
|
|
160
162
|
import {ConnectionStateHandler, ConnectionStateEvent} from './connectionStateHandler';
|
|
161
|
-
import
|
|
163
|
+
import JoinWebinarError from '../common/errors/join-webinar-error';
|
|
162
164
|
|
|
163
165
|
// default callback so we don't call an undefined function, but in practice it should never be used
|
|
164
166
|
const DEFAULT_ICE_PHASE_CALLBACK = () => 'JOIN_MEETING_FINAL';
|
|
@@ -1767,15 +1769,20 @@ export default class Meeting extends StatelessWebexPlugin {
|
|
|
1767
1769
|
this.meetingInfo = err.meetingInfo;
|
|
1768
1770
|
}
|
|
1769
1771
|
throw new PermissionError();
|
|
1770
|
-
} else if (err instanceof
|
|
1772
|
+
} else if (err instanceof MeetingInfoV2JoinWebinarError) {
|
|
1771
1773
|
this.meetingInfoFailureReason = MEETING_INFO_FAILURE_REASON.WEBINAR_REGISTRATION;
|
|
1774
|
+
if (WEBINAR_ERROR_WEBCAST.includes(err.wbxAppApiCode)) {
|
|
1775
|
+
this.meetingInfoFailureReason = MEETING_INFO_FAILURE_REASON.NEED_JOIN_WITH_WEBCAST;
|
|
1776
|
+
} else if (WEBINAR_ERROR_REGISTRATIONID.includes(err.wbxAppApiCode)) {
|
|
1777
|
+
this.meetingInfoFailureReason = MEETING_INFO_FAILURE_REASON.WEBINAR_NEED_REGISTRATIONID;
|
|
1778
|
+
}
|
|
1772
1779
|
this.meetingInfoFailureCode = err.wbxAppApiCode;
|
|
1773
1780
|
|
|
1774
1781
|
if (err.meetingInfo) {
|
|
1775
1782
|
this.meetingInfo = err.meetingInfo;
|
|
1776
1783
|
}
|
|
1777
1784
|
|
|
1778
|
-
throw new
|
|
1785
|
+
throw new JoinWebinarError();
|
|
1779
1786
|
} else if (err instanceof MeetingInfoV2PasswordError) {
|
|
1780
1787
|
LoggerProxy.logger.info(
|
|
1781
1788
|
// @ts-ignore
|
|
@@ -18,7 +18,19 @@ const ADHOC_MEETING_DEFAULT_ERROR =
|
|
|
18
18
|
'Failed starting the adhoc meeting, Please contact support team ';
|
|
19
19
|
const CAPTCHA_ERROR_REQUIRES_PASSWORD_CODES = [423005, 423006];
|
|
20
20
|
const POLICY_ERROR_CODES = [403049, 403104, 403103, 403048, 403102, 403101];
|
|
21
|
-
|
|
21
|
+
/**
|
|
22
|
+
* 403021 - Meeting registration is required
|
|
23
|
+
* 403022 - Meeting registration is still pending
|
|
24
|
+
* 403024 - Meeting registration have been rejected
|
|
25
|
+
* 403137 - Registration ID verified failure
|
|
26
|
+
* 423007 - Registration ID input too many time,please input captcha code
|
|
27
|
+
* 403026 - Need to join meeting via webcast
|
|
28
|
+
* 403037 - Meeting join required registration ID
|
|
29
|
+
* 403137 - Registration ID verified failure
|
|
30
|
+
*
|
|
31
|
+
*/
|
|
32
|
+
const JOIN_WEBINAR_ERROR_CODES = [403021, 403022, 403024, 403137, 423007, 403026, 403037, 403137];
|
|
33
|
+
|
|
22
34
|
/**
|
|
23
35
|
* Error to indicate that wbxappapi requires a password
|
|
24
36
|
*/
|
|
@@ -126,9 +138,9 @@ export class MeetingInfoV2CaptchaError extends Error {
|
|
|
126
138
|
}
|
|
127
139
|
|
|
128
140
|
/**
|
|
129
|
-
* Error preventing join because of a webinar
|
|
141
|
+
* Error preventing join because of a webinar have some error
|
|
130
142
|
*/
|
|
131
|
-
export class
|
|
143
|
+
export class MeetingInfoV2JoinWebinarError extends Error {
|
|
132
144
|
meetingInfo: any;
|
|
133
145
|
sdkMessage: any;
|
|
134
146
|
wbxAppApiCode: any;
|
|
@@ -142,7 +154,7 @@ export class MeetingInfoV2WebinarRegistrationError extends Error {
|
|
|
142
154
|
*/
|
|
143
155
|
constructor(wbxAppApiErrorCode?: number, meetingInfo?: object, message?: string) {
|
|
144
156
|
super(`${message}, code=${wbxAppApiErrorCode}`);
|
|
145
|
-
this.name = '
|
|
157
|
+
this.name = 'MeetingInfoV2JoinWebinarError';
|
|
146
158
|
this.sdkMessage = message;
|
|
147
159
|
this.stack = new Error().stack;
|
|
148
160
|
this.wbxAppApiCode = wbxAppApiErrorCode;
|
|
@@ -204,21 +216,21 @@ export default class MeetingInfoV2 {
|
|
|
204
216
|
};
|
|
205
217
|
|
|
206
218
|
/**
|
|
207
|
-
* Raises a
|
|
219
|
+
* Raises a handleJoinWebinarError for join webinar error codes
|
|
208
220
|
* @param {any} err the error from the request
|
|
209
221
|
* @returns {void}
|
|
210
222
|
*/
|
|
211
|
-
|
|
223
|
+
handleJoinWebinarError = (err) => {
|
|
212
224
|
if (!err.body) {
|
|
213
225
|
return;
|
|
214
226
|
}
|
|
215
227
|
|
|
216
|
-
if (
|
|
217
|
-
Metrics.sendBehavioralMetric(BEHAVIORAL_METRICS.
|
|
228
|
+
if (JOIN_WEBINAR_ERROR_CODES.includes(err.body?.code)) {
|
|
229
|
+
Metrics.sendBehavioralMetric(BEHAVIORAL_METRICS.JOIN_WEBINAR_ERROR, {
|
|
218
230
|
code: err.body?.code,
|
|
219
231
|
});
|
|
220
232
|
|
|
221
|
-
throw new
|
|
233
|
+
throw new MeetingInfoV2JoinWebinarError(
|
|
222
234
|
err.body?.code,
|
|
223
235
|
err.body?.data?.meetingInfo,
|
|
224
236
|
err.body?.message
|
|
@@ -286,7 +298,7 @@ export default class MeetingInfoV2 {
|
|
|
286
298
|
})
|
|
287
299
|
.catch((err) => {
|
|
288
300
|
this.handlePolicyError(err);
|
|
289
|
-
this.
|
|
301
|
+
this.handleJoinWebinarError(err);
|
|
290
302
|
|
|
291
303
|
Metrics.sendBehavioralMetric(BEHAVIORAL_METRICS.ADHOC_MEETING_FAILURE, {
|
|
292
304
|
reason: err.message,
|
|
@@ -441,7 +453,7 @@ export default class MeetingInfoV2 {
|
|
|
441
453
|
|
|
442
454
|
if (err?.statusCode === 403) {
|
|
443
455
|
this.handlePolicyError(err);
|
|
444
|
-
this.
|
|
456
|
+
this.handleJoinWebinarError(err);
|
|
445
457
|
|
|
446
458
|
Metrics.sendBehavioralMetric(BEHAVIORAL_METRICS.VERIFY_PASSWORD_ERROR, {
|
|
447
459
|
reason: err.message,
|
package/src/meetings/index.ts
CHANGED
|
@@ -56,7 +56,7 @@ import MeetingCollection from './collection';
|
|
|
56
56
|
import {MEETING_KEY, INoiseReductionEffect, IVirtualBackgroundEffect} from './meetings.types';
|
|
57
57
|
import MeetingsUtil from './util';
|
|
58
58
|
import PermissionError from '../common/errors/permission';
|
|
59
|
-
import
|
|
59
|
+
import JoinWebinarError from '../common/errors/join-webinar-error';
|
|
60
60
|
import {SpaceIDDeprecatedError} from '../common/errors/webex-errors';
|
|
61
61
|
import NoMeetingInfoError from '../common/errors/no-meeting-info';
|
|
62
62
|
|
|
@@ -1412,7 +1412,7 @@ export default class Meetings extends WebexPlugin {
|
|
|
1412
1412
|
!(err instanceof CaptchaError) &&
|
|
1413
1413
|
!(err instanceof PasswordError) &&
|
|
1414
1414
|
!(err instanceof PermissionError) &&
|
|
1415
|
-
!(err instanceof
|
|
1415
|
+
!(err instanceof JoinWebinarError)
|
|
1416
1416
|
) {
|
|
1417
1417
|
LoggerProxy.logger.info(
|
|
1418
1418
|
`Meetings:index#createMeeting --> Info Unable to fetch meeting info for ${destination}.`
|
package/src/metrics/constants.ts
CHANGED
|
@@ -70,7 +70,7 @@ const BEHAVIORAL_METRICS = {
|
|
|
70
70
|
ROAP_HTTP_RESPONSE_MISSING: 'js_sdk_roap_http_response_missing',
|
|
71
71
|
TURN_DISCOVERY_REQUIRES_OK: 'js_sdk_turn_discovery_requires_ok',
|
|
72
72
|
REACHABILITY_COMPLETED: 'js_sdk_reachability_completed',
|
|
73
|
-
|
|
73
|
+
JOIN_WEBINAR_ERROR: 'js_sdk_join_webinar_error',
|
|
74
74
|
GUEST_ENTERED_LOBBY: 'js_sdk_guest_entered_lobby',
|
|
75
75
|
GUEST_EXITED_LOBBY: 'js_sdk_guest_exited_lobby',
|
|
76
76
|
};
|
|
@@ -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);
|