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