@whereby.com/core 1.24.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 +568 -253
- package/dist/index.d.cts +56 -2
- package/dist/index.d.mts +56 -2
- package/dist/index.d.ts +56 -2
- package/dist/index.mjs +567 -254
- package/dist/legacy-esm.js +567 -254
- package/dist/redux/index.cjs +559 -256
- package/dist/redux/index.d.cts +463 -21
- package/dist/redux/index.d.mts +463 -21
- package/dist/redux/index.d.ts +463 -21
- package/dist/redux/index.js +544 -257
- package/dist/redux/index.mjs +544 -257
- package/package.json +5 -5
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.26.0";
|
|
1312
1312
|
|
|
1313
1313
|
function decodeRoomName(roomName) {
|
|
1314
1314
|
if (!roomName) {
|
|
@@ -1362,6 +1362,12 @@ const selectAppIsNodeSdk = (state) => state.app.isNodeSdk;
|
|
|
1362
1362
|
const selectAppInitialMuteStates = (state) => state.app.initialMuteStates;
|
|
1363
1363
|
const selectAppIgnoreBreakoutGroups = (state) => state.app.ignoreBreakoutGroups;
|
|
1364
1364
|
|
|
1365
|
+
const NON_RECONNECTING_DISCONNECT_REASONS = ["io server disconnect", "io client disconnect"];
|
|
1366
|
+
function createSignalDisconnectEvent(reason) {
|
|
1367
|
+
return {
|
|
1368
|
+
willReconnect: !!reason && !NON_RECONNECTING_DISCONNECT_REASONS.includes(reason),
|
|
1369
|
+
};
|
|
1370
|
+
}
|
|
1365
1371
|
function createSignalEventAction(name) {
|
|
1366
1372
|
return createAction(`signalConnection/event/${name}`);
|
|
1367
1373
|
}
|
|
@@ -1579,7 +1585,7 @@ function forwardSocketEvents(socket, dispatch) {
|
|
|
1579
1585
|
dispatch(signalEvents.chatMessage(payload));
|
|
1580
1586
|
});
|
|
1581
1587
|
socket.on("chat_message_removed", (payload) => dispatch(signalEvents.chatMessageRemoved(payload)));
|
|
1582
|
-
socket.on("disconnect", () => dispatch(signalEvents.disconnect()));
|
|
1588
|
+
socket.on("disconnect", (reason) => dispatch(signalEvents.disconnect(createSignalDisconnectEvent(reason))));
|
|
1583
1589
|
socket.on("room_knocked", (payload) => dispatch(signalEvents.roomKnocked(payload)));
|
|
1584
1590
|
socket.on("room_left", () => dispatch(signalEvents.roomLeft()));
|
|
1585
1591
|
socket.on("room_locked", (payload) => dispatch(signalEvents.roomLocked(payload)));
|
|
@@ -2336,6 +2342,7 @@ const rtcEvents = {
|
|
|
2336
2342
|
rtcManagerDestroyed: createRtcEventAction("rtcManagerDestroyed"),
|
|
2337
2343
|
streamAdded: createRtcEventAction("streamAdded"),
|
|
2338
2344
|
clientConnectionStatusChanged: createRtcEventAction("clientConnectionStatusChanged"),
|
|
2345
|
+
mediaQualityChanged: createRtcEventAction("mediaQualityChanged"),
|
|
2339
2346
|
};
|
|
2340
2347
|
|
|
2341
2348
|
function createRemoteParticipant(client, newJoiner = false) {
|
|
@@ -2556,6 +2563,271 @@ const selectRoomConnectionSessionId = (state) => { var _a; return (_a = state.ro
|
|
|
2556
2563
|
const selectRoomConnectionStatus = (state) => state.roomConnection.status;
|
|
2557
2564
|
const selectRoomConnectionError = (state) => state.roomConnection.error;
|
|
2558
2565
|
const selectRoomConnectionKnockResponse = (state) => state.roomConnection.knockResponse;
|
|
2566
|
+
const selectRoomConnectionIsRejoining = (state) => state.roomConnection.isRejoining;
|
|
2567
|
+
|
|
2568
|
+
const organizationSliceInitialState = {
|
|
2569
|
+
data: null,
|
|
2570
|
+
isFetching: false,
|
|
2571
|
+
error: null,
|
|
2572
|
+
};
|
|
2573
|
+
const organizationSlice = createSlice({
|
|
2574
|
+
name: "organization",
|
|
2575
|
+
initialState: organizationSliceInitialState,
|
|
2576
|
+
reducers: {},
|
|
2577
|
+
extraReducers: (builder) => {
|
|
2578
|
+
builder.addCase(doOrganizationFetch.pending, (state) => {
|
|
2579
|
+
return Object.assign(Object.assign({}, state), { isFetching: true });
|
|
2580
|
+
});
|
|
2581
|
+
builder.addCase(doOrganizationFetch.fulfilled, (state, action) => {
|
|
2582
|
+
if (!action.payload)
|
|
2583
|
+
return Object.assign(Object.assign({}, state), { isFetching: true });
|
|
2584
|
+
return Object.assign(Object.assign({}, state), { isFetching: false, data: action.payload });
|
|
2585
|
+
});
|
|
2586
|
+
builder.addCase(doOrganizationFetch.rejected, (state) => {
|
|
2587
|
+
return Object.assign(Object.assign({}, state), { isFetching: false, error: true });
|
|
2588
|
+
});
|
|
2589
|
+
},
|
|
2590
|
+
});
|
|
2591
|
+
const doOrganizationFetch = createAppAsyncThunk("organization/doOrganizationFetch", (_1, _a) => __awaiter(void 0, [_1, _a], void 0, function* (_, { extra, getState }) {
|
|
2592
|
+
try {
|
|
2593
|
+
const roomUrl = selectAppRoomUrl(getState());
|
|
2594
|
+
const organization = yield extra.services.fetchOrganizationFromRoomUrl(roomUrl || "");
|
|
2595
|
+
if (!organization) {
|
|
2596
|
+
throw new Error("Invalid room url");
|
|
2597
|
+
}
|
|
2598
|
+
return organization;
|
|
2599
|
+
}
|
|
2600
|
+
catch (error) {
|
|
2601
|
+
console.error(error);
|
|
2602
|
+
}
|
|
2603
|
+
}));
|
|
2604
|
+
const selectOrganizationRaw = (state) => state.organization;
|
|
2605
|
+
const selectOrganizationId = (state) => { var _a; return (_a = state.organization.data) === null || _a === void 0 ? void 0 : _a.organizationId; };
|
|
2606
|
+
const selectOrganizationPreferences = (state) => { var _a; return (_a = state.organization.data) === null || _a === void 0 ? void 0 : _a.preferences; };
|
|
2607
|
+
const selectShouldFetchOrganization = createSelector(selectAppIsActive, selectOrganizationRaw, selectDeviceCredentialsRaw, (appIsActive, organization, deviceCredentials) => {
|
|
2608
|
+
if (appIsActive &&
|
|
2609
|
+
!organization.data &&
|
|
2610
|
+
!organization.isFetching &&
|
|
2611
|
+
!organization.error &&
|
|
2612
|
+
!deviceCredentials.isFetching) {
|
|
2613
|
+
return true;
|
|
2614
|
+
}
|
|
2615
|
+
return false;
|
|
2616
|
+
});
|
|
2617
|
+
createReactor([selectShouldFetchOrganization], ({ dispatch }, shouldFetchOrganization) => {
|
|
2618
|
+
if (shouldFetchOrganization) {
|
|
2619
|
+
dispatch(doOrganizationFetch());
|
|
2620
|
+
}
|
|
2621
|
+
});
|
|
2622
|
+
|
|
2623
|
+
const roomConnectionSliceInitialState = {
|
|
2624
|
+
session: null,
|
|
2625
|
+
status: "ready",
|
|
2626
|
+
error: null,
|
|
2627
|
+
knockResponse: null,
|
|
2628
|
+
isRejoining: false,
|
|
2629
|
+
};
|
|
2630
|
+
const roomConnectionSlice = createSlice({
|
|
2631
|
+
name: "roomConnection",
|
|
2632
|
+
initialState: roomConnectionSliceInitialState,
|
|
2633
|
+
reducers: {
|
|
2634
|
+
connectionStatusChanged: (state, action) => {
|
|
2635
|
+
return Object.assign(Object.assign({}, state), { status: action.payload });
|
|
2636
|
+
},
|
|
2637
|
+
knockResponseReceived: (state, action) => {
|
|
2638
|
+
return Object.assign(Object.assign({}, state), { knockResponse: action.payload });
|
|
2639
|
+
},
|
|
2640
|
+
roomRejoined: (state, action) => {
|
|
2641
|
+
return state;
|
|
2642
|
+
},
|
|
2643
|
+
},
|
|
2644
|
+
extraReducers: (builder) => {
|
|
2645
|
+
builder.addCase(signalEvents.roomJoined, (state, action) => {
|
|
2646
|
+
var _a;
|
|
2647
|
+
if ("error" in action.payload) {
|
|
2648
|
+
if (action.payload.error === "room_locked" && action.payload.isLocked) {
|
|
2649
|
+
return Object.assign(Object.assign({}, state), { status: "room_locked" });
|
|
2650
|
+
}
|
|
2651
|
+
return Object.assign(Object.assign({}, state), { status: "disconnected", error: action.payload.error, isRejoining: false });
|
|
2652
|
+
}
|
|
2653
|
+
const { room } = action.payload;
|
|
2654
|
+
return Object.assign(Object.assign({}, state), { status: "connected", session: (_a = room.session) !== null && _a !== void 0 ? _a : null, isRejoining: false });
|
|
2655
|
+
});
|
|
2656
|
+
builder.addCase(signalEvents.disconnect, (state, action) => {
|
|
2657
|
+
if (["kicked", "left"].includes(state.status)) {
|
|
2658
|
+
return Object.assign({}, state);
|
|
2659
|
+
}
|
|
2660
|
+
const { willReconnect } = action.payload;
|
|
2661
|
+
return Object.assign(Object.assign({}, state), { status: willReconnect ? "reconnecting" : "disconnected", isRejoining: willReconnect && (state.isRejoining || state.status === "connected") });
|
|
2662
|
+
});
|
|
2663
|
+
builder.addCase(signalEvents.newClient, (state, action) => {
|
|
2664
|
+
var _a, _b;
|
|
2665
|
+
return Object.assign(Object.assign({}, state), { session: (_b = (_a = action.payload.room) === null || _a === void 0 ? void 0 : _a.session) !== null && _b !== void 0 ? _b : null });
|
|
2666
|
+
});
|
|
2667
|
+
builder.addCase(signalEvents.roomSessionEnded, (state, action) => {
|
|
2668
|
+
var _a;
|
|
2669
|
+
if (((_a = state.session) === null || _a === void 0 ? void 0 : _a.id) !== action.payload.roomSessionId) {
|
|
2670
|
+
return state;
|
|
2671
|
+
}
|
|
2672
|
+
return Object.assign(Object.assign({}, state), { session: null });
|
|
2673
|
+
});
|
|
2674
|
+
builder.addCase(signalEvents.clientKicked, (state) => {
|
|
2675
|
+
return Object.assign(Object.assign({}, state), { status: "kicked" });
|
|
2676
|
+
});
|
|
2677
|
+
builder.addCase(signalEvents.roomLeft, (state) => {
|
|
2678
|
+
return Object.assign(Object.assign({}, state), { status: "left" });
|
|
2679
|
+
});
|
|
2680
|
+
},
|
|
2681
|
+
});
|
|
2682
|
+
const { connectionStatusChanged, knockResponseReceived } = roomConnectionSlice.actions;
|
|
2683
|
+
const { roomRejoined } = roomConnectionSlice.actions;
|
|
2684
|
+
const doKnockRoom = createAppThunk(() => (dispatch, getState) => {
|
|
2685
|
+
const state = getState();
|
|
2686
|
+
const socket = selectSignalConnectionRaw(state).socket;
|
|
2687
|
+
const roomName = selectAppRoomName(state);
|
|
2688
|
+
const roomKey = selectRoomKey(state);
|
|
2689
|
+
const displayName = selectAppDisplayName(state);
|
|
2690
|
+
const isDialIn = selectAppIsDialIn(state);
|
|
2691
|
+
const isAudioRecorder = selectAppIsAudioRecorder(state);
|
|
2692
|
+
const userAgent = selectAppUserAgent(state);
|
|
2693
|
+
const externalId = selectAppExternalId(state);
|
|
2694
|
+
const organizationId = selectOrganizationId(state);
|
|
2695
|
+
const connectionStatus = selectRoomConnectionStatus(state);
|
|
2696
|
+
const clientClaim = selectLocalParticipantClientClaim(state);
|
|
2697
|
+
if (connectionStatus !== "room_locked") {
|
|
2698
|
+
console.warn("Room is not locked, knock aborted");
|
|
2699
|
+
return;
|
|
2700
|
+
}
|
|
2701
|
+
socket === null || socket === void 0 ? void 0 : socket.emit("knock_room", Object.assign({ avatarUrl: null, config: {
|
|
2702
|
+
isAudioEnabled: true,
|
|
2703
|
+
isVideoEnabled: true,
|
|
2704
|
+
}, deviceCapabilities: { canScreenshare: true }, displayName, isCoLocated: false, isDialIn,
|
|
2705
|
+
isAudioRecorder, isDevicePermissionDenied: false, kickFromOtherRooms: false, organizationId,
|
|
2706
|
+
roomKey,
|
|
2707
|
+
roomName,
|
|
2708
|
+
userAgent,
|
|
2709
|
+
externalId }, (clientClaim && { clientClaim })));
|
|
2710
|
+
dispatch(connectionStatusChanged("knocking"));
|
|
2711
|
+
});
|
|
2712
|
+
const doCancelKnock = createAppThunk(() => (dispatch, getState) => {
|
|
2713
|
+
const state = getState();
|
|
2714
|
+
const socket = selectSignalConnectionRaw(state).socket;
|
|
2715
|
+
const connectionStatus = selectRoomConnectionStatus(state);
|
|
2716
|
+
if (connectionStatus !== "knocking") {
|
|
2717
|
+
console.warn("Not knocking, cancel knock aborted");
|
|
2718
|
+
return;
|
|
2719
|
+
}
|
|
2720
|
+
socket === null || socket === void 0 ? void 0 : socket.emit("cancel_room_knock");
|
|
2721
|
+
dispatch(connectionStatusChanged("ready"));
|
|
2722
|
+
});
|
|
2723
|
+
const doConnectRoom = createAppThunk(() => (dispatch, getState) => {
|
|
2724
|
+
const state = getState();
|
|
2725
|
+
const socket = selectSignalConnectionRaw(state).socket;
|
|
2726
|
+
const roomName = selectAppRoomName(state);
|
|
2727
|
+
const roomKey = selectRoomKey(state);
|
|
2728
|
+
const assistantKey = selectAssistantKey(state);
|
|
2729
|
+
const displayName = selectAppDisplayName(state);
|
|
2730
|
+
const userAgent = selectAppUserAgent(state);
|
|
2731
|
+
const externalId = selectAppExternalId(state);
|
|
2732
|
+
const isDialIn = selectAppIsDialIn(state);
|
|
2733
|
+
const isAudioRecorder = selectAppIsAudioRecorder(state);
|
|
2734
|
+
const organizationId = selectOrganizationId(state);
|
|
2735
|
+
const isCameraEnabled = selectIsCameraEnabled(getState());
|
|
2736
|
+
const isMicrophoneEnabled = selectIsMicrophoneEnabled(getState());
|
|
2737
|
+
const clientClaim = selectLocalParticipantClientClaim(getState());
|
|
2738
|
+
socket === null || socket === void 0 ? void 0 : socket.emit("join_room", Object.assign({ avatarUrl: null, config: {
|
|
2739
|
+
isAudioEnabled: isMicrophoneEnabled,
|
|
2740
|
+
isVideoEnabled: isCameraEnabled,
|
|
2741
|
+
}, deviceCapabilities: { canScreenshare: true }, displayName, isCoLocated: false, isDialIn,
|
|
2742
|
+
isAudioRecorder, isDevicePermissionDenied: false, kickFromOtherRooms: false, organizationId,
|
|
2743
|
+
roomKey,
|
|
2744
|
+
assistantKey,
|
|
2745
|
+
roomName,
|
|
2746
|
+
userAgent,
|
|
2747
|
+
externalId }, (clientClaim && { clientClaim })));
|
|
2748
|
+
dispatch(connectionStatusChanged("connecting"));
|
|
2749
|
+
});
|
|
2750
|
+
const selectShouldConnectRoom = createSelector([
|
|
2751
|
+
selectAppIsActive,
|
|
2752
|
+
selectOrganizationId,
|
|
2753
|
+
selectRoomConnectionStatus,
|
|
2754
|
+
selectSignalConnectionDeviceIdentified,
|
|
2755
|
+
selectLocalMediaStatus,
|
|
2756
|
+
selectRoomConnectionError,
|
|
2757
|
+
], (appIsActive, hasOrganizationIdFetched, roomConnectionStatus, signalConnectionDeviceIdentified, localMediaStatus, roomConnectionError) => {
|
|
2758
|
+
if (appIsActive &&
|
|
2759
|
+
localMediaStatus === "started" &&
|
|
2760
|
+
signalConnectionDeviceIdentified &&
|
|
2761
|
+
!!hasOrganizationIdFetched &&
|
|
2762
|
+
["ready", "reconnecting", "disconnected"].includes(roomConnectionStatus) &&
|
|
2763
|
+
!roomConnectionError) {
|
|
2764
|
+
return true;
|
|
2765
|
+
}
|
|
2766
|
+
return false;
|
|
2767
|
+
});
|
|
2768
|
+
createReactor([selectShouldConnectRoom], ({ dispatch }, shouldConnectRoom) => {
|
|
2769
|
+
if (shouldConnectRoom) {
|
|
2770
|
+
dispatch(doConnectRoom());
|
|
2771
|
+
}
|
|
2772
|
+
});
|
|
2773
|
+
startAppListening({
|
|
2774
|
+
actionCreator: signalEvents.roomJoined,
|
|
2775
|
+
effect: ({ payload }, { dispatch, getOriginalState }) => {
|
|
2776
|
+
if ("error" in payload) {
|
|
2777
|
+
return;
|
|
2778
|
+
}
|
|
2779
|
+
const originalState = getOriginalState();
|
|
2780
|
+
if (!selectRoomConnectionIsRejoining(originalState)) {
|
|
2781
|
+
return;
|
|
2782
|
+
}
|
|
2783
|
+
dispatch(roomRejoined({ selfId: payload.selfId, previousSelfId: selectSelfId(originalState) }));
|
|
2784
|
+
},
|
|
2785
|
+
});
|
|
2786
|
+
startAppListening({
|
|
2787
|
+
actionCreator: signalEvents.knockHandled,
|
|
2788
|
+
effect: ({ payload }, { dispatch, getState }) => {
|
|
2789
|
+
var _a, _b;
|
|
2790
|
+
const { clientId, resolution } = payload;
|
|
2791
|
+
const state = getState();
|
|
2792
|
+
const selfId = selectSelfId(state);
|
|
2793
|
+
if (clientId !== selfId) {
|
|
2794
|
+
return;
|
|
2795
|
+
}
|
|
2796
|
+
if (resolution === "accepted") {
|
|
2797
|
+
dispatch(setRoomKey(payload.metadata.roomKey));
|
|
2798
|
+
dispatch(doConnectRoom());
|
|
2799
|
+
}
|
|
2800
|
+
else if (resolution === "on_hold") {
|
|
2801
|
+
dispatch(knockResponseReceived((_a = payload.knockResponse) !== null && _a !== void 0 ? _a : null));
|
|
2802
|
+
dispatch(connectionStatusChanged("knock_on_hold"));
|
|
2803
|
+
}
|
|
2804
|
+
else if (resolution === "rejected") {
|
|
2805
|
+
dispatch(knockResponseReceived((_b = payload.knockResponse) !== null && _b !== void 0 ? _b : null));
|
|
2806
|
+
dispatch(connectionStatusChanged("knock_rejected"));
|
|
2807
|
+
}
|
|
2808
|
+
},
|
|
2809
|
+
});
|
|
2810
|
+
startAppListening({
|
|
2811
|
+
actionCreator: signalEvents.clientKicked,
|
|
2812
|
+
effect: (_, { dispatch }) => {
|
|
2813
|
+
dispatch(doAppStop());
|
|
2814
|
+
},
|
|
2815
|
+
});
|
|
2816
|
+
startAppListening({
|
|
2817
|
+
actionCreator: doAppStop,
|
|
2818
|
+
effect: (_, { dispatch, getState }) => {
|
|
2819
|
+
const state = getState();
|
|
2820
|
+
const roomConnectionStatus = selectRoomConnectionStatus(state);
|
|
2821
|
+
if (roomConnectionStatus === "connected") {
|
|
2822
|
+
const socket = selectSignalConnectionRaw(state).socket;
|
|
2823
|
+
socket === null || socket === void 0 ? void 0 : socket.emit("leave_room");
|
|
2824
|
+
dispatch(connectionStatusChanged("leaving"));
|
|
2825
|
+
}
|
|
2826
|
+
else {
|
|
2827
|
+
dispatch(doSignalDisconnect());
|
|
2828
|
+
}
|
|
2829
|
+
},
|
|
2830
|
+
});
|
|
2559
2831
|
|
|
2560
2832
|
const emitter = new EventEmitter();
|
|
2561
2833
|
function createNotificationEvent(payload) {
|
|
@@ -2740,6 +3012,25 @@ createReactor([selectSignalStatus], ({ dispatch, getState }, signalStatus) => {
|
|
|
2740
3012
|
})));
|
|
2741
3013
|
}
|
|
2742
3014
|
});
|
|
3015
|
+
createReactor([selectRoomConnectionIsRejoining], ({ dispatch }, isRejoining) => {
|
|
3016
|
+
if (isRejoining) {
|
|
3017
|
+
dispatch(doSetNotification(createNotificationEvent({
|
|
3018
|
+
type: "reconnecting",
|
|
3019
|
+
message: `Reconnecting to the room...`,
|
|
3020
|
+
props: {},
|
|
3021
|
+
})));
|
|
3022
|
+
}
|
|
3023
|
+
});
|
|
3024
|
+
startAppListening({
|
|
3025
|
+
actionCreator: roomRejoined,
|
|
3026
|
+
effect: (_, { dispatch }) => {
|
|
3027
|
+
dispatch(doSetNotification(createNotificationEvent({
|
|
3028
|
+
type: "reconnected",
|
|
3029
|
+
message: `Reconnected to the room`,
|
|
3030
|
+
props: {},
|
|
3031
|
+
})));
|
|
3032
|
+
},
|
|
3033
|
+
});
|
|
2743
3034
|
startAppListening({
|
|
2744
3035
|
actionCreator: signalEvents.clientUnableToJoin,
|
|
2745
3036
|
effect: (action, { dispatch }) => {
|
|
@@ -3293,6 +3584,7 @@ const doEndMeeting = createAppAuthorizedThunk((state) => selectIsAuthorizedToEnd
|
|
|
3293
3584
|
dispatch(doAppStop());
|
|
3294
3585
|
}
|
|
3295
3586
|
});
|
|
3587
|
+
const selectRoomMode = (state) => state.room.mode;
|
|
3296
3588
|
const selectScreenshares = createSelector(selectLocalScreenshareStream, selectLocalParticipantRaw, selectRemoteParticipants, (localScreenshareStream, localParticipant, remoteParticipants) => {
|
|
3297
3589
|
const screenshares = [];
|
|
3298
3590
|
if (localScreenshareStream) {
|
|
@@ -3523,6 +3815,9 @@ const createWebRtcEmitter = (dispatch) => {
|
|
|
3523
3815
|
else if (eventName === "client_connection_status_changed") {
|
|
3524
3816
|
dispatch(rtcEvents.clientConnectionStatusChanged(data));
|
|
3525
3817
|
}
|
|
3818
|
+
else if (eventName === "media_quality_changed") {
|
|
3819
|
+
dispatch(rtcEvents.mediaQualityChanged(data));
|
|
3820
|
+
}
|
|
3526
3821
|
else ;
|
|
3527
3822
|
},
|
|
3528
3823
|
};
|
|
@@ -3897,8 +4192,66 @@ createReactor([selectStreamsToAccept, selectIsAcceptingStreams], ({ dispatch },
|
|
|
3897
4192
|
}
|
|
3898
4193
|
});
|
|
3899
4194
|
|
|
4195
|
+
const CALL_QUALITY_LEVELS = {
|
|
4196
|
+
CRITICAL: "critical",
|
|
4197
|
+
WARNING: "warning",
|
|
4198
|
+
OK: "ok",
|
|
4199
|
+
};
|
|
4200
|
+
const CALL_QUALITY_LEVEL_ORDER = Object.values(CALL_QUALITY_LEVELS);
|
|
4201
|
+
function convertQualityScoreToNumber(score) {
|
|
4202
|
+
return score !== undefined && score !== null
|
|
4203
|
+
? CALL_QUALITY_LEVEL_ORDER.indexOf(score)
|
|
4204
|
+
: CALL_QUALITY_LEVEL_ORDER.indexOf(CALL_QUALITY_LEVELS.OK);
|
|
4205
|
+
}
|
|
4206
|
+
const getActiveIssues = (allIssues, issuesToCheck = []) => Object.keys(allIssues).reduce((issuesAcc, issueKey) => {
|
|
4207
|
+
const issue = allIssues[issueKey];
|
|
4208
|
+
if (!issue)
|
|
4209
|
+
return issuesAcc;
|
|
4210
|
+
if (issuesToCheck.includes(issueKey) && issue.active && issue.registered > 2) {
|
|
4211
|
+
return [...issuesAcc, issueKey];
|
|
4212
|
+
}
|
|
4213
|
+
return issuesAcc;
|
|
4214
|
+
}, []);
|
|
4215
|
+
const addMetricsQualifier = (issuesToCheck, isLocalClient = false) => issuesToCheck.map((issue) => `${isLocalClient ? "loc" : "rem"}-${issue}`);
|
|
4216
|
+
function calculateCallQualityScore(clientId, roomMode, mediaQualityScores, connectionMonitorIssuesReport) {
|
|
4217
|
+
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;
|
|
4218
|
+
const videoScoreValue = Math.min(...(roomMode === "normal"
|
|
4219
|
+
? [
|
|
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
|
+
((_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
|
+
? CALL_QUALITY_LEVELS.CRITICAL
|
|
4223
|
+
: CALL_QUALITY_LEVELS.OK),
|
|
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
|
+
((_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
|
+
? CALL_QUALITY_LEVELS.WARNING
|
|
4227
|
+
: CALL_QUALITY_LEVELS.OK),
|
|
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 : CALL_QUALITY_LEVELS.OK)]));
|
|
4230
|
+
const audioScoreValue = Math.min(...(roomMode === "normal"
|
|
4231
|
+
? [
|
|
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
|
+
((_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
|
+
? CALL_QUALITY_LEVELS.CRITICAL
|
|
4235
|
+
: CALL_QUALITY_LEVELS.OK),
|
|
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
|
+
((_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
|
+
? CALL_QUALITY_LEVELS.WARNING
|
|
4239
|
+
: CALL_QUALITY_LEVELS.OK),
|
|
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 : CALL_QUALITY_LEVELS.OK)]));
|
|
4242
|
+
const overallScoreValue = Math.min(videoScoreValue, audioScoreValue);
|
|
4243
|
+
return {
|
|
4244
|
+
total: CALL_QUALITY_LEVEL_ORDER[overallScoreValue],
|
|
4245
|
+
video: CALL_QUALITY_LEVEL_ORDER[videoScoreValue],
|
|
4246
|
+
audio: CALL_QUALITY_LEVEL_ORDER[audioScoreValue],
|
|
4247
|
+
};
|
|
4248
|
+
}
|
|
3900
4249
|
const connectionMonitorSliceInitialState = {
|
|
3901
4250
|
running: false,
|
|
4251
|
+
issuesReport: undefined,
|
|
4252
|
+
remoteQualityScores: undefined,
|
|
4253
|
+
localQualityScore: undefined,
|
|
4254
|
+
mediaScores: undefined,
|
|
3902
4255
|
};
|
|
3903
4256
|
const connectionMonitorSlice = createSlice({
|
|
3904
4257
|
name: "connectionMonitor",
|
|
@@ -3907,12 +4260,27 @@ const connectionMonitorSlice = createSlice({
|
|
|
3907
4260
|
connectionMonitorStarted: (state, action) => {
|
|
3908
4261
|
return Object.assign(Object.assign({}, state), { running: true, stopCallbackFunction: action.payload.stopIssueSubscription });
|
|
3909
4262
|
},
|
|
4263
|
+
connectionMonitorReportUpdated: (state, action) => {
|
|
4264
|
+
return Object.assign(Object.assign({}, state), { issuesReport: action.payload });
|
|
4265
|
+
},
|
|
4266
|
+
updateRemoteCallQualityScores: (state, action) => {
|
|
4267
|
+
return Object.assign(Object.assign({}, state), { remoteQualityScores: action.payload });
|
|
4268
|
+
},
|
|
4269
|
+
updateLocalCallQualityScore: (state, action) => {
|
|
4270
|
+
return Object.assign(Object.assign({}, state), { localQualityScore: action.payload });
|
|
4271
|
+
},
|
|
3910
4272
|
connectionMonitorStopped: () => {
|
|
3911
4273
|
return Object.assign({}, connectionMonitorSliceInitialState);
|
|
3912
4274
|
},
|
|
3913
4275
|
},
|
|
4276
|
+
extraReducers: (builder) => {
|
|
4277
|
+
builder.addCase(rtcEvents.mediaQualityChanged, (state, action) => {
|
|
4278
|
+
var _a;
|
|
4279
|
+
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 }) }) });
|
|
4280
|
+
});
|
|
4281
|
+
},
|
|
3914
4282
|
});
|
|
3915
|
-
const { connectionMonitorStarted, connectionMonitorStopped } = connectionMonitorSlice.actions;
|
|
4283
|
+
const { connectionMonitorStarted, connectionMonitorStopped, connectionMonitorReportUpdated, updateRemoteCallQualityScores, updateLocalCallQualityScore, } = connectionMonitorSlice.actions;
|
|
3916
4284
|
const doStartConnectionMonitor = createAppThunk(() => (dispatch, getState) => {
|
|
3917
4285
|
setClientProvider(() => {
|
|
3918
4286
|
const state = getState();
|
|
@@ -3937,8 +4305,52 @@ const doStartConnectionMonitor = createAppThunk(() => (dispatch, getState) => {
|
|
|
3937
4305
|
return clientViews;
|
|
3938
4306
|
});
|
|
3939
4307
|
const issueMonitorSubscription = subscribeIssues({
|
|
3940
|
-
onUpdatedIssues: (issuesAndMetricsByClients) => {
|
|
4308
|
+
onUpdatedIssues: (issuesAndMetricsByClients, _, clients) => {
|
|
3941
4309
|
var _a;
|
|
4310
|
+
const clientsWithCriticalIssues = clients.reduce((acc, { clientId, isLocalClient }) => {
|
|
4311
|
+
const { issues } = issuesAndMetricsByClients[clientId] || { issues: {} };
|
|
4312
|
+
const criticalVideoIssues = getActiveIssues(issues, addMetricsQualifier(["cam-video-extreme-packetloss", "pres-video-extreme-packetloss"], isLocalClient));
|
|
4313
|
+
const criticalAudioIssues = getActiveIssues(issues, addMetricsQualifier(["cam-audio-extreme-packetloss"], isLocalClient));
|
|
4314
|
+
const criticalCpuIssues = getActiveIssues(issues, ["global-cpu-pressure-critical"]);
|
|
4315
|
+
if (criticalVideoIssues.length === 0 &&
|
|
4316
|
+
criticalAudioIssues.length === 0 &&
|
|
4317
|
+
criticalCpuIssues.length === 0) {
|
|
4318
|
+
return acc;
|
|
4319
|
+
}
|
|
4320
|
+
return Object.assign(Object.assign({}, acc), { [clientId]: {
|
|
4321
|
+
video: criticalVideoIssues,
|
|
4322
|
+
audio: criticalAudioIssues,
|
|
4323
|
+
cpu: criticalCpuIssues,
|
|
4324
|
+
} });
|
|
4325
|
+
}, {});
|
|
4326
|
+
const clientsWithWarningIssues = clients.reduce((acc, { clientId, isLocalClient }) => {
|
|
4327
|
+
const { issues } = issuesAndMetricsByClients[clientId] || { issues: {} };
|
|
4328
|
+
const warningVideoIssues = getActiveIssues(issues, addMetricsQualifier([
|
|
4329
|
+
"cam-video-bad-network",
|
|
4330
|
+
"pres-video-bad-network",
|
|
4331
|
+
"cam-video-high-packetloss",
|
|
4332
|
+
"pres-video-high-packetloss",
|
|
4333
|
+
"cam-video-low-layer0-bitrate",
|
|
4334
|
+
"pres-video-low-layer0-bitrate",
|
|
4335
|
+
], isLocalClient));
|
|
4336
|
+
const warningAudioIssues = getActiveIssues(issues, addMetricsQualifier(["cam-audio-bad-network", "cam-audio-high-packetloss", "cam-audio-distorted"], isLocalClient));
|
|
4337
|
+
const warningCpuIssues = getActiveIssues(issues, ["global-cpu-pressure-serious"]);
|
|
4338
|
+
if (warningVideoIssues.length === 0 &&
|
|
4339
|
+
warningAudioIssues.length === 0 &&
|
|
4340
|
+
warningCpuIssues.length === 0) {
|
|
4341
|
+
return acc;
|
|
4342
|
+
}
|
|
4343
|
+
return Object.assign(Object.assign({}, acc), { [clientId]: {
|
|
4344
|
+
video: warningVideoIssues,
|
|
4345
|
+
audio: warningAudioIssues,
|
|
4346
|
+
cpu: warningCpuIssues,
|
|
4347
|
+
} });
|
|
4348
|
+
}, {});
|
|
4349
|
+
const newConnectionMonitorReport = {
|
|
4350
|
+
critical: clientsWithCriticalIssues,
|
|
4351
|
+
warning: clientsWithWarningIssues,
|
|
4352
|
+
};
|
|
4353
|
+
dispatch(doUpdateConnectionMonitorReport(newConnectionMonitorReport));
|
|
3942
4354
|
const state = getState();
|
|
3943
4355
|
const rtcManager = selectRtcManager(state);
|
|
3944
4356
|
if (!rtcManager) {
|
|
@@ -3970,6 +4382,85 @@ const doStartConnectionMonitor = createAppThunk(() => (dispatch, getState) => {
|
|
|
3970
4382
|
});
|
|
3971
4383
|
dispatch(connectionMonitorStarted({ stopIssueSubscription: issueMonitorSubscription.stop }));
|
|
3972
4384
|
});
|
|
4385
|
+
const doUpdateConnectionMonitorReport = createAppThunk((newConnectionMonitorReport) => (dispatch, getState) => {
|
|
4386
|
+
const state = getState();
|
|
4387
|
+
const rtcManager = selectRtcManager(state);
|
|
4388
|
+
if (!rtcManager) {
|
|
4389
|
+
return;
|
|
4390
|
+
}
|
|
4391
|
+
const oldConnectionMonitorReport = selectConnectionMonitorIssuesReport(state);
|
|
4392
|
+
if (JSON.stringify(newConnectionMonitorReport) === JSON.stringify(oldConnectionMonitorReport)) {
|
|
4393
|
+
return;
|
|
4394
|
+
}
|
|
4395
|
+
dispatch(connectionMonitorReportUpdated(newConnectionMonitorReport));
|
|
4396
|
+
const localClientId = selectSelfId(state);
|
|
4397
|
+
const updatedClientStates = {};
|
|
4398
|
+
["critical", "warning"].forEach((level) => {
|
|
4399
|
+
Object.keys(newConnectionMonitorReport[level] || {})
|
|
4400
|
+
.filter((clientId) => {
|
|
4401
|
+
var _a, _b, _c, _d, _e, _f;
|
|
4402
|
+
const isLocalClientId = clientId === localClientId;
|
|
4403
|
+
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])) ||
|
|
4404
|
+
((_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])));
|
|
4405
|
+
})
|
|
4406
|
+
.forEach((newClientId) => {
|
|
4407
|
+
const oldClient = Object.keys((oldConnectionMonitorReport === null || oldConnectionMonitorReport === void 0 ? void 0 : oldConnectionMonitorReport[level]) || {}).find((oldClientId) => oldClientId === newClientId);
|
|
4408
|
+
if (!oldClient)
|
|
4409
|
+
updatedClientStates[newClientId] = { badNetwork: true };
|
|
4410
|
+
});
|
|
4411
|
+
Object.keys((oldConnectionMonitorReport === null || oldConnectionMonitorReport === void 0 ? void 0 : oldConnectionMonitorReport[level]) || {})
|
|
4412
|
+
.filter((clientId) => {
|
|
4413
|
+
var _a, _b, _c, _d, _e, _f;
|
|
4414
|
+
const isLocalClientId = clientId === localClientId;
|
|
4415
|
+
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])) ||
|
|
4416
|
+
((_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])));
|
|
4417
|
+
})
|
|
4418
|
+
.forEach((oldClientId) => {
|
|
4419
|
+
const newClient = Object.keys(newConnectionMonitorReport[level]).find((newClientId) => newClientId === oldClientId);
|
|
4420
|
+
if (!newClient)
|
|
4421
|
+
updatedClientStates[oldClientId] = { badNetwork: false };
|
|
4422
|
+
});
|
|
4423
|
+
});
|
|
4424
|
+
if (Object.keys(updatedClientStates).length > 0) {
|
|
4425
|
+
rtcManager.sendStatsCustomEvent("clientStates", {
|
|
4426
|
+
updatesByClientId: updatedClientStates,
|
|
4427
|
+
_time: Date.now(),
|
|
4428
|
+
});
|
|
4429
|
+
}
|
|
4430
|
+
});
|
|
4431
|
+
const doSetRemoteCallQualityScores = createAppThunk((scores) => (dispatch, getState) => {
|
|
4432
|
+
const state = getState();
|
|
4433
|
+
const rtcManager = selectRtcManager(state);
|
|
4434
|
+
if (!rtcManager) {
|
|
4435
|
+
return;
|
|
4436
|
+
}
|
|
4437
|
+
const scoreValues = Object.values(scores);
|
|
4438
|
+
const total = scoreValues.some(({ total }) => total === CALL_QUALITY_LEVELS.CRITICAL)
|
|
4439
|
+
? CALL_QUALITY_LEVELS.CRITICAL
|
|
4440
|
+
: scoreValues.some(({ total }) => total === CALL_QUALITY_LEVELS.WARNING)
|
|
4441
|
+
? CALL_QUALITY_LEVELS.WARNING
|
|
4442
|
+
: CALL_QUALITY_LEVELS.OK;
|
|
4443
|
+
rtcManager.sendStatsCustomEvent("remoteCallQualityScores", {
|
|
4444
|
+
total,
|
|
4445
|
+
_time: Date.now(),
|
|
4446
|
+
});
|
|
4447
|
+
dispatch(updateRemoteCallQualityScores(scores));
|
|
4448
|
+
});
|
|
4449
|
+
const doSetLocalCallQualityScore = createAppThunk((score) => (dispatch, getState) => {
|
|
4450
|
+
const state = getState();
|
|
4451
|
+
const rtcManager = selectRtcManager(state);
|
|
4452
|
+
if (!rtcManager) {
|
|
4453
|
+
return;
|
|
4454
|
+
}
|
|
4455
|
+
const oldLocalCallQualityScore = selectLocalCallQualityScore(state);
|
|
4456
|
+
if (score.total !== (oldLocalCallQualityScore === null || oldLocalCallQualityScore === void 0 ? void 0 : oldLocalCallQualityScore.total)) {
|
|
4457
|
+
rtcManager.sendStatsCustomEvent("callQualityScoreTotalChanged", {
|
|
4458
|
+
total: score.total,
|
|
4459
|
+
_time: Date.now(),
|
|
4460
|
+
});
|
|
4461
|
+
}
|
|
4462
|
+
dispatch(updateLocalCallQualityScore(score));
|
|
4463
|
+
});
|
|
3973
4464
|
const doStopConnectionMonitor = createAppThunk(() => (dispatch, getState) => {
|
|
3974
4465
|
const state = getState();
|
|
3975
4466
|
const stopCallbackFn = selectStopCallbackFunction(state);
|
|
@@ -3980,6 +4471,16 @@ const doStopConnectionMonitor = createAppThunk(() => (dispatch, getState) => {
|
|
|
3980
4471
|
});
|
|
3981
4472
|
const selectConnectionMonitorIsRunning = (state) => state.connectionMonitor.running;
|
|
3982
4473
|
const selectStopCallbackFunction = (state) => state.connectionMonitor.stopCallbackFunction;
|
|
4474
|
+
const selectConnectionMonitorIssuesReport = (state) => state.connectionMonitor.issuesReport;
|
|
4475
|
+
const selectConnectionMediaQualityScores = (state) => state.connectionMonitor.mediaScores;
|
|
4476
|
+
const selectRemoteCallQualityScores = (state) => state.connectionMonitor.remoteQualityScores;
|
|
4477
|
+
const selectLocalCallQualityScore = (state) => state.connectionMonitor.localQualityScore;
|
|
4478
|
+
const selectRemoteParticipantQualityReport = createSelector(selectRemoteCallQualityScores, (remoteCallQualityScores) => {
|
|
4479
|
+
if (!remoteCallQualityScores) {
|
|
4480
|
+
return undefined;
|
|
4481
|
+
}
|
|
4482
|
+
return Object.fromEntries(Object.entries(remoteCallQualityScores).map(([clientId, { total }]) => [clientId, { quality: total }]));
|
|
4483
|
+
});
|
|
3983
4484
|
const selectShouldStartConnectionMonitor = createSelector(selectRoomConnectionStatus, selectConnectionMonitorIsRunning, (roomConnectionStatus, isRunning) => {
|
|
3984
4485
|
if (!isRunning && roomConnectionStatus === "connected") {
|
|
3985
4486
|
return true;
|
|
@@ -3992,6 +4493,23 @@ const selectShouldStopConnectionMonitor = createSelector(selectRoomConnectionSta
|
|
|
3992
4493
|
}
|
|
3993
4494
|
return false;
|
|
3994
4495
|
});
|
|
4496
|
+
const selectCalculatedRemoteCallQualityScores = createSelector(selectRoomConnectionStatus, selectRoomMode, selectRemoteClientViews, selectConnectionMediaQualityScores, selectConnectionMonitorIssuesReport, (roomConnectionStatus, roomMode, remoteClientViews, mediaQualityScores, connectionMonitorIssuesReport) => {
|
|
4497
|
+
if (roomConnectionStatus !== "connected") {
|
|
4498
|
+
return undefined;
|
|
4499
|
+
}
|
|
4500
|
+
return Object.fromEntries(remoteClientViews
|
|
4501
|
+
.filter(({ isLocalClient }) => !isLocalClient)
|
|
4502
|
+
.map(({ clientId }) => [
|
|
4503
|
+
clientId,
|
|
4504
|
+
calculateCallQualityScore(clientId, roomMode, mediaQualityScores, connectionMonitorIssuesReport),
|
|
4505
|
+
]));
|
|
4506
|
+
});
|
|
4507
|
+
const selectCalculatedLocalCallQualityScore = createSelector(selectRoomConnectionStatus, selectRoomMode, selectLocalParticipantView, selectConnectionMediaQualityScores, selectConnectionMonitorIssuesReport, (roomConnectionStatus, roomMode, localParticipantView, mediaQualityScores, connectionMonitorIssuesReport) => {
|
|
4508
|
+
if (roomConnectionStatus !== "connected" || !localParticipantView) {
|
|
4509
|
+
return undefined;
|
|
4510
|
+
}
|
|
4511
|
+
return calculateCallQualityScore(localParticipantView.clientId, roomMode, mediaQualityScores, connectionMonitorIssuesReport);
|
|
4512
|
+
});
|
|
3995
4513
|
createReactor([selectShouldStartConnectionMonitor], ({ dispatch }, shouldStartConnectionMonitor) => {
|
|
3996
4514
|
if (shouldStartConnectionMonitor) {
|
|
3997
4515
|
dispatch(doStartConnectionMonitor());
|
|
@@ -4002,6 +4520,24 @@ createReactor([selectShouldStopConnectionMonitor], ({ dispatch }, shouldStartCon
|
|
|
4002
4520
|
dispatch(doStopConnectionMonitor());
|
|
4003
4521
|
}
|
|
4004
4522
|
});
|
|
4523
|
+
createReactor([selectCalculatedRemoteCallQualityScores, selectRemoteCallQualityScores], ({ dispatch }, newRemoteCallQualityScores, oldRemoteCallQualityScores) => {
|
|
4524
|
+
if (!newRemoteCallQualityScores) {
|
|
4525
|
+
return;
|
|
4526
|
+
}
|
|
4527
|
+
if (oldRemoteCallQualityScores &&
|
|
4528
|
+
JSON.stringify(newRemoteCallQualityScores) === JSON.stringify(oldRemoteCallQualityScores))
|
|
4529
|
+
return;
|
|
4530
|
+
dispatch(doSetRemoteCallQualityScores(newRemoteCallQualityScores));
|
|
4531
|
+
});
|
|
4532
|
+
createReactor([selectCalculatedLocalCallQualityScore, selectLocalCallQualityScore], ({ dispatch }, newLocalCallQualityScore, oldLocalCallQualityScore) => {
|
|
4533
|
+
if (!newLocalCallQualityScore) {
|
|
4534
|
+
return;
|
|
4535
|
+
}
|
|
4536
|
+
if (oldLocalCallQualityScore &&
|
|
4537
|
+
JSON.stringify(newLocalCallQualityScore) === JSON.stringify(oldLocalCallQualityScore))
|
|
4538
|
+
return;
|
|
4539
|
+
dispatch(doSetLocalCallQualityScore(newLocalCallQualityScore));
|
|
4540
|
+
});
|
|
4005
4541
|
|
|
4006
4542
|
const MAX_FILES_PER_UPLOAD = 10;
|
|
4007
4543
|
const MAX_FILE_SIZE = 15 * 1024 * 1024;
|
|
@@ -4446,254 +4982,6 @@ createReactor([selectBreakoutAssignments, selectDeviceId, selectLocalParticipant
|
|
|
4446
4982
|
}
|
|
4447
4983
|
});
|
|
4448
4984
|
|
|
4449
|
-
const organizationSliceInitialState = {
|
|
4450
|
-
data: null,
|
|
4451
|
-
isFetching: false,
|
|
4452
|
-
error: null,
|
|
4453
|
-
};
|
|
4454
|
-
const organizationSlice = createSlice({
|
|
4455
|
-
name: "organization",
|
|
4456
|
-
initialState: organizationSliceInitialState,
|
|
4457
|
-
reducers: {},
|
|
4458
|
-
extraReducers: (builder) => {
|
|
4459
|
-
builder.addCase(doOrganizationFetch.pending, (state) => {
|
|
4460
|
-
return Object.assign(Object.assign({}, state), { isFetching: true });
|
|
4461
|
-
});
|
|
4462
|
-
builder.addCase(doOrganizationFetch.fulfilled, (state, action) => {
|
|
4463
|
-
if (!action.payload)
|
|
4464
|
-
return Object.assign(Object.assign({}, state), { isFetching: true });
|
|
4465
|
-
return Object.assign(Object.assign({}, state), { isFetching: false, data: action.payload });
|
|
4466
|
-
});
|
|
4467
|
-
builder.addCase(doOrganizationFetch.rejected, (state) => {
|
|
4468
|
-
return Object.assign(Object.assign({}, state), { isFetching: false, error: true });
|
|
4469
|
-
});
|
|
4470
|
-
},
|
|
4471
|
-
});
|
|
4472
|
-
const doOrganizationFetch = createAppAsyncThunk("organization/doOrganizationFetch", (_1, _a) => __awaiter(void 0, [_1, _a], void 0, function* (_, { extra, getState }) {
|
|
4473
|
-
try {
|
|
4474
|
-
const roomUrl = selectAppRoomUrl(getState());
|
|
4475
|
-
const organization = yield extra.services.fetchOrganizationFromRoomUrl(roomUrl || "");
|
|
4476
|
-
if (!organization) {
|
|
4477
|
-
throw new Error("Invalid room url");
|
|
4478
|
-
}
|
|
4479
|
-
return organization;
|
|
4480
|
-
}
|
|
4481
|
-
catch (error) {
|
|
4482
|
-
console.error(error);
|
|
4483
|
-
}
|
|
4484
|
-
}));
|
|
4485
|
-
const selectOrganizationRaw = (state) => state.organization;
|
|
4486
|
-
const selectOrganizationId = (state) => { var _a; return (_a = state.organization.data) === null || _a === void 0 ? void 0 : _a.organizationId; };
|
|
4487
|
-
const selectOrganizationPreferences = (state) => { var _a; return (_a = state.organization.data) === null || _a === void 0 ? void 0 : _a.preferences; };
|
|
4488
|
-
const selectShouldFetchOrganization = createSelector(selectAppIsActive, selectOrganizationRaw, selectDeviceCredentialsRaw, (appIsActive, organization, deviceCredentials) => {
|
|
4489
|
-
if (appIsActive &&
|
|
4490
|
-
!organization.data &&
|
|
4491
|
-
!organization.isFetching &&
|
|
4492
|
-
!organization.error &&
|
|
4493
|
-
!deviceCredentials.isFetching) {
|
|
4494
|
-
return true;
|
|
4495
|
-
}
|
|
4496
|
-
return false;
|
|
4497
|
-
});
|
|
4498
|
-
createReactor([selectShouldFetchOrganization], ({ dispatch }, shouldFetchOrganization) => {
|
|
4499
|
-
if (shouldFetchOrganization) {
|
|
4500
|
-
dispatch(doOrganizationFetch());
|
|
4501
|
-
}
|
|
4502
|
-
});
|
|
4503
|
-
|
|
4504
|
-
const roomConnectionSliceInitialState = {
|
|
4505
|
-
session: null,
|
|
4506
|
-
status: "ready",
|
|
4507
|
-
error: null,
|
|
4508
|
-
knockResponse: null,
|
|
4509
|
-
};
|
|
4510
|
-
const roomConnectionSlice = createSlice({
|
|
4511
|
-
name: "roomConnection",
|
|
4512
|
-
initialState: roomConnectionSliceInitialState,
|
|
4513
|
-
reducers: {
|
|
4514
|
-
connectionStatusChanged: (state, action) => {
|
|
4515
|
-
return Object.assign(Object.assign({}, state), { status: action.payload });
|
|
4516
|
-
},
|
|
4517
|
-
knockResponseReceived: (state, action) => {
|
|
4518
|
-
return Object.assign(Object.assign({}, state), { knockResponse: action.payload });
|
|
4519
|
-
},
|
|
4520
|
-
},
|
|
4521
|
-
extraReducers: (builder) => {
|
|
4522
|
-
builder.addCase(signalEvents.roomJoined, (state, action) => {
|
|
4523
|
-
var _a;
|
|
4524
|
-
if ("error" in action.payload) {
|
|
4525
|
-
if (action.payload.error === "room_locked" && action.payload.isLocked) {
|
|
4526
|
-
return Object.assign(Object.assign({}, state), { status: "room_locked" });
|
|
4527
|
-
}
|
|
4528
|
-
return Object.assign(Object.assign({}, state), { status: "disconnected", error: action.payload.error });
|
|
4529
|
-
}
|
|
4530
|
-
const { room } = action.payload;
|
|
4531
|
-
return Object.assign(Object.assign({}, state), { status: "connected", session: (_a = room.session) !== null && _a !== void 0 ? _a : null });
|
|
4532
|
-
});
|
|
4533
|
-
builder.addCase(signalEvents.disconnect, (state) => {
|
|
4534
|
-
if (["kicked", "left"].includes(state.status)) {
|
|
4535
|
-
return Object.assign({}, state);
|
|
4536
|
-
}
|
|
4537
|
-
return Object.assign(Object.assign({}, state), { status: "disconnected" });
|
|
4538
|
-
});
|
|
4539
|
-
builder.addCase(signalEvents.newClient, (state, action) => {
|
|
4540
|
-
var _a, _b;
|
|
4541
|
-
return Object.assign(Object.assign({}, state), { session: (_b = (_a = action.payload.room) === null || _a === void 0 ? void 0 : _a.session) !== null && _b !== void 0 ? _b : null });
|
|
4542
|
-
});
|
|
4543
|
-
builder.addCase(signalEvents.roomSessionEnded, (state, action) => {
|
|
4544
|
-
var _a;
|
|
4545
|
-
if (((_a = state.session) === null || _a === void 0 ? void 0 : _a.id) !== action.payload.roomSessionId) {
|
|
4546
|
-
return state;
|
|
4547
|
-
}
|
|
4548
|
-
return Object.assign(Object.assign({}, state), { session: null });
|
|
4549
|
-
});
|
|
4550
|
-
builder.addCase(signalEvents.clientKicked, (state) => {
|
|
4551
|
-
return Object.assign(Object.assign({}, state), { status: "kicked" });
|
|
4552
|
-
});
|
|
4553
|
-
builder.addCase(signalEvents.roomLeft, (state) => {
|
|
4554
|
-
return Object.assign(Object.assign({}, state), { status: "left" });
|
|
4555
|
-
});
|
|
4556
|
-
builder.addCase(socketReconnecting, (state) => {
|
|
4557
|
-
return Object.assign(Object.assign({}, state), { status: "reconnecting" });
|
|
4558
|
-
});
|
|
4559
|
-
},
|
|
4560
|
-
});
|
|
4561
|
-
const { connectionStatusChanged, knockResponseReceived } = roomConnectionSlice.actions;
|
|
4562
|
-
const doKnockRoom = createAppThunk(() => (dispatch, getState) => {
|
|
4563
|
-
const state = getState();
|
|
4564
|
-
const socket = selectSignalConnectionRaw(state).socket;
|
|
4565
|
-
const roomName = selectAppRoomName(state);
|
|
4566
|
-
const roomKey = selectRoomKey(state);
|
|
4567
|
-
const displayName = selectAppDisplayName(state);
|
|
4568
|
-
const isDialIn = selectAppIsDialIn(state);
|
|
4569
|
-
const isAudioRecorder = selectAppIsAudioRecorder(state);
|
|
4570
|
-
const userAgent = selectAppUserAgent(state);
|
|
4571
|
-
const externalId = selectAppExternalId(state);
|
|
4572
|
-
const organizationId = selectOrganizationId(state);
|
|
4573
|
-
const connectionStatus = selectRoomConnectionStatus(state);
|
|
4574
|
-
const clientClaim = selectLocalParticipantClientClaim(state);
|
|
4575
|
-
if (connectionStatus !== "room_locked") {
|
|
4576
|
-
console.warn("Room is not locked, knock aborted");
|
|
4577
|
-
return;
|
|
4578
|
-
}
|
|
4579
|
-
socket === null || socket === void 0 ? void 0 : socket.emit("knock_room", Object.assign({ avatarUrl: null, config: {
|
|
4580
|
-
isAudioEnabled: true,
|
|
4581
|
-
isVideoEnabled: true,
|
|
4582
|
-
}, deviceCapabilities: { canScreenshare: true }, displayName, isCoLocated: false, isDialIn,
|
|
4583
|
-
isAudioRecorder, isDevicePermissionDenied: false, kickFromOtherRooms: false, organizationId,
|
|
4584
|
-
roomKey,
|
|
4585
|
-
roomName,
|
|
4586
|
-
userAgent,
|
|
4587
|
-
externalId }, (clientClaim && { clientClaim })));
|
|
4588
|
-
dispatch(connectionStatusChanged("knocking"));
|
|
4589
|
-
});
|
|
4590
|
-
const doCancelKnock = createAppThunk(() => (dispatch, getState) => {
|
|
4591
|
-
const state = getState();
|
|
4592
|
-
const socket = selectSignalConnectionRaw(state).socket;
|
|
4593
|
-
const connectionStatus = selectRoomConnectionStatus(state);
|
|
4594
|
-
if (connectionStatus !== "knocking") {
|
|
4595
|
-
console.warn("Not knocking, cancel knock aborted");
|
|
4596
|
-
return;
|
|
4597
|
-
}
|
|
4598
|
-
socket === null || socket === void 0 ? void 0 : socket.emit("cancel_room_knock");
|
|
4599
|
-
dispatch(connectionStatusChanged("ready"));
|
|
4600
|
-
});
|
|
4601
|
-
const doConnectRoom = createAppThunk(() => (dispatch, getState) => {
|
|
4602
|
-
const state = getState();
|
|
4603
|
-
const socket = selectSignalConnectionRaw(state).socket;
|
|
4604
|
-
const roomName = selectAppRoomName(state);
|
|
4605
|
-
const roomKey = selectRoomKey(state);
|
|
4606
|
-
const assistantKey = selectAssistantKey(state);
|
|
4607
|
-
const displayName = selectAppDisplayName(state);
|
|
4608
|
-
const userAgent = selectAppUserAgent(state);
|
|
4609
|
-
const externalId = selectAppExternalId(state);
|
|
4610
|
-
const isDialIn = selectAppIsDialIn(state);
|
|
4611
|
-
const isAudioRecorder = selectAppIsAudioRecorder(state);
|
|
4612
|
-
const organizationId = selectOrganizationId(state);
|
|
4613
|
-
const isCameraEnabled = selectIsCameraEnabled(getState());
|
|
4614
|
-
const isMicrophoneEnabled = selectIsMicrophoneEnabled(getState());
|
|
4615
|
-
const clientClaim = selectLocalParticipantClientClaim(getState());
|
|
4616
|
-
socket === null || socket === void 0 ? void 0 : socket.emit("join_room", Object.assign({ avatarUrl: null, config: {
|
|
4617
|
-
isAudioEnabled: isMicrophoneEnabled,
|
|
4618
|
-
isVideoEnabled: isCameraEnabled,
|
|
4619
|
-
}, deviceCapabilities: { canScreenshare: true }, displayName, isCoLocated: false, isDialIn,
|
|
4620
|
-
isAudioRecorder, isDevicePermissionDenied: false, kickFromOtherRooms: false, organizationId,
|
|
4621
|
-
roomKey,
|
|
4622
|
-
assistantKey,
|
|
4623
|
-
roomName,
|
|
4624
|
-
userAgent,
|
|
4625
|
-
externalId }, (clientClaim && { clientClaim })));
|
|
4626
|
-
dispatch(connectionStatusChanged("connecting"));
|
|
4627
|
-
});
|
|
4628
|
-
const selectShouldConnectRoom = createSelector([
|
|
4629
|
-
selectAppIsActive,
|
|
4630
|
-
selectOrganizationId,
|
|
4631
|
-
selectRoomConnectionStatus,
|
|
4632
|
-
selectSignalConnectionDeviceIdentified,
|
|
4633
|
-
selectLocalMediaStatus,
|
|
4634
|
-
selectRoomConnectionError,
|
|
4635
|
-
], (appIsActive, hasOrganizationIdFetched, roomConnectionStatus, signalConnectionDeviceIdentified, localMediaStatus, roomConnectionError) => {
|
|
4636
|
-
if (appIsActive &&
|
|
4637
|
-
localMediaStatus === "started" &&
|
|
4638
|
-
signalConnectionDeviceIdentified &&
|
|
4639
|
-
!!hasOrganizationIdFetched &&
|
|
4640
|
-
["ready", "reconnecting", "disconnected"].includes(roomConnectionStatus) &&
|
|
4641
|
-
!roomConnectionError) {
|
|
4642
|
-
return true;
|
|
4643
|
-
}
|
|
4644
|
-
return false;
|
|
4645
|
-
});
|
|
4646
|
-
createReactor([selectShouldConnectRoom], ({ dispatch }, shouldConnectRoom) => {
|
|
4647
|
-
if (shouldConnectRoom) {
|
|
4648
|
-
dispatch(doConnectRoom());
|
|
4649
|
-
}
|
|
4650
|
-
});
|
|
4651
|
-
startAppListening({
|
|
4652
|
-
actionCreator: signalEvents.knockHandled,
|
|
4653
|
-
effect: ({ payload }, { dispatch, getState }) => {
|
|
4654
|
-
var _a, _b;
|
|
4655
|
-
const { clientId, resolution } = payload;
|
|
4656
|
-
const state = getState();
|
|
4657
|
-
const selfId = selectSelfId(state);
|
|
4658
|
-
if (clientId !== selfId) {
|
|
4659
|
-
return;
|
|
4660
|
-
}
|
|
4661
|
-
if (resolution === "accepted") {
|
|
4662
|
-
dispatch(setRoomKey(payload.metadata.roomKey));
|
|
4663
|
-
dispatch(doConnectRoom());
|
|
4664
|
-
}
|
|
4665
|
-
else if (resolution === "on_hold") {
|
|
4666
|
-
dispatch(knockResponseReceived((_a = payload.knockResponse) !== null && _a !== void 0 ? _a : null));
|
|
4667
|
-
dispatch(connectionStatusChanged("knock_on_hold"));
|
|
4668
|
-
}
|
|
4669
|
-
else if (resolution === "rejected") {
|
|
4670
|
-
dispatch(knockResponseReceived((_b = payload.knockResponse) !== null && _b !== void 0 ? _b : null));
|
|
4671
|
-
dispatch(connectionStatusChanged("knock_rejected"));
|
|
4672
|
-
}
|
|
4673
|
-
},
|
|
4674
|
-
});
|
|
4675
|
-
startAppListening({
|
|
4676
|
-
actionCreator: signalEvents.clientKicked,
|
|
4677
|
-
effect: (_, { dispatch }) => {
|
|
4678
|
-
dispatch(doAppStop());
|
|
4679
|
-
},
|
|
4680
|
-
});
|
|
4681
|
-
startAppListening({
|
|
4682
|
-
actionCreator: doAppStop,
|
|
4683
|
-
effect: (_, { dispatch, getState }) => {
|
|
4684
|
-
const state = getState();
|
|
4685
|
-
const roomConnectionStatus = selectRoomConnectionStatus(state);
|
|
4686
|
-
if (roomConnectionStatus === "connected") {
|
|
4687
|
-
const socket = selectSignalConnectionRaw(state).socket;
|
|
4688
|
-
socket === null || socket === void 0 ? void 0 : socket.emit("leave_room");
|
|
4689
|
-
dispatch(connectionStatusChanged("leaving"));
|
|
4690
|
-
}
|
|
4691
|
-
else {
|
|
4692
|
-
doSignalDisconnect();
|
|
4693
|
-
}
|
|
4694
|
-
},
|
|
4695
|
-
});
|
|
4696
|
-
|
|
4697
4985
|
function isCustomElementName(value) {
|
|
4698
4986
|
return typeof value === "string" && value === value.toLowerCase() && value.includes("-");
|
|
4699
4987
|
}
|
|
@@ -6059,6 +6347,7 @@ const LIVE_CAPTIONS_STATUS_CHANGED = "live-captions:status-changed";
|
|
|
6059
6347
|
const LIVE_TRANSCRIPTION_STATUS_CHANGED = "live-transcription:status-changed";
|
|
6060
6348
|
const CONNECTION_ERROR_CHANGED = "connection:error-changed";
|
|
6061
6349
|
const AUDIO_ONLY_MODE_CHANGED = "audio-only-mode:changed";
|
|
6350
|
+
const REMOTE_PARTICIPANT_QUALITY_REPORT_CHANGED = "remote-participant-quality-report:changed";
|
|
6062
6351
|
const LOCAL_PARTICIPANT_CHANGED = "local-participant:changed";
|
|
6063
6352
|
const LOCAL_SCREENSHARE_STATUS_CHANGED = "local-screenshare:status-changed";
|
|
6064
6353
|
const LOCAL_SCREENSHARE_CHANGED = "local-screenshare:state-changed";
|
|
@@ -6075,8 +6364,10 @@ const SPOTLIGHT_PARTICIPANT_ADDED = "spotlight:participant-added";
|
|
|
6075
6364
|
const SPOTLIGHT_PARTICIPANT_REMOVED = "spotlight:participant-removed";
|
|
6076
6365
|
const ROOM_JOINED = "room:joined";
|
|
6077
6366
|
const ROOM_JOINED_ERROR = "room:joined:error";
|
|
6367
|
+
const ROOM_REJOINED = "room:rejoined";
|
|
6078
6368
|
|
|
6079
|
-
const
|
|
6369
|
+
const EMPTY_REMOTE_PARTICIPANT_QUALITY_REPORT = Object.freeze({});
|
|
6370
|
+
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, (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) => {
|
|
6080
6371
|
const broadcastingParticipants = breakoutActive && breakoutCurrentId
|
|
6081
6372
|
? spotlightedClientViews.filter((c) => !c.breakoutGroup && c.isAudioEnabled && !c.isPresentation)
|
|
6082
6373
|
: [];
|
|
@@ -6111,6 +6402,7 @@ const selectRoomConnectionState = createSelector(selectChatMessages, selectFileU
|
|
|
6111
6402
|
participantsInCurrentGroup: clientViewsInCurrentGroup,
|
|
6112
6403
|
broadcastingParticipants,
|
|
6113
6404
|
},
|
|
6405
|
+
remoteParticipantQualityReport: remoteParticipantQualityReport !== null && remoteParticipantQualityReport !== void 0 ? remoteParticipantQualityReport : EMPTY_REMOTE_PARTICIPANT_QUALITY_REPORT,
|
|
6114
6406
|
connectionStatus,
|
|
6115
6407
|
connectionError,
|
|
6116
6408
|
knockResponse,
|
|
@@ -6181,6 +6473,7 @@ class RoomConnectionClient extends BaseClient {
|
|
|
6181
6473
|
this.cloudRecordingSubscribers = new Set();
|
|
6182
6474
|
this.connectionErrorSubscribers = new Set();
|
|
6183
6475
|
this.audioOnlyModeSubscribers = new Set();
|
|
6476
|
+
this.remoteParticipantQualityReportSubscribers = new Set();
|
|
6184
6477
|
this.connectionStatusSubscribers = new Set();
|
|
6185
6478
|
this.liveStreamSubscribers = new Set();
|
|
6186
6479
|
this.liveCaptionsSubscribers = new Set();
|
|
@@ -6232,6 +6525,10 @@ class RoomConnectionClient extends BaseClient {
|
|
|
6232
6525
|
this.audioOnlyModeSubscribers.forEach((cb) => cb(state.isAudioOnlyModeEnabled));
|
|
6233
6526
|
this.emit(AUDIO_ONLY_MODE_CHANGED, state.isAudioOnlyModeEnabled);
|
|
6234
6527
|
}
|
|
6528
|
+
if (state.remoteParticipantQualityReport !== previousState.remoteParticipantQualityReport) {
|
|
6529
|
+
this.remoteParticipantQualityReportSubscribers.forEach((cb) => cb(state.remoteParticipantQualityReport));
|
|
6530
|
+
this.emit(REMOTE_PARTICIPANT_QUALITY_REPORT_CHANGED, state.remoteParticipantQualityReport);
|
|
6531
|
+
}
|
|
6235
6532
|
if (state.isCameraEnabled !== previousState.isCameraEnabled) {
|
|
6236
6533
|
this.cameraStateSubscribers.forEach((cb) => cb(state.isCameraEnabled));
|
|
6237
6534
|
this.emit(CAMERA_STATE_CHANGED, state.isCameraEnabled);
|
|
@@ -6315,6 +6612,17 @@ class RoomConnectionClient extends BaseClient {
|
|
|
6315
6612
|
});
|
|
6316
6613
|
},
|
|
6317
6614
|
});
|
|
6615
|
+
startAppListening({
|
|
6616
|
+
actionCreator: roomRejoined,
|
|
6617
|
+
effect: ({ payload }) => {
|
|
6618
|
+
const { selfId, previousSelfId } = payload;
|
|
6619
|
+
this.emit(ROOM_REJOINED, {
|
|
6620
|
+
selfId,
|
|
6621
|
+
previousSelfId,
|
|
6622
|
+
selfIdChanged: selfId !== previousSelfId,
|
|
6623
|
+
});
|
|
6624
|
+
},
|
|
6625
|
+
});
|
|
6318
6626
|
startAppListening({
|
|
6319
6627
|
actionCreator: signalEvents.chatMessage,
|
|
6320
6628
|
effect: ({ payload }) => {
|
|
@@ -6358,6 +6666,10 @@ class RoomConnectionClient extends BaseClient {
|
|
|
6358
6666
|
this.audioOnlyModeSubscribers.add(callback);
|
|
6359
6667
|
return () => this.audioOnlyModeSubscribers.delete(callback);
|
|
6360
6668
|
}
|
|
6669
|
+
subscribeToRemoteParticipantQualityReport(callback) {
|
|
6670
|
+
this.remoteParticipantQualityReportSubscribers.add(callback);
|
|
6671
|
+
return () => this.remoteParticipantQualityReportSubscribers.delete(callback);
|
|
6672
|
+
}
|
|
6361
6673
|
subscribeToLiveStream(callback) {
|
|
6362
6674
|
this.liveStreamSubscribers.add(callback);
|
|
6363
6675
|
return () => this.liveStreamSubscribers.delete(callback);
|
|
@@ -6680,6 +6992,7 @@ class RoomConnectionClient extends BaseClient {
|
|
|
6680
6992
|
this.cloudRecordingSubscribers.clear();
|
|
6681
6993
|
this.connectionErrorSubscribers.clear();
|
|
6682
6994
|
this.audioOnlyModeSubscribers.clear();
|
|
6995
|
+
this.remoteParticipantQualityReportSubscribers.clear();
|
|
6683
6996
|
this.connectionStatusSubscribers.clear();
|
|
6684
6997
|
this.liveStreamSubscribers.clear();
|
|
6685
6998
|
this.localParticipantSubscribers.clear();
|
|
@@ -6720,4 +7033,4 @@ class WherebyClient {
|
|
|
6720
7033
|
}
|
|
6721
7034
|
}
|
|
6722
7035
|
|
|
6723
|
-
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, ROOM_INTEGRATION_PICKER_MESSAGES, ROOM_JOINED, ROOM_JOINED_ERROR, 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 };
|
|
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 };
|