@whereby.com/core 1.26.1 → 1.27.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/index.cjs +94 -35
- package/dist/index.d.cts +25 -5
- package/dist/index.d.mts +25 -5
- package/dist/index.d.ts +25 -5
- package/dist/index.mjs +93 -36
- package/dist/legacy-esm.js +93 -36
- package/dist/redux/index.cjs +60 -34
- package/dist/redux/index.d.cts +82 -18
- package/dist/redux/index.d.mts +82 -18
- package/dist/redux/index.d.ts +82 -18
- package/dist/redux/index.js +59 -35
- package/dist/redux/index.mjs +59 -35
- package/package.json +3 -3
package/dist/legacy-esm.js
CHANGED
|
@@ -1308,7 +1308,7 @@ const createReactor = (selectors, callback) => {
|
|
|
1308
1308
|
});
|
|
1309
1309
|
};
|
|
1310
1310
|
|
|
1311
|
-
const coreVersion = "1.
|
|
1311
|
+
const coreVersion = "1.27.0";
|
|
1312
1312
|
|
|
1313
1313
|
function decodeRoomName(roomName) {
|
|
1314
1314
|
if (!roomName) {
|
|
@@ -2579,8 +2579,6 @@ const organizationSlice = createSlice({
|
|
|
2579
2579
|
return Object.assign(Object.assign({}, state), { isFetching: true });
|
|
2580
2580
|
});
|
|
2581
2581
|
builder.addCase(doOrganizationFetch.fulfilled, (state, action) => {
|
|
2582
|
-
if (!action.payload)
|
|
2583
|
-
return Object.assign(Object.assign({}, state), { isFetching: true });
|
|
2584
2582
|
return Object.assign(Object.assign({}, state), { isFetching: false, data: action.payload });
|
|
2585
2583
|
});
|
|
2586
2584
|
builder.addCase(doOrganizationFetch.rejected, (state) => {
|
|
@@ -2589,17 +2587,12 @@ const organizationSlice = createSlice({
|
|
|
2589
2587
|
},
|
|
2590
2588
|
});
|
|
2591
2589
|
const doOrganizationFetch = createAppAsyncThunk("organization/doOrganizationFetch", (_1, _a) => __awaiter(void 0, [_1, _a], void 0, function* (_, { extra, getState }) {
|
|
2592
|
-
|
|
2593
|
-
|
|
2594
|
-
|
|
2595
|
-
|
|
2596
|
-
throw new Error("Invalid room url");
|
|
2597
|
-
}
|
|
2598
|
-
return organization;
|
|
2599
|
-
}
|
|
2600
|
-
catch (error) {
|
|
2601
|
-
console.error(error);
|
|
2590
|
+
const roomUrl = selectAppRoomUrl(getState());
|
|
2591
|
+
const organization = yield extra.services.fetchOrganizationFromRoomUrl(roomUrl || "");
|
|
2592
|
+
if (!organization) {
|
|
2593
|
+
throw new Error("Invalid room url");
|
|
2602
2594
|
}
|
|
2595
|
+
return organization;
|
|
2603
2596
|
}));
|
|
2604
2597
|
const selectOrganizationRaw = (state) => state.organization;
|
|
2605
2598
|
const selectOrganizationId = (state) => { var _a; return (_a = state.organization.data) === null || _a === void 0 ? void 0 : _a.organizationId; };
|
|
@@ -2661,8 +2654,12 @@ const roomConnectionSlice = createSlice({
|
|
|
2661
2654
|
return Object.assign(Object.assign({}, state), { status: willReconnect ? "reconnecting" : "disconnected", isRejoining: willReconnect && (state.isRejoining || state.status === "connected") });
|
|
2662
2655
|
});
|
|
2663
2656
|
builder.addCase(signalEvents.newClient, (state, action) => {
|
|
2664
|
-
var _a
|
|
2665
|
-
|
|
2657
|
+
var _a;
|
|
2658
|
+
const { room } = action.payload;
|
|
2659
|
+
if (!room) {
|
|
2660
|
+
return state;
|
|
2661
|
+
}
|
|
2662
|
+
return Object.assign(Object.assign({}, state), { session: (_a = room.session) !== null && _a !== void 0 ? _a : null });
|
|
2666
2663
|
});
|
|
2667
2664
|
builder.addCase(signalEvents.roomSessionEnded, (state, action) => {
|
|
2668
2665
|
var _a;
|
|
@@ -2677,6 +2674,9 @@ const roomConnectionSlice = createSlice({
|
|
|
2677
2674
|
builder.addCase(signalEvents.roomLeft, (state) => {
|
|
2678
2675
|
return Object.assign(Object.assign({}, state), { status: "left" });
|
|
2679
2676
|
});
|
|
2677
|
+
builder.addCase(doOrganizationFetch.rejected, (state) => {
|
|
2678
|
+
return Object.assign(Object.assign({}, state), { status: "disconnected", error: "organization_fetch_failed" });
|
|
2679
|
+
});
|
|
2680
2680
|
},
|
|
2681
2681
|
});
|
|
2682
2682
|
const { connectionStatusChanged, knockResponseReceived } = roomConnectionSlice.actions;
|
|
@@ -4192,16 +4192,16 @@ createReactor([selectStreamsToAccept, selectIsAcceptingStreams], ({ dispatch },
|
|
|
4192
4192
|
}
|
|
4193
4193
|
});
|
|
4194
4194
|
|
|
4195
|
-
const
|
|
4195
|
+
const IN_CALL_QUALITY_LEVELS = {
|
|
4196
4196
|
CRITICAL: "critical",
|
|
4197
4197
|
WARNING: "warning",
|
|
4198
4198
|
OK: "ok",
|
|
4199
4199
|
};
|
|
4200
|
-
const CALL_QUALITY_LEVEL_ORDER = Object.values(
|
|
4200
|
+
const CALL_QUALITY_LEVEL_ORDER = Object.values(IN_CALL_QUALITY_LEVELS);
|
|
4201
4201
|
function convertQualityScoreToNumber(score) {
|
|
4202
4202
|
return score !== undefined && score !== null
|
|
4203
4203
|
? CALL_QUALITY_LEVEL_ORDER.indexOf(score)
|
|
4204
|
-
: CALL_QUALITY_LEVEL_ORDER.indexOf(
|
|
4204
|
+
: CALL_QUALITY_LEVEL_ORDER.indexOf(IN_CALL_QUALITY_LEVELS.OK);
|
|
4205
4205
|
}
|
|
4206
4206
|
const getActiveIssues = (allIssues, issuesToCheck = []) => Object.keys(allIssues).reduce((issuesAcc, issueKey) => {
|
|
4207
4207
|
const issue = allIssues[issueKey];
|
|
@@ -4219,26 +4219,26 @@ function calculateCallQualityScore(clientId, roomMode, mediaQualityScores, conne
|
|
|
4219
4219
|
? [
|
|
4220
4220
|
convertQualityScoreToNumber(((_c = (_b = (_a = connectionMonitorIssuesReport === null || connectionMonitorIssuesReport === void 0 ? void 0 : connectionMonitorIssuesReport.critical) === null || _a === void 0 ? void 0 : _a[clientId]) === null || _b === void 0 ? void 0 : _b.video) === null || _c === void 0 ? void 0 : _c.length) !== undefined &&
|
|
4221
4221
|
((_f = (_e = (_d = connectionMonitorIssuesReport === null || connectionMonitorIssuesReport === void 0 ? void 0 : connectionMonitorIssuesReport.critical) === null || _d === void 0 ? void 0 : _d[clientId]) === null || _e === void 0 ? void 0 : _e.video) === null || _f === void 0 ? void 0 : _f.length) > 0
|
|
4222
|
-
?
|
|
4223
|
-
:
|
|
4222
|
+
? IN_CALL_QUALITY_LEVELS.CRITICAL
|
|
4223
|
+
: IN_CALL_QUALITY_LEVELS.OK),
|
|
4224
4224
|
convertQualityScoreToNumber(((_j = (_h = (_g = connectionMonitorIssuesReport === null || connectionMonitorIssuesReport === void 0 ? void 0 : connectionMonitorIssuesReport.warning) === null || _g === void 0 ? void 0 : _g[clientId]) === null || _h === void 0 ? void 0 : _h.video) === null || _j === void 0 ? void 0 : _j.length) !== undefined &&
|
|
4225
4225
|
((_m = (_l = (_k = connectionMonitorIssuesReport === null || connectionMonitorIssuesReport === void 0 ? void 0 : connectionMonitorIssuesReport.warning) === null || _k === void 0 ? void 0 : _k[clientId]) === null || _l === void 0 ? void 0 : _l.video) === null || _m === void 0 ? void 0 : _m.length) > 0
|
|
4226
|
-
?
|
|
4227
|
-
:
|
|
4226
|
+
? IN_CALL_QUALITY_LEVELS.WARNING
|
|
4227
|
+
: IN_CALL_QUALITY_LEVELS.OK),
|
|
4228
4228
|
]
|
|
4229
|
-
: [convertQualityScoreToNumber((_p = (_o = mediaQualityScores === null || mediaQualityScores === void 0 ? void 0 : mediaQualityScores[clientId]) === null || _o === void 0 ? void 0 : _o.video) !== null && _p !== void 0 ? _p :
|
|
4229
|
+
: [convertQualityScoreToNumber((_p = (_o = mediaQualityScores === null || mediaQualityScores === void 0 ? void 0 : mediaQualityScores[clientId]) === null || _o === void 0 ? void 0 : _o.video) !== null && _p !== void 0 ? _p : IN_CALL_QUALITY_LEVELS.OK)]));
|
|
4230
4230
|
const audioScoreValue = Math.min(...(roomMode === "normal"
|
|
4231
4231
|
? [
|
|
4232
4232
|
convertQualityScoreToNumber(((_s = (_r = (_q = connectionMonitorIssuesReport === null || connectionMonitorIssuesReport === void 0 ? void 0 : connectionMonitorIssuesReport.critical) === null || _q === void 0 ? void 0 : _q[clientId]) === null || _r === void 0 ? void 0 : _r.audio) === null || _s === void 0 ? void 0 : _s.length) !== undefined &&
|
|
4233
4233
|
((_v = (_u = (_t = connectionMonitorIssuesReport === null || connectionMonitorIssuesReport === void 0 ? void 0 : connectionMonitorIssuesReport.critical) === null || _t === void 0 ? void 0 : _t[clientId]) === null || _u === void 0 ? void 0 : _u.audio) === null || _v === void 0 ? void 0 : _v.length) > 0
|
|
4234
|
-
?
|
|
4235
|
-
:
|
|
4234
|
+
? IN_CALL_QUALITY_LEVELS.CRITICAL
|
|
4235
|
+
: IN_CALL_QUALITY_LEVELS.OK),
|
|
4236
4236
|
convertQualityScoreToNumber(((_y = (_x = (_w = connectionMonitorIssuesReport === null || connectionMonitorIssuesReport === void 0 ? void 0 : connectionMonitorIssuesReport.warning) === null || _w === void 0 ? void 0 : _w[clientId]) === null || _x === void 0 ? void 0 : _x.audio) === null || _y === void 0 ? void 0 : _y.length) !== undefined &&
|
|
4237
4237
|
((_1 = (_0 = (_z = connectionMonitorIssuesReport === null || connectionMonitorIssuesReport === void 0 ? void 0 : connectionMonitorIssuesReport.warning) === null || _z === void 0 ? void 0 : _z[clientId]) === null || _0 === void 0 ? void 0 : _0.audio) === null || _1 === void 0 ? void 0 : _1.length) > 0
|
|
4238
|
-
?
|
|
4239
|
-
:
|
|
4238
|
+
? IN_CALL_QUALITY_LEVELS.WARNING
|
|
4239
|
+
: IN_CALL_QUALITY_LEVELS.OK),
|
|
4240
4240
|
]
|
|
4241
|
-
: [convertQualityScoreToNumber((_3 = (_2 = mediaQualityScores === null || mediaQualityScores === void 0 ? void 0 : mediaQualityScores[clientId]) === null || _2 === void 0 ? void 0 : _2.audio) !== null && _3 !== void 0 ? _3 :
|
|
4241
|
+
: [convertQualityScoreToNumber((_3 = (_2 = mediaQualityScores === null || mediaQualityScores === void 0 ? void 0 : mediaQualityScores[clientId]) === null || _2 === void 0 ? void 0 : _2.audio) !== null && _3 !== void 0 ? _3 : IN_CALL_QUALITY_LEVELS.OK)]));
|
|
4242
4242
|
const overallScoreValue = Math.min(videoScoreValue, audioScoreValue);
|
|
4243
4243
|
return {
|
|
4244
4244
|
total: CALL_QUALITY_LEVEL_ORDER[overallScoreValue],
|
|
@@ -4246,6 +4246,17 @@ function calculateCallQualityScore(clientId, roomMode, mediaQualityScores, conne
|
|
|
4246
4246
|
audio: CALL_QUALITY_LEVEL_ORDER[audioScoreValue],
|
|
4247
4247
|
};
|
|
4248
4248
|
}
|
|
4249
|
+
const isCpuPressureSupported = () => typeof window !== "undefined" && "PressureObserver" in window;
|
|
4250
|
+
function calculateCpuQualityLevel(clientId, connectionMonitorIssuesReport) {
|
|
4251
|
+
var _a, _b, _c, _d, _e, _f;
|
|
4252
|
+
if ((_c = (_b = (_a = connectionMonitorIssuesReport === null || connectionMonitorIssuesReport === void 0 ? void 0 : connectionMonitorIssuesReport.critical) === null || _a === void 0 ? void 0 : _a[clientId]) === null || _b === void 0 ? void 0 : _b.cpu) === null || _c === void 0 ? void 0 : _c.length) {
|
|
4253
|
+
return IN_CALL_QUALITY_LEVELS.CRITICAL;
|
|
4254
|
+
}
|
|
4255
|
+
if ((_f = (_e = (_d = connectionMonitorIssuesReport === null || connectionMonitorIssuesReport === void 0 ? void 0 : connectionMonitorIssuesReport.warning) === null || _d === void 0 ? void 0 : _d[clientId]) === null || _e === void 0 ? void 0 : _e.cpu) === null || _f === void 0 ? void 0 : _f.length) {
|
|
4256
|
+
return IN_CALL_QUALITY_LEVELS.WARNING;
|
|
4257
|
+
}
|
|
4258
|
+
return IN_CALL_QUALITY_LEVELS.OK;
|
|
4259
|
+
}
|
|
4249
4260
|
const connectionMonitorSliceInitialState = {
|
|
4250
4261
|
running: false,
|
|
4251
4262
|
issuesReport: undefined,
|
|
@@ -4435,11 +4446,11 @@ const doSetRemoteCallQualityScores = createAppThunk((scores) => (dispatch, getSt
|
|
|
4435
4446
|
return;
|
|
4436
4447
|
}
|
|
4437
4448
|
const scoreValues = Object.values(scores);
|
|
4438
|
-
const total = scoreValues.some(({ total }) => total ===
|
|
4439
|
-
?
|
|
4440
|
-
: scoreValues.some(({ total }) => total ===
|
|
4441
|
-
?
|
|
4442
|
-
:
|
|
4449
|
+
const total = scoreValues.some(({ total }) => total === IN_CALL_QUALITY_LEVELS.CRITICAL)
|
|
4450
|
+
? IN_CALL_QUALITY_LEVELS.CRITICAL
|
|
4451
|
+
: scoreValues.some(({ total }) => total === IN_CALL_QUALITY_LEVELS.WARNING)
|
|
4452
|
+
? IN_CALL_QUALITY_LEVELS.WARNING
|
|
4453
|
+
: IN_CALL_QUALITY_LEVELS.OK;
|
|
4443
4454
|
rtcManager.sendStatsCustomEvent("remoteCallQualityScores", {
|
|
4444
4455
|
total,
|
|
4445
4456
|
_time: Date.now(),
|
|
@@ -4481,6 +4492,13 @@ const selectRemoteParticipantQualityReport = createSelector(selectRemoteCallQual
|
|
|
4481
4492
|
}
|
|
4482
4493
|
return Object.fromEntries(Object.entries(remoteCallQualityScores).map(([clientId, { total }]) => [clientId, { quality: total }]));
|
|
4483
4494
|
});
|
|
4495
|
+
const selectLocalParticipantQualityReport = createSelector(selectLocalCallQualityScore, (localCallQualityScore) => {
|
|
4496
|
+
if (!localCallQualityScore) {
|
|
4497
|
+
return undefined;
|
|
4498
|
+
}
|
|
4499
|
+
const { total, cpu } = localCallQualityScore;
|
|
4500
|
+
return Object.assign({ quality: total }, (cpu && { cpu }));
|
|
4501
|
+
});
|
|
4484
4502
|
const selectShouldStartConnectionMonitor = createSelector(selectRoomConnectionStatus, selectConnectionMonitorIsRunning, (roomConnectionStatus, isRunning) => {
|
|
4485
4503
|
if (!isRunning && roomConnectionStatus === "connected") {
|
|
4486
4504
|
return true;
|
|
@@ -4508,7 +4526,12 @@ const selectCalculatedLocalCallQualityScore = createSelector(selectRoomConnectio
|
|
|
4508
4526
|
if (roomConnectionStatus !== "connected" || !localParticipantView) {
|
|
4509
4527
|
return undefined;
|
|
4510
4528
|
}
|
|
4511
|
-
|
|
4529
|
+
const { clientId } = localParticipantView;
|
|
4530
|
+
const score = calculateCallQualityScore(clientId, roomMode, mediaQualityScores, connectionMonitorIssuesReport);
|
|
4531
|
+
if (!isCpuPressureSupported()) {
|
|
4532
|
+
return score;
|
|
4533
|
+
}
|
|
4534
|
+
return Object.assign(Object.assign({}, score), { cpu: calculateCpuQualityLevel(clientId, connectionMonitorIssuesReport) });
|
|
4512
4535
|
});
|
|
4513
4536
|
createReactor([selectShouldStartConnectionMonitor], ({ dispatch }, shouldStartConnectionMonitor) => {
|
|
4514
4537
|
if (shouldStartConnectionMonitor) {
|
|
@@ -6348,10 +6371,12 @@ const LIVE_TRANSCRIPTION_STATUS_CHANGED = "live-transcription:status-changed";
|
|
|
6348
6371
|
const CONNECTION_ERROR_CHANGED = "connection:error-changed";
|
|
6349
6372
|
const AUDIO_ONLY_MODE_CHANGED = "audio-only-mode:changed";
|
|
6350
6373
|
const REMOTE_PARTICIPANT_QUALITY_REPORT_CHANGED = "remote-participant-quality-report:changed";
|
|
6374
|
+
const LOCAL_PARTICIPANT_QUALITY_REPORT_CHANGED = "local-participant-quality-report:changed";
|
|
6351
6375
|
const LOCAL_PARTICIPANT_CHANGED = "local-participant:changed";
|
|
6352
6376
|
const LOCAL_SCREENSHARE_STATUS_CHANGED = "local-screenshare:status-changed";
|
|
6353
6377
|
const LOCAL_SCREENSHARE_CHANGED = "local-screenshare:state-changed";
|
|
6354
6378
|
const REMOTE_PARTICIPANTS_CHANGED = "remote-participants:changed";
|
|
6379
|
+
const ROOM_SESSION_ID_CHANGED = "room-session-id:changed";
|
|
6355
6380
|
const SCREENSHARE_STARTED = "screenshare:started";
|
|
6356
6381
|
const SCREENSHARE_STOPPED = "screenshare:stopped";
|
|
6357
6382
|
const CAMERA_STATE_CHANGED = "camera:state-changed";
|
|
@@ -6367,7 +6392,8 @@ const ROOM_JOINED_ERROR = "room:joined:error";
|
|
|
6367
6392
|
const ROOM_REJOINED = "room:rejoined";
|
|
6368
6393
|
|
|
6369
6394
|
const EMPTY_REMOTE_PARTICIPANT_QUALITY_REPORT = Object.freeze({});
|
|
6370
|
-
const
|
|
6395
|
+
const EMPTY_LOCAL_PARTICIPANT_QUALITY_REPORT = Object.freeze({});
|
|
6396
|
+
const selectRoomConnectionState = createSelector(selectChatMessages, selectFileUploads, selectCloudRecordingRaw, selectBreakoutCurrentGroup, selectBreakoutCurrentId, selectBreakoutActive, selectBreakoutGroupedParticipants, selectBreakoutGroups, selectBreakoutAssignments, selectBreakoutEnforceAssignment, selectBreakoutTimerSetting, selectBreakoutTimerDuration, selectBreakoutAutoMoveToGroup, selectBreakoutMoveToGroupGracePeriod, selectBreakoutAutoMoveToMain, selectBreakoutMoveToMainGracePeriod, selectBreakoutStartedAt, selectBreakoutEndTime, selectBreakoutMoveToGroupAt, selectBreakoutMoveToMainAt, selectBreakoutIsAvailable, selectBreakoutError, selectAllClientViewsInCurrentGroup, selectLiveCaptionsRaw, selectLiveTranscriptionRaw, selectLocalParticipantRaw, selectLocalMediaStream, selectLocalScreenshareRaw, selectRemoteParticipants, selectScreenshares, selectRoomConnectionStatus, selectRoomConnectionError, selectRoomConnectionKnockResponse, selectStreamingRaw, selectWaitingParticipants, selectNotificationsEmitter, selectSpotlightedClientViews, selectIsCameraEnabled, selectIsMicrophoneEnabled, selectRoomIntegrationsRaw, selectEnabledRoomIntegrations, selectEmbeddableRoomIntegrations, selectRunningRoomIntegrations, selectIsAudioOnlyModeEnabled, selectRemoteParticipantQualityReport, selectLocalParticipantQualityReport, selectRoomConnectionSessionId, (chatMessages, fileUploads, cloudRecording, breakoutCurrentGroup, breakoutCurrentId, breakoutActive, breakoutGroupedParticipants, breakoutGroups, breakoutAssignments, breakoutEnforceAssignment, breakoutTimerSetting, breakoutTimerDuration, breakoutAutoMoveToGroup, breakoutMoveToGroupGracePeriod, breakoutAutoMoveToMain, breakoutMoveToMainGracePeriod, breakoutStartedAt, breakoutEndTime, breakoutMoveToGroupAt, breakoutMoveToMainAt, breakoutIsAvailable, breakoutError, clientViewsInCurrentGroup, liveCaptions, liveTranscription, localParticipant, localMediaStream, localScreenshare, remoteParticipants, screenshares, connectionStatus, connectionError, knockResponse, streaming, waitingParticipants, notificationsEmitter, spotlightedClientViews, isCameraEnabled, isMicrophoneEnabled, roomIntegrationsRaw, enabledRoomIntegrations, embeddableRoomIntegrations, runningRoomIntegrations, isAudioOnlyModeEnabled, remoteParticipantQualityReport, localParticipantQualityReport, roomSessionId) => {
|
|
6371
6397
|
const broadcastingParticipants = breakoutActive && breakoutCurrentId
|
|
6372
6398
|
? spotlightedClientViews.filter((c) => !c.breakoutGroup && c.isAudioEnabled && !c.isPresentation)
|
|
6373
6399
|
: [];
|
|
@@ -6403,6 +6429,7 @@ const selectRoomConnectionState = createSelector(selectChatMessages, selectFileU
|
|
|
6403
6429
|
broadcastingParticipants,
|
|
6404
6430
|
},
|
|
6405
6431
|
remoteParticipantQualityReport: remoteParticipantQualityReport !== null && remoteParticipantQualityReport !== void 0 ? remoteParticipantQualityReport : EMPTY_REMOTE_PARTICIPANT_QUALITY_REPORT,
|
|
6432
|
+
localParticipantQualityReport: localParticipantQualityReport !== null && localParticipantQualityReport !== void 0 ? localParticipantQualityReport : EMPTY_LOCAL_PARTICIPANT_QUALITY_REPORT,
|
|
6406
6433
|
connectionStatus,
|
|
6407
6434
|
connectionError,
|
|
6408
6435
|
knockResponse,
|
|
@@ -6455,6 +6482,7 @@ const selectRoomConnectionState = createSelector(selectChatMessages, selectFileU
|
|
|
6455
6482
|
enabled: enabledRoomIntegrations,
|
|
6456
6483
|
running: runningRoomIntegrations,
|
|
6457
6484
|
},
|
|
6485
|
+
roomSessionId: roomSessionId !== null && roomSessionId !== void 0 ? roomSessionId : null,
|
|
6458
6486
|
screenshares,
|
|
6459
6487
|
waitingParticipants,
|
|
6460
6488
|
spotlightedParticipants: spotlightedClientViews,
|
|
@@ -6474,6 +6502,7 @@ class RoomConnectionClient extends BaseClient {
|
|
|
6474
6502
|
this.connectionErrorSubscribers = new Set();
|
|
6475
6503
|
this.audioOnlyModeSubscribers = new Set();
|
|
6476
6504
|
this.remoteParticipantQualityReportSubscribers = new Set();
|
|
6505
|
+
this.localParticipantQualityReportSubscribers = new Set();
|
|
6477
6506
|
this.connectionStatusSubscribers = new Set();
|
|
6478
6507
|
this.liveStreamSubscribers = new Set();
|
|
6479
6508
|
this.liveCaptionsSubscribers = new Set();
|
|
@@ -6483,6 +6512,7 @@ class RoomConnectionClient extends BaseClient {
|
|
|
6483
6512
|
this.localScreenshareSubscribers = new Set();
|
|
6484
6513
|
this.microphoneStateSubscribers = new Set();
|
|
6485
6514
|
this.remoteParticipantsSubscribers = new Set();
|
|
6515
|
+
this.roomSessionIdSubscribers = new Set();
|
|
6486
6516
|
this.screenshareSubscribers = new Set();
|
|
6487
6517
|
this.spotlightedParticipantsSubscribers = new Set();
|
|
6488
6518
|
this.waitingParticipantsSubscribers = new Set();
|
|
@@ -6521,6 +6551,10 @@ class RoomConnectionClient extends BaseClient {
|
|
|
6521
6551
|
this.connectionErrorSubscribers.forEach((cb) => cb(state.connectionError));
|
|
6522
6552
|
this.emit(CONNECTION_ERROR_CHANGED, state.connectionError);
|
|
6523
6553
|
}
|
|
6554
|
+
if (state.roomSessionId !== previousState.roomSessionId) {
|
|
6555
|
+
this.roomSessionIdSubscribers.forEach((cb) => cb(state.roomSessionId));
|
|
6556
|
+
this.emit(ROOM_SESSION_ID_CHANGED, state.roomSessionId);
|
|
6557
|
+
}
|
|
6524
6558
|
if (state.isAudioOnlyModeEnabled !== previousState.isAudioOnlyModeEnabled) {
|
|
6525
6559
|
this.audioOnlyModeSubscribers.forEach((cb) => cb(state.isAudioOnlyModeEnabled));
|
|
6526
6560
|
this.emit(AUDIO_ONLY_MODE_CHANGED, state.isAudioOnlyModeEnabled);
|
|
@@ -6529,6 +6563,10 @@ class RoomConnectionClient extends BaseClient {
|
|
|
6529
6563
|
this.remoteParticipantQualityReportSubscribers.forEach((cb) => cb(state.remoteParticipantQualityReport));
|
|
6530
6564
|
this.emit(REMOTE_PARTICIPANT_QUALITY_REPORT_CHANGED, state.remoteParticipantQualityReport);
|
|
6531
6565
|
}
|
|
6566
|
+
if (state.localParticipantQualityReport !== previousState.localParticipantQualityReport) {
|
|
6567
|
+
this.localParticipantQualityReportSubscribers.forEach((cb) => cb(state.localParticipantQualityReport));
|
|
6568
|
+
this.emit(LOCAL_PARTICIPANT_QUALITY_REPORT_CHANGED, state.localParticipantQualityReport);
|
|
6569
|
+
}
|
|
6532
6570
|
if (state.isCameraEnabled !== previousState.isCameraEnabled) {
|
|
6533
6571
|
this.cameraStateSubscribers.forEach((cb) => cb(state.isCameraEnabled));
|
|
6534
6572
|
this.emit(CAMERA_STATE_CHANGED, state.isCameraEnabled);
|
|
@@ -6662,6 +6700,10 @@ class RoomConnectionClient extends BaseClient {
|
|
|
6662
6700
|
this.connectionErrorSubscribers.add(callback);
|
|
6663
6701
|
return () => this.connectionErrorSubscribers.delete(callback);
|
|
6664
6702
|
}
|
|
6703
|
+
subscribeToRoomSessionId(callback) {
|
|
6704
|
+
this.roomSessionIdSubscribers.add(callback);
|
|
6705
|
+
return () => this.roomSessionIdSubscribers.delete(callback);
|
|
6706
|
+
}
|
|
6665
6707
|
subscribeToAudioOnlyMode(callback) {
|
|
6666
6708
|
this.audioOnlyModeSubscribers.add(callback);
|
|
6667
6709
|
return () => this.audioOnlyModeSubscribers.delete(callback);
|
|
@@ -6670,6 +6712,10 @@ class RoomConnectionClient extends BaseClient {
|
|
|
6670
6712
|
this.remoteParticipantQualityReportSubscribers.add(callback);
|
|
6671
6713
|
return () => this.remoteParticipantQualityReportSubscribers.delete(callback);
|
|
6672
6714
|
}
|
|
6715
|
+
subscribeToLocalParticipantQualityReport(callback) {
|
|
6716
|
+
this.localParticipantQualityReportSubscribers.add(callback);
|
|
6717
|
+
return () => this.localParticipantQualityReportSubscribers.delete(callback);
|
|
6718
|
+
}
|
|
6673
6719
|
subscribeToLiveStream(callback) {
|
|
6674
6720
|
this.liveStreamSubscribers.add(callback);
|
|
6675
6721
|
return () => this.liveStreamSubscribers.delete(callback);
|
|
@@ -6749,6 +6795,7 @@ class RoomConnectionClient extends BaseClient {
|
|
|
6749
6795
|
actionCreator: signalEvents.roomJoined,
|
|
6750
6796
|
effect: ({ payload }) => {
|
|
6751
6797
|
unsubscribeRoomJoined();
|
|
6798
|
+
unsubscribeOrganizationFetchFailed();
|
|
6752
6799
|
if ("error" in payload) {
|
|
6753
6800
|
reject === null || reject === void 0 ? void 0 : reject(payload.error);
|
|
6754
6801
|
return;
|
|
@@ -6756,6 +6803,14 @@ class RoomConnectionClient extends BaseClient {
|
|
|
6756
6803
|
resolve === null || resolve === void 0 ? void 0 : resolve(payload);
|
|
6757
6804
|
},
|
|
6758
6805
|
}));
|
|
6806
|
+
const unsubscribeOrganizationFetchFailed = this.store.dispatch(addListener({
|
|
6807
|
+
actionCreator: doOrganizationFetch.rejected,
|
|
6808
|
+
effect: () => {
|
|
6809
|
+
unsubscribeRoomJoined();
|
|
6810
|
+
unsubscribeOrganizationFetchFailed();
|
|
6811
|
+
reject === null || reject === void 0 ? void 0 : reject("organization_fetch_failed");
|
|
6812
|
+
},
|
|
6813
|
+
}));
|
|
6759
6814
|
return promise;
|
|
6760
6815
|
});
|
|
6761
6816
|
}
|
|
@@ -6993,6 +7048,7 @@ class RoomConnectionClient extends BaseClient {
|
|
|
6993
7048
|
this.connectionErrorSubscribers.clear();
|
|
6994
7049
|
this.audioOnlyModeSubscribers.clear();
|
|
6995
7050
|
this.remoteParticipantQualityReportSubscribers.clear();
|
|
7051
|
+
this.localParticipantQualityReportSubscribers.clear();
|
|
6996
7052
|
this.connectionStatusSubscribers.clear();
|
|
6997
7053
|
this.liveStreamSubscribers.clear();
|
|
6998
7054
|
this.localParticipantSubscribers.clear();
|
|
@@ -7000,6 +7056,7 @@ class RoomConnectionClient extends BaseClient {
|
|
|
7000
7056
|
this.localScreenshareSubscribers.clear();
|
|
7001
7057
|
this.microphoneStateSubscribers.clear();
|
|
7002
7058
|
this.remoteParticipantsSubscribers.clear();
|
|
7059
|
+
this.roomSessionIdSubscribers.clear();
|
|
7003
7060
|
this.screenshareSubscribers.clear();
|
|
7004
7061
|
this.spotlightedParticipantsSubscribers.clear();
|
|
7005
7062
|
this.waitingParticipantsSubscribers.clear();
|
|
@@ -7033,4 +7090,4 @@ class WherebyClient {
|
|
|
7033
7090
|
}
|
|
7034
7091
|
}
|
|
7035
7092
|
|
|
7036
|
-
export { ACCEPTED_FILE_TYPES, AUDIO_ONLY_MODE_CHANGED, ApiClient, BREAKOUT_CONFIG_CHANGED, BREAKOUT_GROUPS_MIN_MAX, BREAKOUT_UNAVAILABLE_ERROR, CAMERA_DEVICES_CHANGED, CAMERA_DEVICE_ERROR_CHANGED, CAMERA_ENABLED_CHANGED, CAMERA_STATE_CHANGED, CHAT_NEW_MESSAGE, CLIENT_VIEW_CHANGED, CLIENT_VIEW_SPOTLIGHTS_CHANGED, CLOUD_RECORDING_STATUS_CHANGED, CONNECTION_ERROR_CHANGED, CONNECTION_STATUS_CHANGED, CURRENT_CAMERA_CHANGED, CURRENT_MICROPHONE_CHANGED, CURRENT_SPEAKER_CHANGED, Credentials, CredentialsService, DEFAULT_BREAKOUT_TIMER_DURATION, GridClient, IS_SETTING_CAMERA_DEVICE, IS_SETTING_MICROPHONE_DEVICE, LIVE_CAPTIONS_STATUS_CHANGED, LIVE_TRANSCRIPTION_STATUS_CHANGED, LOCAL_MEDIA_STARTING, LOCAL_MEDIA_START_ERROR_CHANGED, LOCAL_PARTICIPANT_CHANGED, LOCAL_SCREENSHARE_CHANGED, LOCAL_SCREENSHARE_STATUS_CHANGED, LOCAL_STREAM_CHANGED, LiveCaption, LocalMediaClient, LocalParticipant, MAX_FILES_PER_UPLOAD, MAX_FILE_SIZE, MICROPHONE_DEVICES_CHANGED, MICROPHONE_DEVICE_ERROR_CHANGED, MICROPHONE_ENABLED_CHANGED, MICROPHONE_STATE_CHANGED, NUMBER_OF_CLIENT_VIEWS_CHANGED, Organization, OrganizationApiClient, OrganizationService, OrganizationServiceCache, REMOTE_PARTICIPANTS_CHANGED, REMOTE_PARTICIPANT_QUALITY_REPORT_CHANGED, ROOM_INTEGRATION_PICKER_MESSAGES, ROOM_JOINED, ROOM_JOINED_ERROR, ROOM_REJOINED, RUNNING_ROOM_INTEGRATIONS_CHANGED, RoomConnectionClient, RoomIntegrationService, RoomService, SCREENSHARE_STARTED, SCREENSHARE_STOPPED, SPEAKER_DEVICES_CHANGED, SPOTLIGHT_PARTICIPANT_ADDED, SPOTLIGHT_PARTICIPANT_REMOVED, STREAMING_STARTED, STREAMING_STOPPED, WAITING_PARTICIPANT_JOINED, WAITING_PARTICIPANT_LEFT, WherebyClient, createBreakoutGroups, createServices, debounce, defaultBreakoutGroupName, getAudioTrack, getFakeMediaStream, getUsableCameraEffectPresets, getVideoTrack, hasValue, isAudioDenoiserSupported, miro, parseUnverifiedRoomKeyData, roomIntegrationContent, roomIntegrationContentTagName, roomIntegrationPickerUrl, youtube };
|
|
7093
|
+
export { ACCEPTED_FILE_TYPES, AUDIO_ONLY_MODE_CHANGED, ApiClient, BREAKOUT_CONFIG_CHANGED, BREAKOUT_GROUPS_MIN_MAX, BREAKOUT_UNAVAILABLE_ERROR, CAMERA_DEVICES_CHANGED, CAMERA_DEVICE_ERROR_CHANGED, CAMERA_ENABLED_CHANGED, CAMERA_STATE_CHANGED, CHAT_NEW_MESSAGE, CLIENT_VIEW_CHANGED, CLIENT_VIEW_SPOTLIGHTS_CHANGED, CLOUD_RECORDING_STATUS_CHANGED, CONNECTION_ERROR_CHANGED, CONNECTION_STATUS_CHANGED, CURRENT_CAMERA_CHANGED, CURRENT_MICROPHONE_CHANGED, CURRENT_SPEAKER_CHANGED, Credentials, CredentialsService, DEFAULT_BREAKOUT_TIMER_DURATION, GridClient, IS_SETTING_CAMERA_DEVICE, IS_SETTING_MICROPHONE_DEVICE, LIVE_CAPTIONS_STATUS_CHANGED, LIVE_TRANSCRIPTION_STATUS_CHANGED, LOCAL_MEDIA_STARTING, LOCAL_MEDIA_START_ERROR_CHANGED, LOCAL_PARTICIPANT_CHANGED, LOCAL_PARTICIPANT_QUALITY_REPORT_CHANGED, LOCAL_SCREENSHARE_CHANGED, LOCAL_SCREENSHARE_STATUS_CHANGED, LOCAL_STREAM_CHANGED, LiveCaption, LocalMediaClient, LocalParticipant, MAX_FILES_PER_UPLOAD, MAX_FILE_SIZE, MICROPHONE_DEVICES_CHANGED, MICROPHONE_DEVICE_ERROR_CHANGED, MICROPHONE_ENABLED_CHANGED, MICROPHONE_STATE_CHANGED, NUMBER_OF_CLIENT_VIEWS_CHANGED, Organization, OrganizationApiClient, OrganizationService, OrganizationServiceCache, REMOTE_PARTICIPANTS_CHANGED, REMOTE_PARTICIPANT_QUALITY_REPORT_CHANGED, ROOM_INTEGRATION_PICKER_MESSAGES, ROOM_JOINED, ROOM_JOINED_ERROR, ROOM_REJOINED, ROOM_SESSION_ID_CHANGED, RUNNING_ROOM_INTEGRATIONS_CHANGED, RoomConnectionClient, RoomIntegrationService, RoomService, SCREENSHARE_STARTED, SCREENSHARE_STOPPED, SPEAKER_DEVICES_CHANGED, SPOTLIGHT_PARTICIPANT_ADDED, SPOTLIGHT_PARTICIPANT_REMOVED, STREAMING_STARTED, STREAMING_STOPPED, WAITING_PARTICIPANT_JOINED, WAITING_PARTICIPANT_LEFT, WherebyClient, createBreakoutGroups, createServices, debounce, defaultBreakoutGroupName, getAudioTrack, getFakeMediaStream, getUsableCameraEffectPresets, getVideoTrack, hasValue, isAudioDenoiserSupported, miro, parseUnverifiedRoomKeyData, roomIntegrationContent, roomIntegrationContentTagName, roomIntegrationPickerUrl, youtube };
|
package/dist/redux/index.cjs
CHANGED
|
@@ -76,7 +76,7 @@ const createReactor = (selectors, callback) => {
|
|
|
76
76
|
});
|
|
77
77
|
};
|
|
78
78
|
|
|
79
|
-
const coreVersion = "1.
|
|
79
|
+
const coreVersion = "1.27.0";
|
|
80
80
|
|
|
81
81
|
function decodeRoomName(roomName) {
|
|
82
82
|
if (!roomName) {
|
|
@@ -1369,8 +1369,6 @@ const organizationSlice = toolkit.createSlice({
|
|
|
1369
1369
|
return Object.assign(Object.assign({}, state), { isFetching: true });
|
|
1370
1370
|
});
|
|
1371
1371
|
builder.addCase(doOrganizationFetch.fulfilled, (state, action) => {
|
|
1372
|
-
if (!action.payload)
|
|
1373
|
-
return Object.assign(Object.assign({}, state), { isFetching: true });
|
|
1374
1372
|
return Object.assign(Object.assign({}, state), { isFetching: false, data: action.payload });
|
|
1375
1373
|
});
|
|
1376
1374
|
builder.addCase(doOrganizationFetch.rejected, (state) => {
|
|
@@ -1379,17 +1377,12 @@ const organizationSlice = toolkit.createSlice({
|
|
|
1379
1377
|
},
|
|
1380
1378
|
});
|
|
1381
1379
|
const doOrganizationFetch = createAppAsyncThunk("organization/doOrganizationFetch", (_1, _a) => __awaiter(void 0, [_1, _a], void 0, function* (_, { extra, getState }) {
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
throw new Error("Invalid room url");
|
|
1387
|
-
}
|
|
1388
|
-
return organization;
|
|
1389
|
-
}
|
|
1390
|
-
catch (error) {
|
|
1391
|
-
console.error(error);
|
|
1380
|
+
const roomUrl = selectAppRoomUrl(getState());
|
|
1381
|
+
const organization = yield extra.services.fetchOrganizationFromRoomUrl(roomUrl || "");
|
|
1382
|
+
if (!organization) {
|
|
1383
|
+
throw new Error("Invalid room url");
|
|
1392
1384
|
}
|
|
1385
|
+
return organization;
|
|
1393
1386
|
}));
|
|
1394
1387
|
const selectOrganizationRaw = (state) => state.organization;
|
|
1395
1388
|
const selectOrganizationId = (state) => { var _a; return (_a = state.organization.data) === null || _a === void 0 ? void 0 : _a.organizationId; };
|
|
@@ -1451,8 +1444,12 @@ const roomConnectionSlice = toolkit.createSlice({
|
|
|
1451
1444
|
return Object.assign(Object.assign({}, state), { status: willReconnect ? "reconnecting" : "disconnected", isRejoining: willReconnect && (state.isRejoining || state.status === "connected") });
|
|
1452
1445
|
});
|
|
1453
1446
|
builder.addCase(signalEvents.newClient, (state, action) => {
|
|
1454
|
-
var _a
|
|
1455
|
-
|
|
1447
|
+
var _a;
|
|
1448
|
+
const { room } = action.payload;
|
|
1449
|
+
if (!room) {
|
|
1450
|
+
return state;
|
|
1451
|
+
}
|
|
1452
|
+
return Object.assign(Object.assign({}, state), { session: (_a = room.session) !== null && _a !== void 0 ? _a : null });
|
|
1456
1453
|
});
|
|
1457
1454
|
builder.addCase(signalEvents.roomSessionEnded, (state, action) => {
|
|
1458
1455
|
var _a;
|
|
@@ -1467,6 +1464,9 @@ const roomConnectionSlice = toolkit.createSlice({
|
|
|
1467
1464
|
builder.addCase(signalEvents.roomLeft, (state) => {
|
|
1468
1465
|
return Object.assign(Object.assign({}, state), { status: "left" });
|
|
1469
1466
|
});
|
|
1467
|
+
builder.addCase(doOrganizationFetch.rejected, (state) => {
|
|
1468
|
+
return Object.assign(Object.assign({}, state), { status: "disconnected", error: "organization_fetch_failed" });
|
|
1469
|
+
});
|
|
1470
1470
|
},
|
|
1471
1471
|
});
|
|
1472
1472
|
const { connectionStatusChanged, knockResponseReceived } = roomConnectionSlice.actions;
|
|
@@ -2993,16 +2993,17 @@ createReactor([selectStreamsToAccept, selectIsAcceptingStreams], ({ dispatch },
|
|
|
2993
2993
|
}
|
|
2994
2994
|
});
|
|
2995
2995
|
|
|
2996
|
-
const
|
|
2996
|
+
const IN_CALL_QUALITY_LEVELS = {
|
|
2997
2997
|
CRITICAL: "critical",
|
|
2998
2998
|
WARNING: "warning",
|
|
2999
2999
|
OK: "ok",
|
|
3000
3000
|
};
|
|
3001
|
-
const
|
|
3001
|
+
const CALL_QUALITY_LEVELS = IN_CALL_QUALITY_LEVELS;
|
|
3002
|
+
const CALL_QUALITY_LEVEL_ORDER = Object.values(IN_CALL_QUALITY_LEVELS);
|
|
3002
3003
|
function convertQualityScoreToNumber(score) {
|
|
3003
3004
|
return score !== undefined && score !== null
|
|
3004
3005
|
? CALL_QUALITY_LEVEL_ORDER.indexOf(score)
|
|
3005
|
-
: CALL_QUALITY_LEVEL_ORDER.indexOf(
|
|
3006
|
+
: CALL_QUALITY_LEVEL_ORDER.indexOf(IN_CALL_QUALITY_LEVELS.OK);
|
|
3006
3007
|
}
|
|
3007
3008
|
const getActiveIssues = (allIssues, issuesToCheck = []) => Object.keys(allIssues).reduce((issuesAcc, issueKey) => {
|
|
3008
3009
|
const issue = allIssues[issueKey];
|
|
@@ -3020,26 +3021,26 @@ function calculateCallQualityScore(clientId, roomMode, mediaQualityScores, conne
|
|
|
3020
3021
|
? [
|
|
3021
3022
|
convertQualityScoreToNumber(((_c = (_b = (_a = connectionMonitorIssuesReport === null || connectionMonitorIssuesReport === void 0 ? void 0 : connectionMonitorIssuesReport.critical) === null || _a === void 0 ? void 0 : _a[clientId]) === null || _b === void 0 ? void 0 : _b.video) === null || _c === void 0 ? void 0 : _c.length) !== undefined &&
|
|
3022
3023
|
((_f = (_e = (_d = connectionMonitorIssuesReport === null || connectionMonitorIssuesReport === void 0 ? void 0 : connectionMonitorIssuesReport.critical) === null || _d === void 0 ? void 0 : _d[clientId]) === null || _e === void 0 ? void 0 : _e.video) === null || _f === void 0 ? void 0 : _f.length) > 0
|
|
3023
|
-
?
|
|
3024
|
-
:
|
|
3024
|
+
? IN_CALL_QUALITY_LEVELS.CRITICAL
|
|
3025
|
+
: IN_CALL_QUALITY_LEVELS.OK),
|
|
3025
3026
|
convertQualityScoreToNumber(((_j = (_h = (_g = connectionMonitorIssuesReport === null || connectionMonitorIssuesReport === void 0 ? void 0 : connectionMonitorIssuesReport.warning) === null || _g === void 0 ? void 0 : _g[clientId]) === null || _h === void 0 ? void 0 : _h.video) === null || _j === void 0 ? void 0 : _j.length) !== undefined &&
|
|
3026
3027
|
((_m = (_l = (_k = connectionMonitorIssuesReport === null || connectionMonitorIssuesReport === void 0 ? void 0 : connectionMonitorIssuesReport.warning) === null || _k === void 0 ? void 0 : _k[clientId]) === null || _l === void 0 ? void 0 : _l.video) === null || _m === void 0 ? void 0 : _m.length) > 0
|
|
3027
|
-
?
|
|
3028
|
-
:
|
|
3028
|
+
? IN_CALL_QUALITY_LEVELS.WARNING
|
|
3029
|
+
: IN_CALL_QUALITY_LEVELS.OK),
|
|
3029
3030
|
]
|
|
3030
|
-
: [convertQualityScoreToNumber((_p = (_o = mediaQualityScores === null || mediaQualityScores === void 0 ? void 0 : mediaQualityScores[clientId]) === null || _o === void 0 ? void 0 : _o.video) !== null && _p !== void 0 ? _p :
|
|
3031
|
+
: [convertQualityScoreToNumber((_p = (_o = mediaQualityScores === null || mediaQualityScores === void 0 ? void 0 : mediaQualityScores[clientId]) === null || _o === void 0 ? void 0 : _o.video) !== null && _p !== void 0 ? _p : IN_CALL_QUALITY_LEVELS.OK)]));
|
|
3031
3032
|
const audioScoreValue = Math.min(...(roomMode === "normal"
|
|
3032
3033
|
? [
|
|
3033
3034
|
convertQualityScoreToNumber(((_s = (_r = (_q = connectionMonitorIssuesReport === null || connectionMonitorIssuesReport === void 0 ? void 0 : connectionMonitorIssuesReport.critical) === null || _q === void 0 ? void 0 : _q[clientId]) === null || _r === void 0 ? void 0 : _r.audio) === null || _s === void 0 ? void 0 : _s.length) !== undefined &&
|
|
3034
3035
|
((_v = (_u = (_t = connectionMonitorIssuesReport === null || connectionMonitorIssuesReport === void 0 ? void 0 : connectionMonitorIssuesReport.critical) === null || _t === void 0 ? void 0 : _t[clientId]) === null || _u === void 0 ? void 0 : _u.audio) === null || _v === void 0 ? void 0 : _v.length) > 0
|
|
3035
|
-
?
|
|
3036
|
-
:
|
|
3036
|
+
? IN_CALL_QUALITY_LEVELS.CRITICAL
|
|
3037
|
+
: IN_CALL_QUALITY_LEVELS.OK),
|
|
3037
3038
|
convertQualityScoreToNumber(((_y = (_x = (_w = connectionMonitorIssuesReport === null || connectionMonitorIssuesReport === void 0 ? void 0 : connectionMonitorIssuesReport.warning) === null || _w === void 0 ? void 0 : _w[clientId]) === null || _x === void 0 ? void 0 : _x.audio) === null || _y === void 0 ? void 0 : _y.length) !== undefined &&
|
|
3038
3039
|
((_1 = (_0 = (_z = connectionMonitorIssuesReport === null || connectionMonitorIssuesReport === void 0 ? void 0 : connectionMonitorIssuesReport.warning) === null || _z === void 0 ? void 0 : _z[clientId]) === null || _0 === void 0 ? void 0 : _0.audio) === null || _1 === void 0 ? void 0 : _1.length) > 0
|
|
3039
|
-
?
|
|
3040
|
-
:
|
|
3040
|
+
? IN_CALL_QUALITY_LEVELS.WARNING
|
|
3041
|
+
: IN_CALL_QUALITY_LEVELS.OK),
|
|
3041
3042
|
]
|
|
3042
|
-
: [convertQualityScoreToNumber((_3 = (_2 = mediaQualityScores === null || mediaQualityScores === void 0 ? void 0 : mediaQualityScores[clientId]) === null || _2 === void 0 ? void 0 : _2.audio) !== null && _3 !== void 0 ? _3 :
|
|
3043
|
+
: [convertQualityScoreToNumber((_3 = (_2 = mediaQualityScores === null || mediaQualityScores === void 0 ? void 0 : mediaQualityScores[clientId]) === null || _2 === void 0 ? void 0 : _2.audio) !== null && _3 !== void 0 ? _3 : IN_CALL_QUALITY_LEVELS.OK)]));
|
|
3043
3044
|
const overallScoreValue = Math.min(videoScoreValue, audioScoreValue);
|
|
3044
3045
|
return {
|
|
3045
3046
|
total: CALL_QUALITY_LEVEL_ORDER[overallScoreValue],
|
|
@@ -3047,6 +3048,17 @@ function calculateCallQualityScore(clientId, roomMode, mediaQualityScores, conne
|
|
|
3047
3048
|
audio: CALL_QUALITY_LEVEL_ORDER[audioScoreValue],
|
|
3048
3049
|
};
|
|
3049
3050
|
}
|
|
3051
|
+
const isCpuPressureSupported = () => typeof window !== "undefined" && "PressureObserver" in window;
|
|
3052
|
+
function calculateCpuQualityLevel(clientId, connectionMonitorIssuesReport) {
|
|
3053
|
+
var _a, _b, _c, _d, _e, _f;
|
|
3054
|
+
if ((_c = (_b = (_a = connectionMonitorIssuesReport === null || connectionMonitorIssuesReport === void 0 ? void 0 : connectionMonitorIssuesReport.critical) === null || _a === void 0 ? void 0 : _a[clientId]) === null || _b === void 0 ? void 0 : _b.cpu) === null || _c === void 0 ? void 0 : _c.length) {
|
|
3055
|
+
return IN_CALL_QUALITY_LEVELS.CRITICAL;
|
|
3056
|
+
}
|
|
3057
|
+
if ((_f = (_e = (_d = connectionMonitorIssuesReport === null || connectionMonitorIssuesReport === void 0 ? void 0 : connectionMonitorIssuesReport.warning) === null || _d === void 0 ? void 0 : _d[clientId]) === null || _e === void 0 ? void 0 : _e.cpu) === null || _f === void 0 ? void 0 : _f.length) {
|
|
3058
|
+
return IN_CALL_QUALITY_LEVELS.WARNING;
|
|
3059
|
+
}
|
|
3060
|
+
return IN_CALL_QUALITY_LEVELS.OK;
|
|
3061
|
+
}
|
|
3050
3062
|
const connectionMonitorSliceInitialState = {
|
|
3051
3063
|
running: false,
|
|
3052
3064
|
issuesReport: undefined,
|
|
@@ -3236,11 +3248,11 @@ const doSetRemoteCallQualityScores = createAppThunk((scores) => (dispatch, getSt
|
|
|
3236
3248
|
return;
|
|
3237
3249
|
}
|
|
3238
3250
|
const scoreValues = Object.values(scores);
|
|
3239
|
-
const total = scoreValues.some(({ total }) => total ===
|
|
3240
|
-
?
|
|
3241
|
-
: scoreValues.some(({ total }) => total ===
|
|
3242
|
-
?
|
|
3243
|
-
:
|
|
3251
|
+
const total = scoreValues.some(({ total }) => total === IN_CALL_QUALITY_LEVELS.CRITICAL)
|
|
3252
|
+
? IN_CALL_QUALITY_LEVELS.CRITICAL
|
|
3253
|
+
: scoreValues.some(({ total }) => total === IN_CALL_QUALITY_LEVELS.WARNING)
|
|
3254
|
+
? IN_CALL_QUALITY_LEVELS.WARNING
|
|
3255
|
+
: IN_CALL_QUALITY_LEVELS.OK;
|
|
3244
3256
|
rtcManager.sendStatsCustomEvent("remoteCallQualityScores", {
|
|
3245
3257
|
total,
|
|
3246
3258
|
_time: Date.now(),
|
|
@@ -3282,6 +3294,13 @@ const selectRemoteParticipantQualityReport = toolkit.createSelector(selectRemote
|
|
|
3282
3294
|
}
|
|
3283
3295
|
return Object.fromEntries(Object.entries(remoteCallQualityScores).map(([clientId, { total }]) => [clientId, { quality: total }]));
|
|
3284
3296
|
});
|
|
3297
|
+
const selectLocalParticipantQualityReport = toolkit.createSelector(selectLocalCallQualityScore, (localCallQualityScore) => {
|
|
3298
|
+
if (!localCallQualityScore) {
|
|
3299
|
+
return undefined;
|
|
3300
|
+
}
|
|
3301
|
+
const { total, cpu } = localCallQualityScore;
|
|
3302
|
+
return Object.assign({ quality: total }, (cpu && { cpu }));
|
|
3303
|
+
});
|
|
3285
3304
|
const selectShouldStartConnectionMonitor = toolkit.createSelector(selectRoomConnectionStatus, selectConnectionMonitorIsRunning, (roomConnectionStatus, isRunning) => {
|
|
3286
3305
|
if (!isRunning && roomConnectionStatus === "connected") {
|
|
3287
3306
|
return true;
|
|
@@ -3309,7 +3328,12 @@ const selectCalculatedLocalCallQualityScore = toolkit.createSelector(selectRoomC
|
|
|
3309
3328
|
if (roomConnectionStatus !== "connected" || !localParticipantView) {
|
|
3310
3329
|
return undefined;
|
|
3311
3330
|
}
|
|
3312
|
-
|
|
3331
|
+
const { clientId } = localParticipantView;
|
|
3332
|
+
const score = calculateCallQualityScore(clientId, roomMode, mediaQualityScores, connectionMonitorIssuesReport);
|
|
3333
|
+
if (!isCpuPressureSupported()) {
|
|
3334
|
+
return score;
|
|
3335
|
+
}
|
|
3336
|
+
return Object.assign(Object.assign({}, score), { cpu: calculateCpuQualityLevel(clientId, connectionMonitorIssuesReport) });
|
|
3313
3337
|
});
|
|
3314
3338
|
createReactor([selectShouldStartConnectionMonitor], ({ dispatch }, shouldStartConnectionMonitor) => {
|
|
3315
3339
|
if (shouldStartConnectionMonitor) {
|
|
@@ -5610,6 +5634,7 @@ exports.BREAKOUT_GROUPS_MIN_MAX = BREAKOUT_GROUPS_MIN_MAX;
|
|
|
5610
5634
|
exports.BREAKOUT_UNAVAILABLE_ERROR = BREAKOUT_UNAVAILABLE_ERROR;
|
|
5611
5635
|
exports.CALL_QUALITY_LEVELS = CALL_QUALITY_LEVELS;
|
|
5612
5636
|
exports.DEFAULT_BREAKOUT_TIMER_DURATION = DEFAULT_BREAKOUT_TIMER_DURATION;
|
|
5637
|
+
exports.IN_CALL_QUALITY_LEVELS = IN_CALL_QUALITY_LEVELS;
|
|
5613
5638
|
exports.MAX_FILES_PER_UPLOAD = MAX_FILES_PER_UPLOAD;
|
|
5614
5639
|
exports.MAX_FILE_SIZE = MAX_FILE_SIZE;
|
|
5615
5640
|
exports.ROOM_INTEGRATION_PICKER_MESSAGES = ROOM_INTEGRATION_PICKER_MESSAGES;
|
|
@@ -5906,6 +5931,7 @@ exports.selectLocalParticipantBreakoutAssigned = selectLocalParticipantBreakoutA
|
|
|
5906
5931
|
exports.selectLocalParticipantBreakoutGroup = selectLocalParticipantBreakoutGroup;
|
|
5907
5932
|
exports.selectLocalParticipantClientClaim = selectLocalParticipantClientClaim;
|
|
5908
5933
|
exports.selectLocalParticipantDisplayName = selectLocalParticipantDisplayName;
|
|
5934
|
+
exports.selectLocalParticipantQualityReport = selectLocalParticipantQualityReport;
|
|
5909
5935
|
exports.selectLocalParticipantRaw = selectLocalParticipantRaw;
|
|
5910
5936
|
exports.selectLocalParticipantStickyReaction = selectLocalParticipantStickyReaction;
|
|
5911
5937
|
exports.selectLocalParticipantView = selectLocalParticipantView;
|