@webex/plugin-meetings 2.35.3 → 2.36.0
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/common/browser-detection.js.map +1 -1
- package/dist/common/collection.js.map +1 -1
- package/dist/common/config.js.map +1 -1
- package/dist/common/errors/captcha-error.js +7 -0
- package/dist/common/errors/captcha-error.js.map +1 -1
- package/dist/common/errors/intent-to-join.js +8 -0
- package/dist/common/errors/intent-to-join.js.map +1 -1
- package/dist/common/errors/join-meeting.js +8 -0
- package/dist/common/errors/join-meeting.js.map +1 -1
- package/dist/common/errors/media.js +7 -0
- package/dist/common/errors/media.js.map +1 -1
- package/dist/common/errors/parameter.js.map +1 -1
- package/dist/common/errors/password-error.js +7 -0
- package/dist/common/errors/password-error.js.map +1 -1
- package/dist/common/errors/permission.js +7 -0
- package/dist/common/errors/permission.js.map +1 -1
- package/dist/common/errors/reconnection-in-progress.js.map +1 -1
- package/dist/common/errors/reconnection.js +7 -0
- package/dist/common/errors/reconnection.js.map +1 -1
- package/dist/common/errors/stats.js +7 -0
- package/dist/common/errors/stats.js.map +1 -1
- package/dist/common/errors/webex-errors.js.map +1 -1
- package/dist/common/errors/webex-meetings-error.js +5 -2
- package/dist/common/errors/webex-meetings-error.js.map +1 -1
- package/dist/common/events/events-scope.js.map +1 -1
- package/dist/common/events/events.js.map +1 -1
- package/dist/common/events/trigger-proxy.js.map +1 -1
- package/dist/common/events/util.js.map +1 -1
- package/dist/common/logs/logger-config.js.map +1 -1
- package/dist/common/logs/logger-proxy.js.map +1 -1
- package/dist/common/logs/request.js +3 -0
- package/dist/common/logs/request.js.map +1 -1
- package/dist/common/queue.js.map +1 -1
- package/dist/config.js.map +1 -1
- package/dist/constants.js.map +1 -1
- package/dist/locus-info/controlsUtils.js.map +1 -1
- package/dist/locus-info/embeddedAppsUtils.js.map +1 -1
- package/dist/locus-info/fullState.js.map +1 -1
- package/dist/locus-info/hostUtils.js.map +1 -1
- package/dist/locus-info/index.js +43 -5
- package/dist/locus-info/index.js.map +1 -1
- package/dist/locus-info/infoUtils.js.map +1 -1
- package/dist/locus-info/mediaSharesUtils.js.map +1 -1
- package/dist/locus-info/parser.js +12 -3
- package/dist/locus-info/parser.js.map +1 -1
- package/dist/locus-info/selfUtils.js.map +1 -1
- package/dist/media/index.js.map +1 -1
- package/dist/media/properties.js +12 -0
- package/dist/media/properties.js.map +1 -1
- package/dist/media/util.js.map +1 -1
- package/dist/mediaQualityMetrics/config.js.map +1 -1
- package/dist/meeting/effectsState.js +8 -1
- package/dist/meeting/effectsState.js.map +1 -1
- package/dist/meeting/index.js +206 -46
- package/dist/meeting/index.js.map +1 -1
- package/dist/meeting/muteState.js +6 -0
- package/dist/meeting/muteState.js.map +1 -1
- package/dist/meeting/request.js +82 -24
- package/dist/meeting/request.js.map +1 -1
- package/dist/meeting/state.js.map +1 -1
- package/dist/meeting/util.js.map +1 -1
- package/dist/meeting-info/collection.js +4 -1
- package/dist/meeting-info/collection.js.map +1 -1
- package/dist/meeting-info/index.js +5 -0
- package/dist/meeting-info/index.js.map +1 -1
- package/dist/meeting-info/meeting-info-v2.js +14 -2
- package/dist/meeting-info/meeting-info-v2.js.map +1 -1
- package/dist/meeting-info/request.js +3 -0
- package/dist/meeting-info/request.js.map +1 -1
- package/dist/meeting-info/util.js.map +1 -1
- package/dist/meeting-info/utilv2.js.map +1 -1
- package/dist/meetings/collection.js +4 -1
- package/dist/meetings/collection.js.map +1 -1
- package/dist/meetings/index.js +72 -20
- package/dist/meetings/index.js.map +1 -1
- package/dist/meetings/request.js +4 -0
- package/dist/meetings/request.js.map +1 -1
- package/dist/meetings/util.js.map +1 -1
- package/dist/member/index.js +30 -7
- package/dist/member/index.js.map +1 -1
- package/dist/member/util.js +2 -1
- package/dist/member/util.js.map +1 -1
- package/dist/members/collection.js +1 -0
- package/dist/members/collection.js.map +1 -1
- package/dist/members/index.js +12 -1
- package/dist/members/index.js.map +1 -1
- package/dist/members/request.js +19 -9
- package/dist/members/request.js.map +1 -1
- package/dist/members/util.js.map +1 -1
- package/dist/metrics/config.js.map +1 -1
- package/dist/metrics/constants.js.map +1 -1
- package/dist/metrics/index.js +8 -0
- package/dist/metrics/index.js.map +1 -1
- package/dist/networkQualityMonitor/index.js +10 -2
- package/dist/networkQualityMonitor/index.js.map +1 -1
- package/dist/peer-connection-manager/index.js +11 -4
- package/dist/peer-connection-manager/index.js.map +1 -1
- package/dist/personal-meeting-room/index.js +11 -0
- package/dist/personal-meeting-room/index.js.map +1 -1
- package/dist/personal-meeting-room/request.js +2 -1
- package/dist/personal-meeting-room/request.js.map +1 -1
- package/dist/personal-meeting-room/util.js.map +1 -1
- package/dist/reachability/index.js +17 -7
- package/dist/reachability/index.js.map +1 -1
- package/dist/reachability/request.js +1 -0
- package/dist/reachability/request.js.map +1 -1
- package/dist/reactions/reactions.js +111 -0
- package/dist/reactions/reactions.js.map +1 -0
- package/dist/reactions/reactions.type.js +40 -0
- package/dist/reactions/reactions.type.js.map +1 -0
- package/dist/reconnection-manager/index.js +21 -2
- package/dist/reconnection-manager/index.js.map +1 -1
- package/dist/roap/collection.js +1 -0
- package/dist/roap/collection.js.map +1 -1
- package/dist/roap/handler.js +14 -2
- package/dist/roap/handler.js.map +1 -1
- package/dist/roap/index.js +11 -1
- package/dist/roap/index.js.map +1 -1
- package/dist/roap/request.js +7 -2
- package/dist/roap/request.js.map +1 -1
- package/dist/roap/state.js.map +1 -1
- package/dist/roap/turnDiscovery.js +9 -1
- package/dist/roap/turnDiscovery.js.map +1 -1
- package/dist/roap/util.js.map +1 -1
- package/dist/statsAnalyzer/global.js.map +1 -1
- package/dist/statsAnalyzer/index.js +19 -1
- package/dist/statsAnalyzer/index.js.map +1 -1
- package/dist/statsAnalyzer/mqaUtil.js +9 -3
- package/dist/statsAnalyzer/mqaUtil.js.map +1 -1
- package/dist/transcription/index.js +10 -3
- package/dist/transcription/index.js.map +1 -1
- package/package.json +17 -17
- package/src/common/{browser-detection.js → browser-detection.ts} +1 -1
- package/src/common/collection.ts +6 -6
- package/src/common/{config.js → config.ts} +1 -1
- package/src/common/errors/{captcha-error.js → captcha-error.ts} +5 -1
- package/src/common/errors/{intent-to-join.js → intent-to-join.ts} +6 -1
- package/src/common/errors/{join-meeting.js → join-meeting.ts} +6 -1
- package/src/common/errors/{media.js → media.ts} +5 -1
- package/src/common/errors/parameter.ts +3 -2
- package/src/common/errors/{password-error.js → password-error.ts} +5 -1
- package/src/common/errors/{permission.js → permission.ts} +5 -1
- package/src/common/errors/{reconnection-in-progress.js → reconnection-in-progress.ts} +0 -0
- package/src/common/errors/{reconnection.js → reconnection.ts} +5 -1
- package/src/common/errors/{stats.js → stats.ts} +5 -1
- package/src/common/errors/{webex-errors.js → webex-errors.ts} +1 -2
- package/src/common/errors/{webex-meetings-error.js → webex-meetings-error.ts} +3 -1
- package/src/common/events/{events-scope.js → events-scope.ts} +1 -1
- package/src/common/events/{events.js → events.ts} +0 -0
- package/src/common/events/{trigger-proxy.js → trigger-proxy.ts} +1 -2
- package/src/common/events/{util.js → util.ts} +1 -1
- package/src/common/logs/{logger-config.js → logger-config.ts} +1 -2
- package/src/common/logs/{logger-proxy.js → logger-proxy.ts} +1 -1
- package/src/common/logs/{request.js → request.ts} +12 -2
- package/src/common/queue.ts +1 -2
- package/src/{config.js → config.ts} +1 -0
- package/src/constants.ts +1 -0
- package/src/locus-info/{controlsUtils.js → controlsUtils.ts} +4 -4
- package/src/locus-info/{embeddedAppsUtils.js → embeddedAppsUtils.ts} +5 -6
- package/src/locus-info/{fullState.js → fullState.ts} +1 -1
- package/src/locus-info/{hostUtils.js → hostUtils.ts} +5 -5
- package/src/locus-info/{index.js → index.ts} +67 -32
- package/src/locus-info/{infoUtils.js → infoUtils.ts} +3 -4
- package/src/locus-info/{mediaSharesUtils.js → mediaSharesUtils.ts} +13 -13
- package/src/locus-info/{parser.js → parser.ts} +22 -12
- package/src/locus-info/{selfUtils.js → selfUtils.ts} +17 -19
- package/src/media/{index.js → index.ts} +108 -39
- package/src/media/{properties.js → properties.ts} +16 -4
- package/src/media/{util.js → util.ts} +2 -3
- package/src/mediaQualityMetrics/{config.js → config.ts} +1 -1
- package/src/meeting/{effectsState.js → effectsState.ts} +12 -6
- package/src/meeting/{index.js → index.ts} +365 -157
- package/src/meeting/{muteState.js → muteState.ts} +16 -11
- package/src/meeting/{request.js → request.ts} +147 -36
- package/src/meeting/{state.js → state.ts} +6 -6
- package/src/meeting/{util.js → util.ts} +4 -4
- package/src/meeting-info/{collection.js → collection.ts} +4 -1
- package/src/meeting-info/{index.js → index.ts} +10 -6
- package/src/meeting-info/{meeting-info-v2.js → meeting-info-v2.ts} +28 -10
- package/src/meeting-info/{request.js → request.ts} +6 -2
- package/src/meeting-info/{util.js → util.ts} +6 -5
- package/src/meeting-info/{utilv2.js → utilv2.ts} +8 -7
- package/src/meetings/{collection.js → collection.ts} +5 -2
- package/src/meetings/{index.js → index.ts} +88 -22
- package/src/meetings/{request.js → request.ts} +6 -1
- package/src/meetings/{util.js → util.ts} +5 -3
- package/src/member/{index.js → index.ts} +46 -15
- package/src/member/{util.js → util.ts} +17 -16
- package/src/members/{collection.js → collection.ts} +2 -1
- package/src/members/{index.js → index.ts} +39 -26
- package/src/members/{request.js → request.ts} +16 -5
- package/src/members/{util.js → util.ts} +7 -7
- package/src/metrics/{config.js → config.ts} +0 -2
- package/src/metrics/{constants.js → constants.ts} +0 -0
- package/src/metrics/{index.js → index.ts} +27 -8
- package/src/networkQualityMonitor/{index.js → index.ts} +18 -3
- package/src/peer-connection-manager/{index.js → index.ts} +72 -28
- package/src/personal-meeting-room/{index.js → index.ts} +17 -4
- package/src/personal-meeting-room/{request.js → request.ts} +3 -1
- package/src/personal-meeting-room/{util.js → util.ts} +1 -1
- package/src/reachability/{index.js → index.ts} +28 -17
- package/src/reachability/request.ts +4 -2
- package/src/reactions/reactions.ts +104 -0
- package/src/reactions/reactions.type.ts +36 -0
- package/src/reconnection-manager/{index.js → index.ts} +42 -13
- package/src/roap/{collection.js → collection.ts} +1 -0
- package/src/roap/{handler.js → handler.ts} +15 -4
- package/src/roap/{index.js → index.ts} +23 -10
- package/src/roap/{request.js → request.ts} +19 -3
- package/src/roap/{state.js → state.ts} +3 -2
- package/src/roap/turnDiscovery.ts +14 -5
- package/src/roap/{util.js → util.ts} +1 -2
- package/src/statsAnalyzer/{global.js → global.ts} +0 -0
- package/src/statsAnalyzer/{index.js → index.ts} +36 -17
- package/src/statsAnalyzer/{mqaUtil.js → mqaUtil.ts} +6 -1
- package/src/transcription/{index.js → index.ts} +16 -11
- package/test/integration/spec/space-meeting.js +1 -2
- package/test/unit/spec/meeting/index.js +113 -14
- package/test/unit/spec/meeting/request.js +25 -1
- package/test/unit/spec/roap/util.js +1 -1
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
|
|
2
1
|
import {
|
|
3
2
|
_IDLE_,
|
|
4
3
|
_JOINED_,
|
|
@@ -15,7 +14,7 @@ import {
|
|
|
15
14
|
} from '../constants';
|
|
16
15
|
import ParameterError from '../common/errors/parameter';
|
|
17
16
|
|
|
18
|
-
const SelfUtils = {};
|
|
17
|
+
const SelfUtils: any = {};
|
|
19
18
|
const PSTN_DEVICE_TYPE = 'PROVISIONAL';
|
|
20
19
|
|
|
21
20
|
/**
|
|
@@ -24,7 +23,7 @@ const PSTN_DEVICE_TYPE = 'PROVISIONAL';
|
|
|
24
23
|
* @param {String} deviceId
|
|
25
24
|
* @returns {undefined}
|
|
26
25
|
*/
|
|
27
|
-
SelfUtils.parse = (self, deviceId) => {
|
|
26
|
+
SelfUtils.parse = (self: any, deviceId: string) => {
|
|
28
27
|
if (self) {
|
|
29
28
|
const joinedWith = self.devices.find((device) => deviceId === device.url);
|
|
30
29
|
const pstnDevices = self.devices.filter((device) => PSTN_DEVICE_TYPE === device.deviceType);
|
|
@@ -84,7 +83,7 @@ SelfUtils.isSharingBlocked = (self) => !!self?.isSharingBlocked;
|
|
|
84
83
|
SelfUtils.getSelves = (oldSelf, newSelf, deviceId) => {
|
|
85
84
|
const previous = oldSelf && SelfUtils.parse(oldSelf, deviceId);
|
|
86
85
|
const current = newSelf && SelfUtils.parse(newSelf, deviceId);
|
|
87
|
-
const updates = {};
|
|
86
|
+
const updates: any = {};
|
|
88
87
|
|
|
89
88
|
updates.isUserUnadmitted = SelfUtils.isUserUnadmitted(current);
|
|
90
89
|
updates.isUserAdmitted = SelfUtils.isUserAdmitted(previous, current);
|
|
@@ -116,7 +115,7 @@ SelfUtils.getSelves = (oldSelf, newSelf, deviceId) => {
|
|
|
116
115
|
* @param {Object} self
|
|
117
116
|
* @returns {boolean} isJoined
|
|
118
117
|
*/
|
|
119
|
-
SelfUtils.isJoined = (self) => self?.state === _JOINED_;
|
|
118
|
+
SelfUtils.isJoined = (self: any) => self?.state === _JOINED_;
|
|
120
119
|
|
|
121
120
|
/**
|
|
122
121
|
* Validate if the Meeting Layout Controls Layout has changed.
|
|
@@ -125,8 +124,7 @@ SelfUtils.isJoined = (self) => self?.state === _JOINED_;
|
|
|
125
124
|
* @param {Self} current - Current self state [per event]
|
|
126
125
|
* @returns {boolean} - If the MEeting Layout Controls Layout has changed.
|
|
127
126
|
*/
|
|
128
|
-
SelfUtils.layoutChanged = (previous, current) => current?.layout && previous?.layout !== current?.layout;
|
|
129
|
-
|
|
127
|
+
SelfUtils.layoutChanged = (previous: any, current: any) => current?.layout && previous?.layout !== current?.layout;
|
|
130
128
|
|
|
131
129
|
SelfUtils.isMediaInactive = (previous, current) => {
|
|
132
130
|
if (
|
|
@@ -198,7 +196,7 @@ SelfUtils.getModifiedBy = (self) => {
|
|
|
198
196
|
* @param {Object} self
|
|
199
197
|
* @returns {String}
|
|
200
198
|
*/
|
|
201
|
-
SelfUtils.getSelfIdentity = (self) => {
|
|
199
|
+
SelfUtils.getSelfIdentity = (self: any) => {
|
|
202
200
|
if (!self && !self.person) {
|
|
203
201
|
return null;
|
|
204
202
|
}
|
|
@@ -211,7 +209,7 @@ SelfUtils.getSelfIdentity = (self) => {
|
|
|
211
209
|
* @param {Object} self
|
|
212
210
|
* @returns {Boolean}
|
|
213
211
|
*/
|
|
214
|
-
SelfUtils.getRemoteMuted = (self) => {
|
|
212
|
+
SelfUtils.getRemoteMuted = (self: any) => {
|
|
215
213
|
if (!self || !self.controls || !self.controls.audio) {
|
|
216
214
|
return null;
|
|
217
215
|
}
|
|
@@ -244,28 +242,28 @@ SelfUtils.getStatus = (status) => ({
|
|
|
244
242
|
* @param {Object} changedSelf
|
|
245
243
|
* @returns {Boolean}
|
|
246
244
|
*/
|
|
247
|
-
SelfUtils.wasMediaInactiveOrReleased = (oldSelf = {}, changedSelf) => oldSelf.joinedWith && oldSelf.joinedWith.state === _JOINED_ && changedSelf.joinedWith.state === _LEFT_ &&
|
|
248
|
-
|
|
245
|
+
SelfUtils.wasMediaInactiveOrReleased = (oldSelf: any = {}, changedSelf: any) => oldSelf.joinedWith && oldSelf.joinedWith.state === _JOINED_ && changedSelf.joinedWith.state === _LEFT_ &&
|
|
246
|
+
(changedSelf.joinedWith.reason === MEETING_END_REASON.INACTIVE || changedSelf.joinedWith.reason === MEETING_END_REASON.MEDIA_RELEASED);
|
|
249
247
|
|
|
250
248
|
|
|
251
249
|
/**
|
|
252
250
|
* @param {Object} check
|
|
253
251
|
* @returns {Boolean}
|
|
254
252
|
*/
|
|
255
|
-
SelfUtils.isLocusUserUnadmitted = (check) => check && check.joinedWith?.intent?.type === _WAIT_ && check.state === _IDLE_;
|
|
253
|
+
SelfUtils.isLocusUserUnadmitted = (check: any) => check && check.joinedWith?.intent?.type === _WAIT_ && check.state === _IDLE_;
|
|
256
254
|
|
|
257
255
|
/**
|
|
258
256
|
* @param {Object} check
|
|
259
257
|
* @returns {Boolean}
|
|
260
258
|
*/
|
|
261
|
-
SelfUtils.isLocusUserAdmitted = (check) => check && check.joinedWith?.intent?.type !== _WAIT_ && check.state === _JOINED_;
|
|
259
|
+
SelfUtils.isLocusUserAdmitted = (check: any) => check && check.joinedWith?.intent?.type !== _WAIT_ && check.state === _JOINED_;
|
|
262
260
|
|
|
263
261
|
/**
|
|
264
262
|
* @param {Object} self
|
|
265
263
|
* @returns {Boolean}
|
|
266
264
|
* @throws {Error} when self is undefined
|
|
267
265
|
*/
|
|
268
|
-
SelfUtils.isUserUnadmitted = (self) => {
|
|
266
|
+
SelfUtils.isUserUnadmitted = (self: object) => {
|
|
269
267
|
if (!self) {
|
|
270
268
|
throw new ParameterError('self must be defined to determine if self is unadmitted as guest.');
|
|
271
269
|
}
|
|
@@ -291,7 +289,7 @@ SelfUtils.moderatorChanged = (oldSelf, changedSelf) => {
|
|
|
291
289
|
* @returns {Boolean}
|
|
292
290
|
* @throws {Error} if changed self was undefined
|
|
293
291
|
*/
|
|
294
|
-
SelfUtils.isDeviceObserving = (oldSelf, changedSelf) => oldSelf && oldSelf.joinedWith?.intent?.type === _MOVE_MEDIA_ && changedSelf && changedSelf.joinedWith?.intent?.type === _OBSERVE_;
|
|
292
|
+
SelfUtils.isDeviceObserving = (oldSelf: any, changedSelf: any) => oldSelf && oldSelf.joinedWith?.intent?.type === _MOVE_MEDIA_ && changedSelf && changedSelf.joinedWith?.intent?.type === _OBSERVE_;
|
|
295
293
|
|
|
296
294
|
/**
|
|
297
295
|
* @param {Object} oldSelf
|
|
@@ -299,7 +297,7 @@ SelfUtils.isDeviceObserving = (oldSelf, changedSelf) => oldSelf && oldSelf.joine
|
|
|
299
297
|
* @returns {Boolean}
|
|
300
298
|
* @throws {Error} if changed self was undefined
|
|
301
299
|
*/
|
|
302
|
-
SelfUtils.isUserAdmitted = (oldSelf, changedSelf) => {
|
|
300
|
+
SelfUtils.isUserAdmitted = (oldSelf: object, changedSelf: object) => {
|
|
303
301
|
if (!oldSelf) {
|
|
304
302
|
// if there was no previous locus, it couldn't have been admitted yet
|
|
305
303
|
return false;
|
|
@@ -329,7 +327,7 @@ SelfUtils.mutedByOthersChanged = (oldSelf, changedSelf) => {
|
|
|
329
327
|
((oldSelf.remoteMuted !== changedSelf.remoteMuted) || (changedSelf.remoteMuted && (oldSelf.unmuteAllowed !== changedSelf.unmuteAllowed)));
|
|
330
328
|
};
|
|
331
329
|
|
|
332
|
-
SelfUtils.localAudioUnmuteRequestedByServer = (oldSelf = {}, changedSelf) => {
|
|
330
|
+
SelfUtils.localAudioUnmuteRequestedByServer = (oldSelf: any = {}, changedSelf: any) => {
|
|
333
331
|
if (!changedSelf) {
|
|
334
332
|
throw new ParameterError('New self must be defined to determine if self received request to unmute.');
|
|
335
333
|
}
|
|
@@ -338,7 +336,7 @@ SelfUtils.localAudioUnmuteRequestedByServer = (oldSelf = {}, changedSelf) => {
|
|
|
338
336
|
};
|
|
339
337
|
|
|
340
338
|
|
|
341
|
-
SelfUtils.localAudioUnmuteRequiredByServer = (oldSelf = {}, changedSelf) => {
|
|
339
|
+
SelfUtils.localAudioUnmuteRequiredByServer = (oldSelf: any = {}, changedSelf: any) => {
|
|
342
340
|
if (!changedSelf) {
|
|
343
341
|
throw new ParameterError('New self must be defined to determine if localAudioUnmuteRequired changed.');
|
|
344
342
|
}
|
|
@@ -353,7 +351,7 @@ SelfUtils.localAudioUnmuteRequiredByServer = (oldSelf = {}, changedSelf) => {
|
|
|
353
351
|
* @returns {Object}
|
|
354
352
|
*/
|
|
355
353
|
|
|
356
|
-
SelfUtils.getSipUrl = (partner, type, sipUri) => {
|
|
354
|
+
SelfUtils.getSipUrl = (partner: any, type, sipUri) => {
|
|
357
355
|
// For webex meeting the sipUrl gets updated in info parser
|
|
358
356
|
if (partner && type === _CALL_) {
|
|
359
357
|
return {sipUri: partner.person.sipUrl || partner.person.id};
|
|
@@ -46,7 +46,7 @@ const {isBrowser} = BrowserDetection();
|
|
|
46
46
|
* Handles the quirks of each browser.
|
|
47
47
|
* Extends and enhances adapter.js, i.e., the "media" file from the web client.
|
|
48
48
|
*/
|
|
49
|
-
const Media = {};
|
|
49
|
+
const Media: any = {};
|
|
50
50
|
|
|
51
51
|
/**
|
|
52
52
|
* @param {boolean} enabled
|
|
@@ -54,7 +54,7 @@ const Media = {};
|
|
|
54
54
|
* @returns {Boolean}
|
|
55
55
|
* @public
|
|
56
56
|
*/
|
|
57
|
-
Media.setLocalTrack = (enabled, track) => {
|
|
57
|
+
Media.setLocalTrack = (enabled: boolean, track: MediaStreamTrack) => {
|
|
58
58
|
if (track) {
|
|
59
59
|
track.enabled = enabled;
|
|
60
60
|
|
|
@@ -71,12 +71,20 @@ Media.setLocalTrack = (enabled, track) => {
|
|
|
71
71
|
* @param {string} meetingProperties.remoteQualityLevel LOW|MEDIUM|HIGH
|
|
72
72
|
* @returns {Promise}
|
|
73
73
|
*/
|
|
74
|
-
Media.reconnectMedia = (
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
74
|
+
Media.reconnectMedia = (
|
|
75
|
+
peerConnection: RTCPeerConnection,
|
|
76
|
+
{
|
|
77
|
+
meetingId,
|
|
78
|
+
remoteQualityLevel,
|
|
79
|
+
enableRtx,
|
|
80
|
+
enableExtmap,
|
|
81
|
+
}: {
|
|
82
|
+
meetingId: string;
|
|
83
|
+
remoteQualityLevel: string;
|
|
84
|
+
enableRtx: any;
|
|
85
|
+
enableExtmap: any
|
|
86
|
+
}
|
|
87
|
+
) => {
|
|
80
88
|
if (peerConnection.connectionState === PEER_CONNECTION_STATE.CLOSED ||
|
|
81
89
|
peerConnection.connectionState === PEER_CONNECTION_STATE.FAILED) {
|
|
82
90
|
return Promise.reject(new ReconnectionError('Reinitiate peerconnection'));
|
|
@@ -97,7 +105,7 @@ Media.reconnectMedia = (peerConnection, {
|
|
|
97
105
|
* @param {Boolean} videoMuted
|
|
98
106
|
* @returns {Array} medias
|
|
99
107
|
*/
|
|
100
|
-
Media.generateLocalMedias = (mediaId, audioMuted, videoMuted) => {
|
|
108
|
+
Media.generateLocalMedias = (mediaId: string, audioMuted: boolean, videoMuted: boolean) => {
|
|
101
109
|
if (mediaId) {
|
|
102
110
|
return [
|
|
103
111
|
{
|
|
@@ -119,7 +127,7 @@ Media.generateLocalMedias = (mediaId, audioMuted, videoMuted) => {
|
|
|
119
127
|
* @param {Object} config SDK Configuration for meetings plugin
|
|
120
128
|
* @returns {Promise}
|
|
121
129
|
*/
|
|
122
|
-
Media.getLocalMedia = (options, config) => {
|
|
130
|
+
Media.getLocalMedia = (options: any, config: object) => {
|
|
123
131
|
const {
|
|
124
132
|
sendAudio, sendVideo, sendShare, sharePreferences, isSharing
|
|
125
133
|
} = options;
|
|
@@ -148,7 +156,7 @@ Media.getLocalMedia = (options, config) => {
|
|
|
148
156
|
* @param {boolean} receiveTracks do you want to receive tracks from the remote side
|
|
149
157
|
* @returns {Object} returns direction tracks to be added in transceiver
|
|
150
158
|
*/
|
|
151
|
-
Media.checkTracks = (trackType, track, receiveTracks) => {
|
|
159
|
+
Media.checkTracks = (trackType: string, track: object, receiveTracks: boolean) => {
|
|
152
160
|
const getDirection = (sendTracks, receiveTracks) => {
|
|
153
161
|
if (sendTracks && receiveTracks) {
|
|
154
162
|
return 'sendrecv';
|
|
@@ -175,12 +183,20 @@ Media.checkTracks = (trackType, track, receiveTracks) => {
|
|
|
175
183
|
* @param {string} meetingProperties.remoteQualityLevel LOW|MEDIUM|HIGH
|
|
176
184
|
* @returns {Array} [peerConnection, ]
|
|
177
185
|
*/
|
|
178
|
-
Media.attachMedia = (
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
186
|
+
Media.attachMedia = (
|
|
187
|
+
mediaProperties: any,
|
|
188
|
+
{
|
|
189
|
+
meetingId,
|
|
190
|
+
remoteQualityLevel,
|
|
191
|
+
enableRtx,
|
|
192
|
+
enableExtmap,
|
|
193
|
+
}: {
|
|
194
|
+
meetingId: string;
|
|
195
|
+
remoteQualityLevel: string;
|
|
196
|
+
enableRtx: any;
|
|
197
|
+
enableExtmap: any;
|
|
198
|
+
}
|
|
199
|
+
) => {
|
|
184
200
|
const {
|
|
185
201
|
mediaDirection,
|
|
186
202
|
audioTrack,
|
|
@@ -223,12 +239,20 @@ Media.attachMedia = (mediaProperties, {
|
|
|
223
239
|
* @param {string} meetingProperties.remoteQualityLevel LOW|MEDIUM|HIGH
|
|
224
240
|
* @returns {Promise}
|
|
225
241
|
*/
|
|
226
|
-
Media.updateMedia = (
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
242
|
+
Media.updateMedia = (
|
|
243
|
+
mediaProperties: any,
|
|
244
|
+
{
|
|
245
|
+
meetingId,
|
|
246
|
+
remoteQualityLevel,
|
|
247
|
+
enableRtx,
|
|
248
|
+
enableExtmap,
|
|
249
|
+
}: {
|
|
250
|
+
meetingId: string;
|
|
251
|
+
remoteQualityLevel: string;
|
|
252
|
+
enableRtx: any;
|
|
253
|
+
enableExtmap: any;
|
|
254
|
+
}
|
|
255
|
+
) => {
|
|
232
256
|
const {
|
|
233
257
|
mediaDirection,
|
|
234
258
|
audioTrack,
|
|
@@ -278,7 +302,15 @@ Media.updateMedia = (mediaProperties, {
|
|
|
278
302
|
* @param {MediaStreamTrack} options.track
|
|
279
303
|
* @returns {undefined}
|
|
280
304
|
*/
|
|
281
|
-
Media.setTrackOnTransceiver = (
|
|
305
|
+
Media.setTrackOnTransceiver = (
|
|
306
|
+
transceiver: RTCRtpTransceiver,
|
|
307
|
+
options: {
|
|
308
|
+
track: MediaStreamTrack;
|
|
309
|
+
type: any;
|
|
310
|
+
sendTrack: any;
|
|
311
|
+
receiveTrack: any;
|
|
312
|
+
}
|
|
313
|
+
) => {
|
|
282
314
|
const {
|
|
283
315
|
type, track, sendTrack, receiveTrack
|
|
284
316
|
} = options;
|
|
@@ -307,12 +339,22 @@ Media.setTrackOnTransceiver = (transceiver, options) => {
|
|
|
307
339
|
* @param {Object} options see #Media.setTrackOnTransceiver
|
|
308
340
|
* @returns {Promise}
|
|
309
341
|
*/
|
|
310
|
-
Media.updateTransceiver = (
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
342
|
+
Media.updateTransceiver = (
|
|
343
|
+
{
|
|
344
|
+
meetingId,
|
|
345
|
+
remoteQualityLevel,
|
|
346
|
+
enableRtx,
|
|
347
|
+
enableExtmap,
|
|
348
|
+
}: {
|
|
349
|
+
meetingId: string;
|
|
350
|
+
remoteQualityLevel: string;
|
|
351
|
+
enableRtx: any;
|
|
352
|
+
enableExtmap: any;
|
|
353
|
+
},
|
|
354
|
+
peerConnection: RTCPeerConnection,
|
|
355
|
+
transceiver: RTCRtpTransceiver,
|
|
356
|
+
options: object
|
|
357
|
+
) => {
|
|
316
358
|
Media.setTrackOnTransceiver(transceiver, options);
|
|
317
359
|
|
|
318
360
|
return PeerConnectionManager.createOffer(peerConnection, {
|
|
@@ -335,7 +377,17 @@ Media.updateTransceiver = ({
|
|
|
335
377
|
* @param {Object} config SDK Configuration for meetings plugin
|
|
336
378
|
* @returns {Promise.<MediaStream>}
|
|
337
379
|
*/
|
|
338
|
-
Media.getDisplayMedia = (
|
|
380
|
+
Media.getDisplayMedia = (
|
|
381
|
+
options: {
|
|
382
|
+
sendAudio: boolean;
|
|
383
|
+
sendShare: boolean;
|
|
384
|
+
sharePreferences: {
|
|
385
|
+
shareConstraints: MediaTrackConstraints;
|
|
386
|
+
highFrameRate: any;
|
|
387
|
+
};
|
|
388
|
+
},
|
|
389
|
+
config: any = {}
|
|
390
|
+
) => {
|
|
339
391
|
// SDK screen share resolution settings from Webex.init
|
|
340
392
|
const customResolution = config.screenResolution || {};
|
|
341
393
|
// user defined screen share frame rate
|
|
@@ -352,7 +404,7 @@ Media.getDisplayMedia = (options, config = {}) => {
|
|
|
352
404
|
aspectRatio
|
|
353
405
|
} = Config.meetings;
|
|
354
406
|
|
|
355
|
-
let shareConstraints = {
|
|
407
|
+
let shareConstraints: any = {
|
|
356
408
|
cursor: MEDIA_TRACK_CONSTRAINT.CURSOR.AWLAYS,
|
|
357
409
|
aspectRatio
|
|
358
410
|
};
|
|
@@ -388,7 +440,7 @@ Media.getDisplayMedia = (options, config = {}) => {
|
|
|
388
440
|
|
|
389
441
|
|
|
390
442
|
if (isBrowser('firefox')) {
|
|
391
|
-
const mediaConfig = {
|
|
443
|
+
const mediaConfig: any = {
|
|
392
444
|
audio: options.sendAudio,
|
|
393
445
|
video: options.sendShare
|
|
394
446
|
};
|
|
@@ -408,7 +460,7 @@ Media.getDisplayMedia = (options, config = {}) => {
|
|
|
408
460
|
});
|
|
409
461
|
}
|
|
410
462
|
|
|
411
|
-
const getDisplayMediaParams = {video: options.sendShare ? shareConstraints : false};
|
|
463
|
+
const getDisplayMediaParams: any = {video: options.sendShare ? shareConstraints : false};
|
|
412
464
|
|
|
413
465
|
// safari doesn't support sending screen share audio
|
|
414
466
|
// https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getDisplayMedia
|
|
@@ -426,7 +478,7 @@ Media.getDisplayMedia = (options, config = {}) => {
|
|
|
426
478
|
* @param {Object} config SDK Configuration for meetings plugin
|
|
427
479
|
* @returns {Object} {streams}
|
|
428
480
|
*/
|
|
429
|
-
Media.getMedia = (audio, video, config) => {
|
|
481
|
+
Media.getMedia = (audio: any | boolean, video: any | boolean, config: any) => {
|
|
430
482
|
const defaultWidth = {ideal: config.resolution.idealWidth, max: config.resolution.maxWidth};
|
|
431
483
|
const defaultHeight = {ideal: config.resolution.idealHeight, max: config.resolution.maxHeight};
|
|
432
484
|
const mediaConfig = {
|
|
@@ -471,7 +523,7 @@ Media.getMedia = (audio, video, config) => {
|
|
|
471
523
|
* sendVideo: true/false
|
|
472
524
|
*}
|
|
473
525
|
*/
|
|
474
|
-
Media.getSupportedDevice = ({sendAudio, sendVideo}) =>
|
|
526
|
+
Media.getSupportedDevice = ({ sendAudio, sendVideo }: { sendAudio: boolean; sendVideo: boolean }) =>
|
|
475
527
|
Promise.resolve().then(() => {
|
|
476
528
|
if (!navigator.mediaDevices || navigator.mediaDevices.enumerateDevices === undefined) {
|
|
477
529
|
return {
|
|
@@ -518,7 +570,7 @@ Media.toggleStream = () => {};
|
|
|
518
570
|
* @param {MediaTrack} track A media stream
|
|
519
571
|
* @returns {null}
|
|
520
572
|
*/
|
|
521
|
-
Media.stopTracks = (track) => {
|
|
573
|
+
Media.stopTracks = (track: any) => {
|
|
522
574
|
if (!track) {
|
|
523
575
|
return Promise.resolve();
|
|
524
576
|
}
|
|
@@ -542,7 +594,7 @@ Media.stopTracks = (track) => {
|
|
|
542
594
|
* @returns {null}
|
|
543
595
|
* @deprecated after v1.89.3
|
|
544
596
|
*/
|
|
545
|
-
Media.stopStream = (stream) => {
|
|
597
|
+
Media.stopStream = (stream: any) => {
|
|
546
598
|
LoggerProxy.logger.warn('Media:index#stopStream --> [DEPRECATION WARNING]: stopStream has been deprecated after v1.89.3');
|
|
547
599
|
if (!stream) {
|
|
548
600
|
return Promise.resolve();
|
|
@@ -581,7 +633,24 @@ Media.stopStream = (stream) => {
|
|
|
581
633
|
* @param {Object} config SDK Config
|
|
582
634
|
* @returns {Array} [localStream, shareStream]
|
|
583
635
|
*/
|
|
584
|
-
Media.getUserMedia = (
|
|
636
|
+
Media.getUserMedia = (
|
|
637
|
+
mediaSetting: {
|
|
638
|
+
sendAudio: object;
|
|
639
|
+
sendVideo: object;
|
|
640
|
+
sendShare: object;
|
|
641
|
+
isSharing: object;
|
|
642
|
+
},
|
|
643
|
+
audioVideo: {
|
|
644
|
+
audio: object;
|
|
645
|
+
video: object;
|
|
646
|
+
},
|
|
647
|
+
sharePreferences: {
|
|
648
|
+
shareConstraints: object;
|
|
649
|
+
highFrameRate: boolean;
|
|
650
|
+
},
|
|
651
|
+
config: object
|
|
652
|
+
) =>
|
|
653
|
+
Media.getLocalMedia({
|
|
585
654
|
sendAudio: mediaSetting.sendAudio ? audioVideo.audio || mediaSetting.sendAudio : false,
|
|
586
655
|
sendVideo: mediaSetting.sendVideo ? audioVideo.video || mediaSetting.sendVideo : false
|
|
587
656
|
}, config).then((localStream) => Media.getLocalMedia({
|
|
@@ -12,13 +12,25 @@ import MediaUtil from './util';
|
|
|
12
12
|
* @class MediaProperties
|
|
13
13
|
*/
|
|
14
14
|
export default class MediaProperties {
|
|
15
|
+
audioTrack: any;
|
|
16
|
+
localQualityLevel: any;
|
|
17
|
+
mediaDirection: any;
|
|
18
|
+
mediaSettings: any;
|
|
19
|
+
peerConnection: any;
|
|
20
|
+
remoteAudioTrack: any;
|
|
21
|
+
remoteQualityLevel: any;
|
|
22
|
+
remoteShare: any;
|
|
23
|
+
remoteVideoTrack: any;
|
|
24
|
+
shareTrack: any;
|
|
25
|
+
videoDeviceId: any;
|
|
26
|
+
videoTrack: any;
|
|
15
27
|
namespace = MEETINGS;
|
|
16
28
|
|
|
17
29
|
/**
|
|
18
30
|
* @param {Object} [options] -- to auto construct
|
|
19
31
|
* @returns {MediaProperties}
|
|
20
32
|
*/
|
|
21
|
-
constructor(options = {}) {
|
|
33
|
+
constructor(options: any = {}) {
|
|
22
34
|
this.peerConnection = MediaUtil.createPeerConnection();
|
|
23
35
|
this.mediaDirection = options.mediaDirection;
|
|
24
36
|
this.videoTrack = options.videoTrack;
|
|
@@ -82,7 +94,7 @@ export default class MediaProperties {
|
|
|
82
94
|
* @param {MediaTrack} remoteAudioTrack MediaTrack to save
|
|
83
95
|
* @returns {void}
|
|
84
96
|
*/
|
|
85
|
-
setRemoteAudioTrack(remoteAudioTrack) {
|
|
97
|
+
setRemoteAudioTrack(remoteAudioTrack: any) {
|
|
86
98
|
this.remoteAudioTrack = remoteAudioTrack;
|
|
87
99
|
}
|
|
88
100
|
|
|
@@ -91,7 +103,7 @@ export default class MediaProperties {
|
|
|
91
103
|
* @param {MediaTrack} remoteVideoTrack MediaTrack to save
|
|
92
104
|
* @returns {void}
|
|
93
105
|
*/
|
|
94
|
-
setRemoteVideoTrack(remoteVideoTrack) {
|
|
106
|
+
setRemoteVideoTrack(remoteVideoTrack: any) {
|
|
95
107
|
this.remoteVideoTrack = remoteVideoTrack;
|
|
96
108
|
}
|
|
97
109
|
|
|
@@ -100,7 +112,7 @@ export default class MediaProperties {
|
|
|
100
112
|
* @param {string} deviceId Preferred video input device
|
|
101
113
|
* @returns {void}
|
|
102
114
|
*/
|
|
103
|
-
setVideoDeviceId(deviceId) {
|
|
115
|
+
setVideoDeviceId(deviceId: string) {
|
|
104
116
|
this.videoDeviceId = deviceId;
|
|
105
117
|
}
|
|
106
118
|
|
|
@@ -6,10 +6,10 @@ import LoggerProxy from '../common/logs/logger-proxy';
|
|
|
6
6
|
|
|
7
7
|
const {isBrowser} = BrowserDetection();
|
|
8
8
|
|
|
9
|
-
const MediaUtil = {};
|
|
9
|
+
const MediaUtil: any = {};
|
|
10
10
|
|
|
11
11
|
MediaUtil.createPeerConnection = (turnServerInfo) => {
|
|
12
|
-
const config = {iceServers: []};
|
|
12
|
+
const config: any = {iceServers: []};
|
|
13
13
|
|
|
14
14
|
if (turnServerInfo) {
|
|
15
15
|
config.iceServers.push({
|
|
@@ -25,7 +25,6 @@ MediaUtil.createPeerConnection = (turnServerInfo) => {
|
|
|
25
25
|
return new window.RTCPeerConnection(config);
|
|
26
26
|
};
|
|
27
27
|
|
|
28
|
-
|
|
29
28
|
MediaUtil.createMediaStream = (tracks) => {
|
|
30
29
|
if (!tracks) {
|
|
31
30
|
LoggerProxy.logger.error('Media:util#createMediaStream --> Tracks don\'t exist');
|
|
@@ -7,7 +7,7 @@ import MediaUtil from '../media/util';
|
|
|
7
7
|
import LoggerProxy from '../common/logs/logger-proxy';
|
|
8
8
|
import {BNR_STATUS} from '../constants';
|
|
9
9
|
|
|
10
|
-
const createEffectsState = (type) => {
|
|
10
|
+
const createEffectsState = (type: any) => {
|
|
11
11
|
LoggerProxy.logger.info(`Meeting:effectState#createEffectsState --> creating effectsState for effect ${type}`);
|
|
12
12
|
|
|
13
13
|
return new EffectsState(type);
|
|
@@ -16,7 +16,12 @@ const createEffectsState = (type) => {
|
|
|
16
16
|
/* The purpose of this class is to manage the effects state(for eg., BNR).
|
|
17
17
|
*/
|
|
18
18
|
class EffectsState {
|
|
19
|
-
|
|
19
|
+
effectType: any;
|
|
20
|
+
pendingPromiseReject: any;
|
|
21
|
+
pendingPromiseResolve: any;
|
|
22
|
+
state: any;
|
|
23
|
+
|
|
24
|
+
constructor(type: any) {
|
|
20
25
|
this.effectType = type;
|
|
21
26
|
this.state = {
|
|
22
27
|
bnr: {
|
|
@@ -35,7 +40,7 @@ class EffectsState {
|
|
|
35
40
|
* @param {Object} [meeting] the meeting object
|
|
36
41
|
* @returns {Promise}
|
|
37
42
|
*/
|
|
38
|
-
async handleClientRequest(isEnable, meeting) {
|
|
43
|
+
async handleClientRequest(isEnable?: boolean, meeting?: object) {
|
|
39
44
|
return new Promise((resolve, reject) => {
|
|
40
45
|
if (this.pendingPromiseResolve) {
|
|
41
46
|
// resolve the last promise we returned to the client as the client has issued a new request that has superseded the previous one
|
|
@@ -56,7 +61,7 @@ class EffectsState {
|
|
|
56
61
|
* @public
|
|
57
62
|
* @memberof Meeting
|
|
58
63
|
*/
|
|
59
|
-
isBnrEnabled() {
|
|
64
|
+
public isBnrEnabled() {
|
|
60
65
|
return this.state.bnr.enabled === BNR_STATUS.ENABLED;
|
|
61
66
|
}
|
|
62
67
|
|
|
@@ -83,7 +88,7 @@ class EffectsState {
|
|
|
83
88
|
* @public
|
|
84
89
|
* @memberof EffectsState
|
|
85
90
|
*/
|
|
86
|
-
async enableBNR(meeting) {
|
|
91
|
+
public async enableBNR(meeting: any) {
|
|
87
92
|
LoggerProxy.logger.info('Meeting:effectState#enableBNR. Enable BNR called');
|
|
88
93
|
|
|
89
94
|
if (this.isBnrEnabled()) {
|
|
@@ -146,7 +151,7 @@ class EffectsState {
|
|
|
146
151
|
* @public
|
|
147
152
|
* @memberof EffectsState
|
|
148
153
|
*/
|
|
149
|
-
async disableBNR(meeting) {
|
|
154
|
+
public async disableBNR(meeting: any) {
|
|
150
155
|
LoggerProxy.logger.info('Meeting:effectState#disableBNR. Disable BNR called');
|
|
151
156
|
|
|
152
157
|
const {bnr} = this.state;
|
|
@@ -161,6 +166,7 @@ class EffectsState {
|
|
|
161
166
|
bnr.enabled = BNR_STATUS.SHOULD_DISABLE;
|
|
162
167
|
this.state.callToWebrtcBNRInProgress = true;
|
|
163
168
|
|
|
169
|
+
// @ts-ignore - disableBNR does not expect an argument
|
|
164
170
|
const audioTrack = WebRTCMedia.Effects.BNR.disableBNR(meeting.mediaProperties.audioTrack);
|
|
165
171
|
|
|
166
172
|
const audioStream = MediaUtil.createMediaStream([audioTrack]);
|