@whereby.com/core 1.25.0 → 1.26.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 +264 -4
- package/dist/index.d.cts +40 -2
- package/dist/index.d.mts +40 -2
- package/dist/index.d.ts +40 -2
- package/dist/index.mjs +264 -5
- package/dist/legacy-esm.js +264 -5
- package/dist/redux/index.cjs +262 -3
- package/dist/redux/index.d.cts +424 -3
- package/dist/redux/index.d.mts +424 -3
- package/dist/redux/index.d.ts +424 -3
- package/dist/redux/index.js +249 -4
- package/dist/redux/index.mjs +249 -4
- package/package.json +5 -5
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.26.0";
|
|
80
80
|
|
|
81
81
|
function decodeRoomName(roomName) {
|
|
82
82
|
if (!roomName) {
|
|
@@ -1129,6 +1129,7 @@ const rtcEvents = {
|
|
|
1129
1129
|
rtcManagerDestroyed: createRtcEventAction("rtcManagerDestroyed"),
|
|
1130
1130
|
streamAdded: createRtcEventAction("streamAdded"),
|
|
1131
1131
|
clientConnectionStatusChanged: createRtcEventAction("clientConnectionStatusChanged"),
|
|
1132
|
+
mediaQualityChanged: createRtcEventAction("mediaQualityChanged"),
|
|
1132
1133
|
};
|
|
1133
1134
|
|
|
1134
1135
|
function createRemoteParticipant(client, newJoiner = false) {
|
|
@@ -2615,6 +2616,9 @@ const createWebRtcEmitter = (dispatch) => {
|
|
|
2615
2616
|
else if (eventName === "client_connection_status_changed") {
|
|
2616
2617
|
dispatch(rtcEvents.clientConnectionStatusChanged(data));
|
|
2617
2618
|
}
|
|
2619
|
+
else if (eventName === "media_quality_changed") {
|
|
2620
|
+
dispatch(rtcEvents.mediaQualityChanged(data));
|
|
2621
|
+
}
|
|
2618
2622
|
else ;
|
|
2619
2623
|
},
|
|
2620
2624
|
};
|
|
@@ -2989,8 +2993,66 @@ createReactor([selectStreamsToAccept, selectIsAcceptingStreams], ({ dispatch },
|
|
|
2989
2993
|
}
|
|
2990
2994
|
});
|
|
2991
2995
|
|
|
2996
|
+
const CALL_QUALITY_LEVELS = {
|
|
2997
|
+
CRITICAL: "critical",
|
|
2998
|
+
WARNING: "warning",
|
|
2999
|
+
OK: "ok",
|
|
3000
|
+
};
|
|
3001
|
+
const CALL_QUALITY_LEVEL_ORDER = Object.values(CALL_QUALITY_LEVELS);
|
|
3002
|
+
function convertQualityScoreToNumber(score) {
|
|
3003
|
+
return score !== undefined && score !== null
|
|
3004
|
+
? CALL_QUALITY_LEVEL_ORDER.indexOf(score)
|
|
3005
|
+
: CALL_QUALITY_LEVEL_ORDER.indexOf(CALL_QUALITY_LEVELS.OK);
|
|
3006
|
+
}
|
|
3007
|
+
const getActiveIssues = (allIssues, issuesToCheck = []) => Object.keys(allIssues).reduce((issuesAcc, issueKey) => {
|
|
3008
|
+
const issue = allIssues[issueKey];
|
|
3009
|
+
if (!issue)
|
|
3010
|
+
return issuesAcc;
|
|
3011
|
+
if (issuesToCheck.includes(issueKey) && issue.active && issue.registered > 2) {
|
|
3012
|
+
return [...issuesAcc, issueKey];
|
|
3013
|
+
}
|
|
3014
|
+
return issuesAcc;
|
|
3015
|
+
}, []);
|
|
3016
|
+
const addMetricsQualifier = (issuesToCheck, isLocalClient = false) => issuesToCheck.map((issue) => `${isLocalClient ? "loc" : "rem"}-${issue}`);
|
|
3017
|
+
function calculateCallQualityScore(clientId, roomMode, mediaQualityScores, connectionMonitorIssuesReport) {
|
|
3018
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3;
|
|
3019
|
+
const videoScoreValue = Math.min(...(roomMode === "normal"
|
|
3020
|
+
? [
|
|
3021
|
+
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
|
+
((_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
|
+
? CALL_QUALITY_LEVELS.CRITICAL
|
|
3024
|
+
: CALL_QUALITY_LEVELS.OK),
|
|
3025
|
+
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
|
+
((_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
|
+
? CALL_QUALITY_LEVELS.WARNING
|
|
3028
|
+
: CALL_QUALITY_LEVELS.OK),
|
|
3029
|
+
]
|
|
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 : CALL_QUALITY_LEVELS.OK)]));
|
|
3031
|
+
const audioScoreValue = Math.min(...(roomMode === "normal"
|
|
3032
|
+
? [
|
|
3033
|
+
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
|
+
((_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
|
+
? CALL_QUALITY_LEVELS.CRITICAL
|
|
3036
|
+
: CALL_QUALITY_LEVELS.OK),
|
|
3037
|
+
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
|
+
((_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
|
+
? CALL_QUALITY_LEVELS.WARNING
|
|
3040
|
+
: CALL_QUALITY_LEVELS.OK),
|
|
3041
|
+
]
|
|
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 : CALL_QUALITY_LEVELS.OK)]));
|
|
3043
|
+
const overallScoreValue = Math.min(videoScoreValue, audioScoreValue);
|
|
3044
|
+
return {
|
|
3045
|
+
total: CALL_QUALITY_LEVEL_ORDER[overallScoreValue],
|
|
3046
|
+
video: CALL_QUALITY_LEVEL_ORDER[videoScoreValue],
|
|
3047
|
+
audio: CALL_QUALITY_LEVEL_ORDER[audioScoreValue],
|
|
3048
|
+
};
|
|
3049
|
+
}
|
|
2992
3050
|
const connectionMonitorSliceInitialState = {
|
|
2993
3051
|
running: false,
|
|
3052
|
+
issuesReport: undefined,
|
|
3053
|
+
remoteQualityScores: undefined,
|
|
3054
|
+
localQualityScore: undefined,
|
|
3055
|
+
mediaScores: undefined,
|
|
2994
3056
|
};
|
|
2995
3057
|
const connectionMonitorSlice = toolkit.createSlice({
|
|
2996
3058
|
name: "connectionMonitor",
|
|
@@ -2999,12 +3061,27 @@ const connectionMonitorSlice = toolkit.createSlice({
|
|
|
2999
3061
|
connectionMonitorStarted: (state, action) => {
|
|
3000
3062
|
return Object.assign(Object.assign({}, state), { running: true, stopCallbackFunction: action.payload.stopIssueSubscription });
|
|
3001
3063
|
},
|
|
3064
|
+
connectionMonitorReportUpdated: (state, action) => {
|
|
3065
|
+
return Object.assign(Object.assign({}, state), { issuesReport: action.payload });
|
|
3066
|
+
},
|
|
3067
|
+
updateRemoteCallQualityScores: (state, action) => {
|
|
3068
|
+
return Object.assign(Object.assign({}, state), { remoteQualityScores: action.payload });
|
|
3069
|
+
},
|
|
3070
|
+
updateLocalCallQualityScore: (state, action) => {
|
|
3071
|
+
return Object.assign(Object.assign({}, state), { localQualityScore: action.payload });
|
|
3072
|
+
},
|
|
3002
3073
|
connectionMonitorStopped: () => {
|
|
3003
3074
|
return Object.assign({}, connectionMonitorSliceInitialState);
|
|
3004
3075
|
},
|
|
3005
3076
|
},
|
|
3077
|
+
extraReducers: (builder) => {
|
|
3078
|
+
builder.addCase(rtcEvents.mediaQualityChanged, (state, action) => {
|
|
3079
|
+
var _a;
|
|
3080
|
+
return Object.assign(Object.assign({}, state), { mediaScores: Object.assign(Object.assign({}, state.mediaScores), { [action.payload.clientId]: Object.assign(Object.assign({}, (((_a = state.mediaScores) === null || _a === void 0 ? void 0 : _a[action.payload.clientId]) || {})), { [action.payload.kind]: action.payload.quality }) }) });
|
|
3081
|
+
});
|
|
3082
|
+
},
|
|
3006
3083
|
});
|
|
3007
|
-
const { connectionMonitorStarted, connectionMonitorStopped } = connectionMonitorSlice.actions;
|
|
3084
|
+
const { connectionMonitorStarted, connectionMonitorStopped, connectionMonitorReportUpdated, updateRemoteCallQualityScores, updateLocalCallQualityScore, } = connectionMonitorSlice.actions;
|
|
3008
3085
|
const doStartConnectionMonitor = createAppThunk(() => (dispatch, getState) => {
|
|
3009
3086
|
media.setClientProvider(() => {
|
|
3010
3087
|
const state = getState();
|
|
@@ -3029,8 +3106,52 @@ const doStartConnectionMonitor = createAppThunk(() => (dispatch, getState) => {
|
|
|
3029
3106
|
return clientViews;
|
|
3030
3107
|
});
|
|
3031
3108
|
const issueMonitorSubscription = media.subscribeIssues({
|
|
3032
|
-
onUpdatedIssues: (issuesAndMetricsByClients) => {
|
|
3109
|
+
onUpdatedIssues: (issuesAndMetricsByClients, _, clients) => {
|
|
3033
3110
|
var _a;
|
|
3111
|
+
const clientsWithCriticalIssues = clients.reduce((acc, { clientId, isLocalClient }) => {
|
|
3112
|
+
const { issues } = issuesAndMetricsByClients[clientId] || { issues: {} };
|
|
3113
|
+
const criticalVideoIssues = getActiveIssues(issues, addMetricsQualifier(["cam-video-extreme-packetloss", "pres-video-extreme-packetloss"], isLocalClient));
|
|
3114
|
+
const criticalAudioIssues = getActiveIssues(issues, addMetricsQualifier(["cam-audio-extreme-packetloss"], isLocalClient));
|
|
3115
|
+
const criticalCpuIssues = getActiveIssues(issues, ["global-cpu-pressure-critical"]);
|
|
3116
|
+
if (criticalVideoIssues.length === 0 &&
|
|
3117
|
+
criticalAudioIssues.length === 0 &&
|
|
3118
|
+
criticalCpuIssues.length === 0) {
|
|
3119
|
+
return acc;
|
|
3120
|
+
}
|
|
3121
|
+
return Object.assign(Object.assign({}, acc), { [clientId]: {
|
|
3122
|
+
video: criticalVideoIssues,
|
|
3123
|
+
audio: criticalAudioIssues,
|
|
3124
|
+
cpu: criticalCpuIssues,
|
|
3125
|
+
} });
|
|
3126
|
+
}, {});
|
|
3127
|
+
const clientsWithWarningIssues = clients.reduce((acc, { clientId, isLocalClient }) => {
|
|
3128
|
+
const { issues } = issuesAndMetricsByClients[clientId] || { issues: {} };
|
|
3129
|
+
const warningVideoIssues = getActiveIssues(issues, addMetricsQualifier([
|
|
3130
|
+
"cam-video-bad-network",
|
|
3131
|
+
"pres-video-bad-network",
|
|
3132
|
+
"cam-video-high-packetloss",
|
|
3133
|
+
"pres-video-high-packetloss",
|
|
3134
|
+
"cam-video-low-layer0-bitrate",
|
|
3135
|
+
"pres-video-low-layer0-bitrate",
|
|
3136
|
+
], isLocalClient));
|
|
3137
|
+
const warningAudioIssues = getActiveIssues(issues, addMetricsQualifier(["cam-audio-bad-network", "cam-audio-high-packetloss", "cam-audio-distorted"], isLocalClient));
|
|
3138
|
+
const warningCpuIssues = getActiveIssues(issues, ["global-cpu-pressure-serious"]);
|
|
3139
|
+
if (warningVideoIssues.length === 0 &&
|
|
3140
|
+
warningAudioIssues.length === 0 &&
|
|
3141
|
+
warningCpuIssues.length === 0) {
|
|
3142
|
+
return acc;
|
|
3143
|
+
}
|
|
3144
|
+
return Object.assign(Object.assign({}, acc), { [clientId]: {
|
|
3145
|
+
video: warningVideoIssues,
|
|
3146
|
+
audio: warningAudioIssues,
|
|
3147
|
+
cpu: warningCpuIssues,
|
|
3148
|
+
} });
|
|
3149
|
+
}, {});
|
|
3150
|
+
const newConnectionMonitorReport = {
|
|
3151
|
+
critical: clientsWithCriticalIssues,
|
|
3152
|
+
warning: clientsWithWarningIssues,
|
|
3153
|
+
};
|
|
3154
|
+
dispatch(doUpdateConnectionMonitorReport(newConnectionMonitorReport));
|
|
3034
3155
|
const state = getState();
|
|
3035
3156
|
const rtcManager = selectRtcManager(state);
|
|
3036
3157
|
if (!rtcManager) {
|
|
@@ -3062,6 +3183,85 @@ const doStartConnectionMonitor = createAppThunk(() => (dispatch, getState) => {
|
|
|
3062
3183
|
});
|
|
3063
3184
|
dispatch(connectionMonitorStarted({ stopIssueSubscription: issueMonitorSubscription.stop }));
|
|
3064
3185
|
});
|
|
3186
|
+
const doUpdateConnectionMonitorReport = createAppThunk((newConnectionMonitorReport) => (dispatch, getState) => {
|
|
3187
|
+
const state = getState();
|
|
3188
|
+
const rtcManager = selectRtcManager(state);
|
|
3189
|
+
if (!rtcManager) {
|
|
3190
|
+
return;
|
|
3191
|
+
}
|
|
3192
|
+
const oldConnectionMonitorReport = selectConnectionMonitorIssuesReport(state);
|
|
3193
|
+
if (JSON.stringify(newConnectionMonitorReport) === JSON.stringify(oldConnectionMonitorReport)) {
|
|
3194
|
+
return;
|
|
3195
|
+
}
|
|
3196
|
+
dispatch(connectionMonitorReportUpdated(newConnectionMonitorReport));
|
|
3197
|
+
const localClientId = selectSelfId(state);
|
|
3198
|
+
const updatedClientStates = {};
|
|
3199
|
+
["critical", "warning"].forEach((level) => {
|
|
3200
|
+
Object.keys(newConnectionMonitorReport[level] || {})
|
|
3201
|
+
.filter((clientId) => {
|
|
3202
|
+
var _a, _b, _c, _d, _e, _f;
|
|
3203
|
+
const isLocalClientId = clientId === localClientId;
|
|
3204
|
+
return (((_c = (_b = (_a = newConnectionMonitorReport === null || newConnectionMonitorReport === void 0 ? void 0 : newConnectionMonitorReport[level]) === null || _a === void 0 ? void 0 : _a[clientId]) === null || _b === void 0 ? void 0 : _b.video) === null || _c === void 0 ? void 0 : _c.includes(addMetricsQualifier(["cam-video-bad-network"], isLocalClientId)[0])) ||
|
|
3205
|
+
((_f = (_e = (_d = newConnectionMonitorReport === null || newConnectionMonitorReport === void 0 ? void 0 : newConnectionMonitorReport[level]) === null || _d === void 0 ? void 0 : _d[clientId]) === null || _e === void 0 ? void 0 : _e.audio) === null || _f === void 0 ? void 0 : _f.includes(addMetricsQualifier(["cam-audio-bad-network"], isLocalClientId)[0])));
|
|
3206
|
+
})
|
|
3207
|
+
.forEach((newClientId) => {
|
|
3208
|
+
const oldClient = Object.keys((oldConnectionMonitorReport === null || oldConnectionMonitorReport === void 0 ? void 0 : oldConnectionMonitorReport[level]) || {}).find((oldClientId) => oldClientId === newClientId);
|
|
3209
|
+
if (!oldClient)
|
|
3210
|
+
updatedClientStates[newClientId] = { badNetwork: true };
|
|
3211
|
+
});
|
|
3212
|
+
Object.keys((oldConnectionMonitorReport === null || oldConnectionMonitorReport === void 0 ? void 0 : oldConnectionMonitorReport[level]) || {})
|
|
3213
|
+
.filter((clientId) => {
|
|
3214
|
+
var _a, _b, _c, _d, _e, _f;
|
|
3215
|
+
const isLocalClientId = clientId === localClientId;
|
|
3216
|
+
return (((_c = (_b = (_a = oldConnectionMonitorReport === null || oldConnectionMonitorReport === void 0 ? void 0 : oldConnectionMonitorReport[level]) === null || _a === void 0 ? void 0 : _a[clientId]) === null || _b === void 0 ? void 0 : _b.video) === null || _c === void 0 ? void 0 : _c.includes(addMetricsQualifier(["cam-video-bad-network"], isLocalClientId)[0])) ||
|
|
3217
|
+
((_f = (_e = (_d = oldConnectionMonitorReport === null || oldConnectionMonitorReport === void 0 ? void 0 : oldConnectionMonitorReport[level]) === null || _d === void 0 ? void 0 : _d[clientId]) === null || _e === void 0 ? void 0 : _e.audio) === null || _f === void 0 ? void 0 : _f.includes(addMetricsQualifier(["cam-audio-bad-network"], isLocalClientId)[0])));
|
|
3218
|
+
})
|
|
3219
|
+
.forEach((oldClientId) => {
|
|
3220
|
+
const newClient = Object.keys(newConnectionMonitorReport[level]).find((newClientId) => newClientId === oldClientId);
|
|
3221
|
+
if (!newClient)
|
|
3222
|
+
updatedClientStates[oldClientId] = { badNetwork: false };
|
|
3223
|
+
});
|
|
3224
|
+
});
|
|
3225
|
+
if (Object.keys(updatedClientStates).length > 0) {
|
|
3226
|
+
rtcManager.sendStatsCustomEvent("clientStates", {
|
|
3227
|
+
updatesByClientId: updatedClientStates,
|
|
3228
|
+
_time: Date.now(),
|
|
3229
|
+
});
|
|
3230
|
+
}
|
|
3231
|
+
});
|
|
3232
|
+
const doSetRemoteCallQualityScores = createAppThunk((scores) => (dispatch, getState) => {
|
|
3233
|
+
const state = getState();
|
|
3234
|
+
const rtcManager = selectRtcManager(state);
|
|
3235
|
+
if (!rtcManager) {
|
|
3236
|
+
return;
|
|
3237
|
+
}
|
|
3238
|
+
const scoreValues = Object.values(scores);
|
|
3239
|
+
const total = scoreValues.some(({ total }) => total === CALL_QUALITY_LEVELS.CRITICAL)
|
|
3240
|
+
? CALL_QUALITY_LEVELS.CRITICAL
|
|
3241
|
+
: scoreValues.some(({ total }) => total === CALL_QUALITY_LEVELS.WARNING)
|
|
3242
|
+
? CALL_QUALITY_LEVELS.WARNING
|
|
3243
|
+
: CALL_QUALITY_LEVELS.OK;
|
|
3244
|
+
rtcManager.sendStatsCustomEvent("remoteCallQualityScores", {
|
|
3245
|
+
total,
|
|
3246
|
+
_time: Date.now(),
|
|
3247
|
+
});
|
|
3248
|
+
dispatch(updateRemoteCallQualityScores(scores));
|
|
3249
|
+
});
|
|
3250
|
+
const doSetLocalCallQualityScore = createAppThunk((score) => (dispatch, getState) => {
|
|
3251
|
+
const state = getState();
|
|
3252
|
+
const rtcManager = selectRtcManager(state);
|
|
3253
|
+
if (!rtcManager) {
|
|
3254
|
+
return;
|
|
3255
|
+
}
|
|
3256
|
+
const oldLocalCallQualityScore = selectLocalCallQualityScore(state);
|
|
3257
|
+
if (score.total !== (oldLocalCallQualityScore === null || oldLocalCallQualityScore === void 0 ? void 0 : oldLocalCallQualityScore.total)) {
|
|
3258
|
+
rtcManager.sendStatsCustomEvent("callQualityScoreTotalChanged", {
|
|
3259
|
+
total: score.total,
|
|
3260
|
+
_time: Date.now(),
|
|
3261
|
+
});
|
|
3262
|
+
}
|
|
3263
|
+
dispatch(updateLocalCallQualityScore(score));
|
|
3264
|
+
});
|
|
3065
3265
|
const doStopConnectionMonitor = createAppThunk(() => (dispatch, getState) => {
|
|
3066
3266
|
const state = getState();
|
|
3067
3267
|
const stopCallbackFn = selectStopCallbackFunction(state);
|
|
@@ -3072,6 +3272,16 @@ const doStopConnectionMonitor = createAppThunk(() => (dispatch, getState) => {
|
|
|
3072
3272
|
});
|
|
3073
3273
|
const selectConnectionMonitorIsRunning = (state) => state.connectionMonitor.running;
|
|
3074
3274
|
const selectStopCallbackFunction = (state) => state.connectionMonitor.stopCallbackFunction;
|
|
3275
|
+
const selectConnectionMonitorIssuesReport = (state) => state.connectionMonitor.issuesReport;
|
|
3276
|
+
const selectConnectionMediaQualityScores = (state) => state.connectionMonitor.mediaScores;
|
|
3277
|
+
const selectRemoteCallQualityScores = (state) => state.connectionMonitor.remoteQualityScores;
|
|
3278
|
+
const selectLocalCallQualityScore = (state) => state.connectionMonitor.localQualityScore;
|
|
3279
|
+
const selectRemoteParticipantQualityReport = toolkit.createSelector(selectRemoteCallQualityScores, (remoteCallQualityScores) => {
|
|
3280
|
+
if (!remoteCallQualityScores) {
|
|
3281
|
+
return undefined;
|
|
3282
|
+
}
|
|
3283
|
+
return Object.fromEntries(Object.entries(remoteCallQualityScores).map(([clientId, { total }]) => [clientId, { quality: total }]));
|
|
3284
|
+
});
|
|
3075
3285
|
const selectShouldStartConnectionMonitor = toolkit.createSelector(selectRoomConnectionStatus, selectConnectionMonitorIsRunning, (roomConnectionStatus, isRunning) => {
|
|
3076
3286
|
if (!isRunning && roomConnectionStatus === "connected") {
|
|
3077
3287
|
return true;
|
|
@@ -3084,6 +3294,23 @@ const selectShouldStopConnectionMonitor = toolkit.createSelector(selectRoomConne
|
|
|
3084
3294
|
}
|
|
3085
3295
|
return false;
|
|
3086
3296
|
});
|
|
3297
|
+
const selectCalculatedRemoteCallQualityScores = toolkit.createSelector(selectRoomConnectionStatus, selectRoomMode, selectRemoteClientViews, selectConnectionMediaQualityScores, selectConnectionMonitorIssuesReport, (roomConnectionStatus, roomMode, remoteClientViews, mediaQualityScores, connectionMonitorIssuesReport) => {
|
|
3298
|
+
if (roomConnectionStatus !== "connected") {
|
|
3299
|
+
return undefined;
|
|
3300
|
+
}
|
|
3301
|
+
return Object.fromEntries(remoteClientViews
|
|
3302
|
+
.filter(({ isLocalClient }) => !isLocalClient)
|
|
3303
|
+
.map(({ clientId }) => [
|
|
3304
|
+
clientId,
|
|
3305
|
+
calculateCallQualityScore(clientId, roomMode, mediaQualityScores, connectionMonitorIssuesReport),
|
|
3306
|
+
]));
|
|
3307
|
+
});
|
|
3308
|
+
const selectCalculatedLocalCallQualityScore = toolkit.createSelector(selectRoomConnectionStatus, selectRoomMode, selectLocalParticipantView, selectConnectionMediaQualityScores, selectConnectionMonitorIssuesReport, (roomConnectionStatus, roomMode, localParticipantView, mediaQualityScores, connectionMonitorIssuesReport) => {
|
|
3309
|
+
if (roomConnectionStatus !== "connected" || !localParticipantView) {
|
|
3310
|
+
return undefined;
|
|
3311
|
+
}
|
|
3312
|
+
return calculateCallQualityScore(localParticipantView.clientId, roomMode, mediaQualityScores, connectionMonitorIssuesReport);
|
|
3313
|
+
});
|
|
3087
3314
|
createReactor([selectShouldStartConnectionMonitor], ({ dispatch }, shouldStartConnectionMonitor) => {
|
|
3088
3315
|
if (shouldStartConnectionMonitor) {
|
|
3089
3316
|
dispatch(doStartConnectionMonitor());
|
|
@@ -3094,6 +3321,24 @@ createReactor([selectShouldStopConnectionMonitor], ({ dispatch }, shouldStartCon
|
|
|
3094
3321
|
dispatch(doStopConnectionMonitor());
|
|
3095
3322
|
}
|
|
3096
3323
|
});
|
|
3324
|
+
createReactor([selectCalculatedRemoteCallQualityScores, selectRemoteCallQualityScores], ({ dispatch }, newRemoteCallQualityScores, oldRemoteCallQualityScores) => {
|
|
3325
|
+
if (!newRemoteCallQualityScores) {
|
|
3326
|
+
return;
|
|
3327
|
+
}
|
|
3328
|
+
if (oldRemoteCallQualityScores &&
|
|
3329
|
+
JSON.stringify(newRemoteCallQualityScores) === JSON.stringify(oldRemoteCallQualityScores))
|
|
3330
|
+
return;
|
|
3331
|
+
dispatch(doSetRemoteCallQualityScores(newRemoteCallQualityScores));
|
|
3332
|
+
});
|
|
3333
|
+
createReactor([selectCalculatedLocalCallQualityScore, selectLocalCallQualityScore], ({ dispatch }, newLocalCallQualityScore, oldLocalCallQualityScore) => {
|
|
3334
|
+
if (!newLocalCallQualityScore) {
|
|
3335
|
+
return;
|
|
3336
|
+
}
|
|
3337
|
+
if (oldLocalCallQualityScore &&
|
|
3338
|
+
JSON.stringify(newLocalCallQualityScore) === JSON.stringify(oldLocalCallQualityScore))
|
|
3339
|
+
return;
|
|
3340
|
+
dispatch(doSetLocalCallQualityScore(newLocalCallQualityScore));
|
|
3341
|
+
});
|
|
3097
3342
|
|
|
3098
3343
|
const MAX_FILES_PER_UPLOAD = 10;
|
|
3099
3344
|
const MAX_FILE_SIZE = 15 * 1024 * 1024;
|
|
@@ -5363,6 +5608,7 @@ function createServices() {
|
|
|
5363
5608
|
exports.ACCEPTED_FILE_TYPES = ACCEPTED_FILE_TYPES;
|
|
5364
5609
|
exports.BREAKOUT_GROUPS_MIN_MAX = BREAKOUT_GROUPS_MIN_MAX;
|
|
5365
5610
|
exports.BREAKOUT_UNAVAILABLE_ERROR = BREAKOUT_UNAVAILABLE_ERROR;
|
|
5611
|
+
exports.CALL_QUALITY_LEVELS = CALL_QUALITY_LEVELS;
|
|
5366
5612
|
exports.DEFAULT_BREAKOUT_TIMER_DURATION = DEFAULT_BREAKOUT_TIMER_DURATION;
|
|
5367
5613
|
exports.MAX_FILES_PER_UPLOAD = MAX_FILES_PER_UPLOAD;
|
|
5368
5614
|
exports.MAX_FILE_SIZE = MAX_FILE_SIZE;
|
|
@@ -5381,6 +5627,7 @@ exports.chatSliceInitialState = chatSliceInitialState;
|
|
|
5381
5627
|
exports.clearCaption = clearCaption;
|
|
5382
5628
|
exports.clearFileUploads = clearFileUploads;
|
|
5383
5629
|
exports.cloudRecordingSlice = cloudRecordingSlice;
|
|
5630
|
+
exports.connectionMonitorReportUpdated = connectionMonitorReportUpdated;
|
|
5384
5631
|
exports.connectionMonitorSlice = connectionMonitorSlice;
|
|
5385
5632
|
exports.connectionMonitorSliceInitialState = connectionMonitorSliceInitialState;
|
|
5386
5633
|
exports.connectionMonitorStarted = connectionMonitorStarted;
|
|
@@ -5446,8 +5693,10 @@ exports.doSendClientMetadata = doSendClientMetadata;
|
|
|
5446
5693
|
exports.doSendFiles = doSendFiles;
|
|
5447
5694
|
exports.doSetDevice = doSetDevice;
|
|
5448
5695
|
exports.doSetDisplayName = doSetDisplayName;
|
|
5696
|
+
exports.doSetLocalCallQualityScore = doSetLocalCallQualityScore;
|
|
5449
5697
|
exports.doSetLocalStickyReaction = doSetLocalStickyReaction;
|
|
5450
5698
|
exports.doSetNotification = doSetNotification;
|
|
5699
|
+
exports.doSetRemoteCallQualityScores = doSetRemoteCallQualityScores;
|
|
5451
5700
|
exports.doShuffleBreakoutParticipants = doShuffleBreakoutParticipants;
|
|
5452
5701
|
exports.doSignalConnect = doSignalConnect;
|
|
5453
5702
|
exports.doSignalDisconnect = doSignalDisconnect;
|
|
@@ -5476,6 +5725,7 @@ exports.doToggleCamera = doToggleCamera;
|
|
|
5476
5725
|
exports.doTriggerLocalStreamRefresh = doTriggerLocalStreamRefresh;
|
|
5477
5726
|
exports.doUnassignAllBreakoutParticipants = doUnassignAllBreakoutParticipants;
|
|
5478
5727
|
exports.doUpdateBreakoutSession = doUpdateBreakoutSession;
|
|
5728
|
+
exports.doUpdateConnectionMonitorReport = doUpdateConnectionMonitorReport;
|
|
5479
5729
|
exports.doUpdateDeviceList = doUpdateDeviceList;
|
|
5480
5730
|
exports.doUpdateRoomIntegrationProps = doUpdateRoomIntegrationProps;
|
|
5481
5731
|
exports.fileShareRequestSettled = fileShareRequestSettled;
|
|
@@ -5578,6 +5828,8 @@ exports.selectBreakoutStartedAt = selectBreakoutStartedAt;
|
|
|
5578
5828
|
exports.selectBreakoutTimerDuration = selectBreakoutTimerDuration;
|
|
5579
5829
|
exports.selectBreakoutTimerSetting = selectBreakoutTimerSetting;
|
|
5580
5830
|
exports.selectBusyDeviceIds = selectBusyDeviceIds;
|
|
5831
|
+
exports.selectCalculatedLocalCallQualityScore = selectCalculatedLocalCallQualityScore;
|
|
5832
|
+
exports.selectCalculatedRemoteCallQualityScores = selectCalculatedRemoteCallQualityScores;
|
|
5581
5833
|
exports.selectCameraDeviceError = selectCameraDeviceError;
|
|
5582
5834
|
exports.selectCameraDevices = selectCameraDevices;
|
|
5583
5835
|
exports.selectChatMessages = selectChatMessages;
|
|
@@ -5587,7 +5839,9 @@ exports.selectCloudRecordingIsInitiator = selectCloudRecordingIsInitiator;
|
|
|
5587
5839
|
exports.selectCloudRecordingRaw = selectCloudRecordingRaw;
|
|
5588
5840
|
exports.selectCloudRecordingStartedAt = selectCloudRecordingStartedAt;
|
|
5589
5841
|
exports.selectCloudRecordingStatus = selectCloudRecordingStatus;
|
|
5842
|
+
exports.selectConnectionMediaQualityScores = selectConnectionMediaQualityScores;
|
|
5590
5843
|
exports.selectConnectionMonitorIsRunning = selectConnectionMonitorIsRunning;
|
|
5844
|
+
exports.selectConnectionMonitorIssuesReport = selectConnectionMonitorIssuesReport;
|
|
5591
5845
|
exports.selectCurrentCameraDeviceId = selectCurrentCameraDeviceId;
|
|
5592
5846
|
exports.selectCurrentMicrophoneDeviceId = selectCurrentMicrophoneDeviceId;
|
|
5593
5847
|
exports.selectCurrentSpeakerDeviceId = selectCurrentSpeakerDeviceId;
|
|
@@ -5635,6 +5889,7 @@ exports.selectLiveTranscriptionIsInitiator = selectLiveTranscriptionIsInitiator;
|
|
|
5635
5889
|
exports.selectLiveTranscriptionRaw = selectLiveTranscriptionRaw;
|
|
5636
5890
|
exports.selectLiveTranscriptionStartedAt = selectLiveTranscriptionStartedAt;
|
|
5637
5891
|
exports.selectLiveTranscriptionStatus = selectLiveTranscriptionStatus;
|
|
5892
|
+
exports.selectLocalCallQualityScore = selectLocalCallQualityScore;
|
|
5638
5893
|
exports.selectLocalMediaBeforeEffectTracks = selectLocalMediaBeforeEffectTracks;
|
|
5639
5894
|
exports.selectLocalMediaConstraintsOptions = selectLocalMediaConstraintsOptions;
|
|
5640
5895
|
exports.selectLocalMediaDevices = selectLocalMediaDevices;
|
|
@@ -5669,8 +5924,10 @@ exports.selectNumParticipants = selectNumParticipants;
|
|
|
5669
5924
|
exports.selectOrganizationId = selectOrganizationId;
|
|
5670
5925
|
exports.selectOrganizationPreferences = selectOrganizationPreferences;
|
|
5671
5926
|
exports.selectOrganizationRaw = selectOrganizationRaw;
|
|
5927
|
+
exports.selectRemoteCallQualityScores = selectRemoteCallQualityScores;
|
|
5672
5928
|
exports.selectRemoteClientViews = selectRemoteClientViews;
|
|
5673
5929
|
exports.selectRemoteClients = selectRemoteClients;
|
|
5930
|
+
exports.selectRemoteParticipantQualityReport = selectRemoteParticipantQualityReport;
|
|
5674
5931
|
exports.selectRemoteParticipants = selectRemoteParticipants;
|
|
5675
5932
|
exports.selectRemoteParticipantsRaw = selectRemoteParticipantsRaw;
|
|
5676
5933
|
exports.selectRemoteScreenshareVideoTrackIds = selectRemoteScreenshareVideoTrackIds;
|
|
@@ -5757,6 +6014,8 @@ exports.toggleLowDataModeEnabled = toggleLowDataModeEnabled;
|
|
|
5757
6014
|
exports.toggleMicrophoneEnabled = toggleMicrophoneEnabled;
|
|
5758
6015
|
exports.toggleWidescreenModeEnabled = toggleWidescreenModeEnabled;
|
|
5759
6016
|
exports.transcribingRequestStarted = transcribingRequestStarted;
|
|
6017
|
+
exports.updateLocalCallQualityScore = updateLocalCallQualityScore;
|
|
6018
|
+
exports.updateRemoteCallQualityScores = updateRemoteCallQualityScores;
|
|
5760
6019
|
exports.updateReportedValues = updateReportedValues;
|
|
5761
6020
|
exports.waitingParticipantsSlice = waitingParticipantsSlice;
|
|
5762
6021
|
exports.waitingParticipantsSliceInitialState = waitingParticipantsSliceInitialState;
|