@whereby.com/core 1.16.3 → 1.18.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 +714 -409
- package/dist/index.d.cts +90 -9
- package/dist/index.d.mts +90 -9
- package/dist/index.d.ts +90 -9
- package/dist/index.mjs +710 -410
- package/dist/legacy-esm.js +710 -410
- package/dist/redux/index.cjs +708 -429
- package/dist/redux/index.d.cts +352 -35
- package/dist/redux/index.d.mts +352 -35
- package/dist/redux/index.d.ts +352 -35
- package/dist/redux/index.js +676 -430
- package/dist/redux/index.mjs +676 -430
- package/package.json +4 -4
package/dist/redux/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createAsyncThunk, createListenerMiddleware, addListener, createSlice, createAction, createSelector, isAnyOf, combineReducers, configureStore } from '@reduxjs/toolkit';
|
|
2
2
|
import { ServerSocket, isFileShareError, getDeviceData, getStream, getUpdatedDevices, replaceTracksInStream, getDisplayMedia, CAMERA_STREAM_ID, RtcManagerDispatcher, setClientProvider, subscribeIssues, assert, fromLocation } from '@whereby.com/media';
|
|
3
|
-
import { v4 } from 'uuid';
|
|
4
3
|
import { EventEmitter } from 'events';
|
|
4
|
+
import { v4 } from 'uuid';
|
|
5
5
|
import nodeBtoa from 'btoa';
|
|
6
6
|
import axios from 'axios';
|
|
7
7
|
|
|
@@ -74,7 +74,7 @@ const createReactor = (selectors, callback) => {
|
|
|
74
74
|
});
|
|
75
75
|
};
|
|
76
76
|
|
|
77
|
-
const coreVersion = "1.
|
|
77
|
+
const coreVersion = "1.18.0";
|
|
78
78
|
|
|
79
79
|
function decodeRoomName(roomName) {
|
|
80
80
|
if (!roomName) {
|
|
@@ -139,6 +139,9 @@ const signalEvents = {
|
|
|
139
139
|
breakoutMoveToGroup: createSignalEventAction("breakoutMoveToGroup"),
|
|
140
140
|
breakoutMoveToMain: createSignalEventAction("breakoutMoveToMain"),
|
|
141
141
|
breakoutSessionUpdated: createSignalEventAction("breakoutSessionUpdated"),
|
|
142
|
+
breakoutEnding: createSignalEventAction("breakoutEnding"),
|
|
143
|
+
breakoutTimerEnded: createSignalEventAction("breakoutTimerEnded"),
|
|
144
|
+
breakoutTimerExtended: createSignalEventAction("breakoutTimerExtended"),
|
|
142
145
|
chatMessage: createSignalEventAction("chatMessage"),
|
|
143
146
|
chatMessageRemoved: createSignalEventAction("chatMessageRemoved"),
|
|
144
147
|
fileSharingError: createSignalEventAction("fileSharingError"),
|
|
@@ -179,6 +182,7 @@ const ROOM_ACTION_PERMISSIONS_BY_ROLE = {
|
|
|
179
182
|
canEndMeeting: ["host"],
|
|
180
183
|
canAskToSpeak: ["host"],
|
|
181
184
|
canSpotlight: ["host"],
|
|
185
|
+
canManageBreakout: ["host"],
|
|
182
186
|
};
|
|
183
187
|
const authorizationSliceInitialState = {
|
|
184
188
|
roomKey: null,
|
|
@@ -221,6 +225,7 @@ const selectIsAuthorizedToKickClient = createSelector(selectAuthorizationRoleNam
|
|
|
221
225
|
const selectIsAuthorizedToEndMeeting = createSelector(selectAuthorizationRoleName, (localParticipantRole) => ROOM_ACTION_PERMISSIONS_BY_ROLE.canEndMeeting.includes(localParticipantRole));
|
|
222
226
|
const selectIsAuthorizedToAskToSpeak = createSelector(selectAuthorizationRoleName, (localParticipantRole) => ROOM_ACTION_PERMISSIONS_BY_ROLE.canAskToSpeak.includes(localParticipantRole));
|
|
223
227
|
const selectIsAuthorizedToSpotlight = createSelector(selectAuthorizationRoleName, (localParticipantRole) => ROOM_ACTION_PERMISSIONS_BY_ROLE.canSpotlight.includes(localParticipantRole));
|
|
228
|
+
const selectIsAuthorizedToManageBreakout = createSelector(selectAuthorizationRoleName, (localParticipantRole) => ROOM_ACTION_PERMISSIONS_BY_ROLE.canManageBreakout.includes(localParticipantRole));
|
|
224
229
|
|
|
225
230
|
/******************************************************************************
|
|
226
231
|
Copyright (c) Microsoft Corporation.
|
|
@@ -352,6 +357,9 @@ function forwardSocketEvents(socket, dispatch) {
|
|
|
352
357
|
socket.on("breakout_session_updated", (payload) => dispatch(signalEvents.breakoutSessionUpdated(payload)));
|
|
353
358
|
socket.on("breakout_move_to_group", () => dispatch(signalEvents.breakoutMoveToGroup()));
|
|
354
359
|
socket.on("breakout_move_to_main", () => dispatch(signalEvents.breakoutMoveToMain()));
|
|
360
|
+
socket.on("breakout_ending", () => dispatch(signalEvents.breakoutEnding()));
|
|
361
|
+
socket.on("breakout_timer_ended", () => dispatch(signalEvents.breakoutTimerEnded()));
|
|
362
|
+
socket.on("breakout_timer_extended", () => dispatch(signalEvents.breakoutTimerExtended()));
|
|
355
363
|
}
|
|
356
364
|
const SIGNAL_BASE_URL = "wss://signal.appearin.net";
|
|
357
365
|
function createSocket() {
|
|
@@ -1074,208 +1082,6 @@ const selectLocalParticipantView = createSelector(selectLocalParticipantRaw, sel
|
|
|
1074
1082
|
return clientView;
|
|
1075
1083
|
});
|
|
1076
1084
|
|
|
1077
|
-
function createBreakout({ assignments, groups, startedAt, initiatedBy, breakoutStartedAt, breakoutEndedAt, breakoutNotification, breakoutTimerDuration, autoMoveToGroup, moveToGroupGracePeriod, autoMoveToMain, moveToMainGracePeriod, enforceAssignment, breakoutTimerSetting, } = {}) {
|
|
1078
|
-
return {
|
|
1079
|
-
assignments: assignments || null,
|
|
1080
|
-
groups: groups || null,
|
|
1081
|
-
startedAt: startedAt ? new Date(startedAt) : null,
|
|
1082
|
-
initiatedBy,
|
|
1083
|
-
breakoutStartedAt: breakoutStartedAt || null,
|
|
1084
|
-
breakoutEndedAt: breakoutEndedAt || null,
|
|
1085
|
-
breakoutNotification: breakoutNotification || null,
|
|
1086
|
-
breakoutTimerDuration: breakoutTimerDuration || 1800,
|
|
1087
|
-
autoMoveToGroup: autoMoveToGroup || false,
|
|
1088
|
-
moveToGroupGracePeriod: moveToGroupGracePeriod || 10,
|
|
1089
|
-
autoMoveToMain: autoMoveToMain || false,
|
|
1090
|
-
moveToMainGracePeriod: moveToMainGracePeriod || 30,
|
|
1091
|
-
enforceAssignment: enforceAssignment || false,
|
|
1092
|
-
breakoutTimerSetting: breakoutTimerSetting || false,
|
|
1093
|
-
};
|
|
1094
|
-
}
|
|
1095
|
-
const breakoutSliceInitialState = Object.assign(Object.assign({}, createBreakout()), { groupId: null });
|
|
1096
|
-
const breakoutSlice = createSlice({
|
|
1097
|
-
name: "breakout",
|
|
1098
|
-
initialState: breakoutSliceInitialState,
|
|
1099
|
-
reducers: {},
|
|
1100
|
-
extraReducers: (builder) => {
|
|
1101
|
-
builder.addCase(signalEvents.roomJoined, (state, action) => {
|
|
1102
|
-
if ("error" in action.payload) {
|
|
1103
|
-
return state;
|
|
1104
|
-
}
|
|
1105
|
-
const { breakout } = action.payload || {};
|
|
1106
|
-
if (breakout) {
|
|
1107
|
-
return Object.assign(Object.assign({}, state), createBreakout(breakout));
|
|
1108
|
-
}
|
|
1109
|
-
return state;
|
|
1110
|
-
});
|
|
1111
|
-
builder.addCase(signalEvents.breakoutSessionUpdated, (state, action) => {
|
|
1112
|
-
return Object.assign(Object.assign({}, state), createBreakout(action.payload));
|
|
1113
|
-
});
|
|
1114
|
-
builder.addCase(signalEvents.breakoutGroupJoined, (state, action) => {
|
|
1115
|
-
var _a;
|
|
1116
|
-
if (((_a = action.meta) === null || _a === void 0 ? void 0 : _a.localParticipantId) !== action.payload.clientId) {
|
|
1117
|
-
return state;
|
|
1118
|
-
}
|
|
1119
|
-
return Object.assign(Object.assign({}, state), { groupId: action.payload.group });
|
|
1120
|
-
});
|
|
1121
|
-
},
|
|
1122
|
-
});
|
|
1123
|
-
const doBreakoutJoin = createAppThunk((payload) => (_, getState) => {
|
|
1124
|
-
const state = getState();
|
|
1125
|
-
const { socket } = selectSignalConnectionRaw(state);
|
|
1126
|
-
socket === null || socket === void 0 ? void 0 : socket.emit("join_breakout_group", { group: payload.group });
|
|
1127
|
-
});
|
|
1128
|
-
const selectBreakoutRaw = (state) => state.breakout;
|
|
1129
|
-
const selectBreakoutInitiatedBy = (state) => state.breakout.initiatedBy;
|
|
1130
|
-
const selectBreakoutActive = (state) => !!state.breakout.startedAt;
|
|
1131
|
-
const selectBreakoutAssignments = (state) => state.breakout.assignments;
|
|
1132
|
-
const selectBreakoutGroups = (state) => state.breakout.groups;
|
|
1133
|
-
const selectBreakoutCurrentId = createSelector(selectBreakoutRaw, selectLocalParticipantBreakoutGroup, (raw, localParticipantBreakoutGroup) => {
|
|
1134
|
-
return raw.groupId || localParticipantBreakoutGroup || "";
|
|
1135
|
-
});
|
|
1136
|
-
const selectBreakoutCurrentGroup = createSelector(selectBreakoutRaw, selectBreakoutCurrentId, (raw, breakoutCurrentId) => {
|
|
1137
|
-
var _a;
|
|
1138
|
-
const name = (_a = raw.groups) === null || _a === void 0 ? void 0 : _a[breakoutCurrentId];
|
|
1139
|
-
if (!name)
|
|
1140
|
-
return null;
|
|
1141
|
-
return { id: breakoutCurrentId, name };
|
|
1142
|
-
});
|
|
1143
|
-
startAppListening({
|
|
1144
|
-
actionCreator: signalEvents.breakoutMoveToGroup,
|
|
1145
|
-
effect: (_, { dispatch, getState }) => {
|
|
1146
|
-
const state = getState();
|
|
1147
|
-
const localParticipant = selectLocalParticipantRaw(state);
|
|
1148
|
-
const breakoutGroupAssigned = localParticipant.breakoutGroupAssigned;
|
|
1149
|
-
if (breakoutGroupAssigned) {
|
|
1150
|
-
dispatch(doBreakoutJoin({ group: breakoutGroupAssigned }));
|
|
1151
|
-
}
|
|
1152
|
-
},
|
|
1153
|
-
});
|
|
1154
|
-
startAppListening({
|
|
1155
|
-
actionCreator: signalEvents.breakoutMoveToMain,
|
|
1156
|
-
effect: (_, { dispatch }) => {
|
|
1157
|
-
dispatch(doBreakoutJoin({ group: "" }));
|
|
1158
|
-
},
|
|
1159
|
-
});
|
|
1160
|
-
startAppListening({
|
|
1161
|
-
actionCreator: signalEvents.breakoutSessionUpdated,
|
|
1162
|
-
effect: ({ payload }, { dispatch, getState }) => {
|
|
1163
|
-
var _a;
|
|
1164
|
-
const state = getState();
|
|
1165
|
-
const autoMoveToMain = selectBreakoutRaw(state).autoMoveToMain;
|
|
1166
|
-
if (((_a = payload.initiatedBy) === null || _a === void 0 ? void 0 : _a.active) === false) {
|
|
1167
|
-
if (!autoMoveToMain) {
|
|
1168
|
-
dispatch(doBreakoutJoin({ group: "" }));
|
|
1169
|
-
}
|
|
1170
|
-
}
|
|
1171
|
-
},
|
|
1172
|
-
});
|
|
1173
|
-
|
|
1174
|
-
const chatSliceInitialState = {
|
|
1175
|
-
chatMessages: [],
|
|
1176
|
-
};
|
|
1177
|
-
const chatSlice = createSlice({
|
|
1178
|
-
name: "chat",
|
|
1179
|
-
initialState: chatSliceInitialState,
|
|
1180
|
-
reducers: {},
|
|
1181
|
-
extraReducers(builder) {
|
|
1182
|
-
builder.addCase(signalEvents.chatMessage, (state, action) => {
|
|
1183
|
-
const message = Object.assign({ id: action.payload.id, senderId: action.payload.senderId, parentId: action.payload.parentId, timestamp: action.payload.timestamp, text: action.payload.text, sig: action.payload.sig, removed: false }, (action.payload.file && { file: action.payload.file }));
|
|
1184
|
-
return Object.assign(Object.assign({}, state), { chatMessages: [...state.chatMessages, message] });
|
|
1185
|
-
});
|
|
1186
|
-
builder.addCase(signalEvents.chatMessageRemoved, (state, action) => {
|
|
1187
|
-
return Object.assign(Object.assign({}, state), { chatMessages: state.chatMessages.map((m) => {
|
|
1188
|
-
return Object.assign(Object.assign({}, m), (m.id === action.payload.id && {
|
|
1189
|
-
removed: true,
|
|
1190
|
-
}));
|
|
1191
|
-
}) });
|
|
1192
|
-
});
|
|
1193
|
-
},
|
|
1194
|
-
});
|
|
1195
|
-
const doSendChatMessage = createRoomConnectedThunk((payload) => (_, getState) => {
|
|
1196
|
-
const state = getState();
|
|
1197
|
-
const socket = selectSignalConnectionRaw(state).socket;
|
|
1198
|
-
const breakoutCurrentId = selectBreakoutCurrentId(state);
|
|
1199
|
-
socket === null || socket === void 0 ? void 0 : socket.emit("chat_message", Object.assign(Object.assign(Object.assign({ text: payload.text }, (payload.parentId && { parentId: payload.parentId })), (breakoutCurrentId && { breakoutGroup: breakoutCurrentId })), (payload.isBroadcast && { broadcast: true })));
|
|
1200
|
-
});
|
|
1201
|
-
const doRemoveChatMessage = createRoomConnectedThunk(({ id, sig }) => (_, getState) => {
|
|
1202
|
-
const state = getState();
|
|
1203
|
-
const socket = selectSignalConnectionRaw(state).socket;
|
|
1204
|
-
socket === null || socket === void 0 ? void 0 : socket.emit("remove_chat_message", {
|
|
1205
|
-
id,
|
|
1206
|
-
sig,
|
|
1207
|
-
});
|
|
1208
|
-
});
|
|
1209
|
-
const selectChatRaw = (state) => state.chat;
|
|
1210
|
-
const selectChatMessages = (state) => state.chat.chatMessages;
|
|
1211
|
-
|
|
1212
|
-
const initialCloudRecordingState = {
|
|
1213
|
-
isInitiator: false,
|
|
1214
|
-
isRecording: false,
|
|
1215
|
-
startedAt: undefined,
|
|
1216
|
-
};
|
|
1217
|
-
const cloudRecordingSlice = createSlice({
|
|
1218
|
-
name: "cloudRecording",
|
|
1219
|
-
initialState: initialCloudRecordingState,
|
|
1220
|
-
reducers: {
|
|
1221
|
-
recordingRequestStarted: (state) => {
|
|
1222
|
-
return Object.assign(Object.assign({}, state), { isInitiator: true, status: "requested" });
|
|
1223
|
-
},
|
|
1224
|
-
},
|
|
1225
|
-
extraReducers: (builder) => {
|
|
1226
|
-
builder.addCase(signalEvents.cloudRecordingStopped, (state) => {
|
|
1227
|
-
return Object.assign(Object.assign({}, state), { isInitiator: false, isRecording: false, status: undefined });
|
|
1228
|
-
});
|
|
1229
|
-
builder.addCase(signalEvents.cloudRecordingStarted, (state, action) => {
|
|
1230
|
-
const { payload } = action;
|
|
1231
|
-
if (!payload.error) {
|
|
1232
|
-
return state;
|
|
1233
|
-
}
|
|
1234
|
-
return Object.assign(Object.assign({}, state), { isInitiator: false, isRecording: false, status: "error", error: payload.error });
|
|
1235
|
-
});
|
|
1236
|
-
builder.addCase(signalEvents.newClient, (state, { payload }) => {
|
|
1237
|
-
var _a;
|
|
1238
|
-
const { client } = payload;
|
|
1239
|
-
if (((_a = client.role) === null || _a === void 0 ? void 0 : _a.roleName) === "recorder") {
|
|
1240
|
-
return Object.assign(Object.assign({}, state), { isRecording: true, status: "recording", startedAt: client.startedCloudRecordingAt
|
|
1241
|
-
? new Date(client.startedCloudRecordingAt).getTime()
|
|
1242
|
-
: new Date().getTime() });
|
|
1243
|
-
}
|
|
1244
|
-
return state;
|
|
1245
|
-
});
|
|
1246
|
-
},
|
|
1247
|
-
});
|
|
1248
|
-
const { recordingRequestStarted } = cloudRecordingSlice.actions;
|
|
1249
|
-
const doStartCloudRecording = createRoomConnectedThunk(() => (dispatch, getState) => {
|
|
1250
|
-
const state = getState();
|
|
1251
|
-
const socket = selectSignalConnectionRaw(state).socket;
|
|
1252
|
-
const status = selectCloudRecordingStatus(state);
|
|
1253
|
-
if (status && ["recording", "requested"].includes(status)) {
|
|
1254
|
-
return;
|
|
1255
|
-
}
|
|
1256
|
-
socket === null || socket === void 0 ? void 0 : socket.emit("start_recording", {
|
|
1257
|
-
recording: "cloud",
|
|
1258
|
-
});
|
|
1259
|
-
dispatch(recordingRequestStarted());
|
|
1260
|
-
});
|
|
1261
|
-
const doStopCloudRecording = createRoomConnectedThunk(() => (dispatch, getState) => {
|
|
1262
|
-
const state = getState();
|
|
1263
|
-
const socket = selectSignalConnectionRaw(state).socket;
|
|
1264
|
-
socket === null || socket === void 0 ? void 0 : socket.emit("stop_recording");
|
|
1265
|
-
});
|
|
1266
|
-
const selectCloudRecordingRaw = (state) => state.cloudRecording;
|
|
1267
|
-
const selectCloudRecordingStatus = (state) => state.cloudRecording.status;
|
|
1268
|
-
const selectCloudRecordingStartedAt = (state) => state.cloudRecording.startedAt;
|
|
1269
|
-
const selectCloudRecordingError = (state) => state.cloudRecording.error;
|
|
1270
|
-
const selectIsCloudRecording = (state) => state.cloudRecording.isRecording;
|
|
1271
|
-
const selectCloudRecordingIsInitiator = (state) => state.cloudRecording.isInitiator;
|
|
1272
|
-
|
|
1273
|
-
const selectRoomConnectionRaw = (state) => state.roomConnection;
|
|
1274
|
-
const selectRoomConnectionSession = (state) => state.roomConnection.session;
|
|
1275
|
-
const selectRoomConnectionSessionId = (state) => { var _a; return (_a = state.roomConnection.session) === null || _a === void 0 ? void 0 : _a.id; };
|
|
1276
|
-
const selectRoomConnectionStatus = (state) => state.roomConnection.status;
|
|
1277
|
-
const selectRoomConnectionError = (state) => state.roomConnection.error;
|
|
1278
|
-
|
|
1279
1085
|
function createRtcEventAction(name) {
|
|
1280
1086
|
return createAction(`rtcConnection/event/${name}`);
|
|
1281
1087
|
}
|
|
@@ -1438,60 +1244,638 @@ const remoteParticipantsSlice = createSlice({
|
|
|
1438
1244
|
isVideoEnabled,
|
|
1439
1245
|
});
|
|
1440
1246
|
});
|
|
1441
|
-
builder.addCase(signalEvents.clientMetadataReceived, (state, action) => {
|
|
1442
|
-
const { error, payload } = action.payload;
|
|
1443
|
-
if (error || !payload) {
|
|
1444
|
-
console.warn(error || "Client metadata error received");
|
|
1247
|
+
builder.addCase(signalEvents.clientMetadataReceived, (state, action) => {
|
|
1248
|
+
const { error, payload } = action.payload;
|
|
1249
|
+
if (error || !payload) {
|
|
1250
|
+
console.warn(error || "Client metadata error received");
|
|
1251
|
+
return state;
|
|
1252
|
+
}
|
|
1253
|
+
const { clientId, displayName, stickyReaction } = payload;
|
|
1254
|
+
return updateParticipant(state, clientId, {
|
|
1255
|
+
displayName,
|
|
1256
|
+
stickyReaction,
|
|
1257
|
+
});
|
|
1258
|
+
});
|
|
1259
|
+
builder.addCase(signalEvents.breakoutGroupJoined, (state, action) => {
|
|
1260
|
+
const { clientId, group } = action.payload;
|
|
1261
|
+
if (!findParticipant(state, clientId).participant) {
|
|
1262
|
+
return state;
|
|
1263
|
+
}
|
|
1264
|
+
return updateParticipant(state, clientId, {
|
|
1265
|
+
breakoutGroup: group || null,
|
|
1266
|
+
});
|
|
1267
|
+
});
|
|
1268
|
+
builder.addCase(signalEvents.screenshareStarted, (state, action) => {
|
|
1269
|
+
const { clientId, streamId } = action.payload;
|
|
1270
|
+
return addStreamId(state, clientId, streamId);
|
|
1271
|
+
});
|
|
1272
|
+
builder.addCase(signalEvents.screenshareStopped, (state, action) => {
|
|
1273
|
+
const { clientId, streamId } = action.payload;
|
|
1274
|
+
return removeStreamId(state, clientId, streamId);
|
|
1275
|
+
});
|
|
1276
|
+
},
|
|
1277
|
+
});
|
|
1278
|
+
const { participantStreamAdded, participantStreamIdAdded, streamStatusUpdated } = remoteParticipantsSlice.actions;
|
|
1279
|
+
const doRequestAudioEnable = createAuthorizedRoomConnectedThunk((state) => selectIsAuthorizedToRequestAudioEnable(state), (payload) => (_, getState) => {
|
|
1280
|
+
const state = getState();
|
|
1281
|
+
const canEnableRemoteAudio = selectIsAuthorizedToAskToSpeak(state);
|
|
1282
|
+
if (payload.enable && !canEnableRemoteAudio) {
|
|
1283
|
+
console.warn("Not authorized to perform this action");
|
|
1284
|
+
return;
|
|
1285
|
+
}
|
|
1286
|
+
const socket = selectSignalConnectionRaw(state).socket;
|
|
1287
|
+
socket === null || socket === void 0 ? void 0 : socket.emit("request_audio_enable", payload);
|
|
1288
|
+
});
|
|
1289
|
+
const doRequestVideoEnable = createAuthorizedRoomConnectedThunk((state) => selectIsAuthorizedToRequestVideoEnable(state), (payload) => (_, getState) => {
|
|
1290
|
+
const state = getState();
|
|
1291
|
+
const socket = selectSignalConnectionRaw(state).socket;
|
|
1292
|
+
socket === null || socket === void 0 ? void 0 : socket.emit("request_video_enable", payload);
|
|
1293
|
+
});
|
|
1294
|
+
const selectRemoteParticipantsRaw = (state) => state.remoteParticipants;
|
|
1295
|
+
const selectRemoteClients = (state) => state.remoteParticipants.remoteParticipants;
|
|
1296
|
+
const selectRemoteParticipants = createSelector(selectRemoteClients, (clients) => clients.filter((c) => !NON_PERSON_ROLES.includes(c.roleName)));
|
|
1297
|
+
const selectNumClients = createSelector(selectRemoteClients, (clients) => clients.length + 1);
|
|
1298
|
+
const selectNumParticipants = createSelector(selectRemoteParticipants, selectLocalParticipantRaw, (clients, localParticipant) => {
|
|
1299
|
+
if (NON_PERSON_ROLES.includes(localParticipant.roleName)) {
|
|
1300
|
+
return clients.length;
|
|
1301
|
+
}
|
|
1302
|
+
return clients.length + 1;
|
|
1303
|
+
});
|
|
1304
|
+
|
|
1305
|
+
const selectRoomConnectionRaw = (state) => state.roomConnection;
|
|
1306
|
+
const selectRoomConnectionSession = (state) => state.roomConnection.session;
|
|
1307
|
+
const selectRoomConnectionSessionId = (state) => { var _a; return (_a = state.roomConnection.session) === null || _a === void 0 ? void 0 : _a.id; };
|
|
1308
|
+
const selectRoomConnectionStatus = (state) => state.roomConnection.status;
|
|
1309
|
+
const selectRoomConnectionError = (state) => state.roomConnection.error;
|
|
1310
|
+
const selectRoomConnectionKnockResponse = (state) => state.roomConnection.knockResponse;
|
|
1311
|
+
|
|
1312
|
+
const emitter = new EventEmitter();
|
|
1313
|
+
function createNotificationEvent(payload) {
|
|
1314
|
+
const notificationEvent = Object.assign(Object.assign({}, payload), { timestamp: Date.now() });
|
|
1315
|
+
return notificationEvent;
|
|
1316
|
+
}
|
|
1317
|
+
const initialNotificationsState = {
|
|
1318
|
+
emitter,
|
|
1319
|
+
events: [],
|
|
1320
|
+
};
|
|
1321
|
+
const notificationsSlice = createSlice({
|
|
1322
|
+
name: "notifications",
|
|
1323
|
+
initialState: initialNotificationsState,
|
|
1324
|
+
reducers: {
|
|
1325
|
+
addNotification: (state, action) => {
|
|
1326
|
+
return Object.assign(Object.assign({}, state), { events: [...state.events, Object.assign({}, action.payload)] });
|
|
1327
|
+
},
|
|
1328
|
+
doClearNotifications: (state) => {
|
|
1329
|
+
return Object.assign(Object.assign({}, state), { events: [] });
|
|
1330
|
+
},
|
|
1331
|
+
},
|
|
1332
|
+
});
|
|
1333
|
+
const { doClearNotifications } = notificationsSlice.actions;
|
|
1334
|
+
const doSetNotification = createAppThunk((payload) => (dispatch, getState) => {
|
|
1335
|
+
dispatch(notificationsSlice.actions.addNotification(payload));
|
|
1336
|
+
const state = getState();
|
|
1337
|
+
const emitter = selectNotificationsEmitter(state);
|
|
1338
|
+
emitter.emit(payload.type, payload);
|
|
1339
|
+
emitter.emit("*", payload);
|
|
1340
|
+
});
|
|
1341
|
+
const selectNotificationsRaw = (state) => state.notifications;
|
|
1342
|
+
const selectNotificationsEvents = (state) => state.notifications.events;
|
|
1343
|
+
const selectNotificationsEmitter = (state) => state.notifications.emitter;
|
|
1344
|
+
startAppListening({
|
|
1345
|
+
actionCreator: signalEvents.chatMessage,
|
|
1346
|
+
effect: ({ payload }, { dispatch, getState }) => {
|
|
1347
|
+
const state = getState();
|
|
1348
|
+
const selfId = selectSelfId(state);
|
|
1349
|
+
if (selfId === payload.senderId) {
|
|
1350
|
+
return;
|
|
1351
|
+
}
|
|
1352
|
+
const client = selectRemoteParticipants(state).find(({ id }) => id === payload.senderId);
|
|
1353
|
+
if (!client) {
|
|
1354
|
+
console.warn("Could not find remote client that sent chat message");
|
|
1355
|
+
return;
|
|
1356
|
+
}
|
|
1357
|
+
dispatch(doSetNotification(createNotificationEvent({
|
|
1358
|
+
type: "chatMessageReceived",
|
|
1359
|
+
message: `${client.displayName} says: ${payload.text}`,
|
|
1360
|
+
props: {
|
|
1361
|
+
client,
|
|
1362
|
+
chatMessage: {
|
|
1363
|
+
id: payload.id,
|
|
1364
|
+
senderId: payload.senderId,
|
|
1365
|
+
parentId: payload.parentId,
|
|
1366
|
+
timestamp: payload.timestamp,
|
|
1367
|
+
text: payload.text,
|
|
1368
|
+
sig: payload.sig,
|
|
1369
|
+
removed: false,
|
|
1370
|
+
},
|
|
1371
|
+
},
|
|
1372
|
+
})));
|
|
1373
|
+
},
|
|
1374
|
+
});
|
|
1375
|
+
startAppListening({
|
|
1376
|
+
actionCreator: signalEvents.audioEnableRequested,
|
|
1377
|
+
effect: ({ payload }, { dispatch, getState }) => {
|
|
1378
|
+
const { enable, requestedByClientId } = payload;
|
|
1379
|
+
const state = getState();
|
|
1380
|
+
const client = selectRemoteParticipants(state).find(({ id }) => id === requestedByClientId);
|
|
1381
|
+
if (!client) {
|
|
1382
|
+
console.warn("Could not find remote client that requested a local audio change");
|
|
1383
|
+
return;
|
|
1384
|
+
}
|
|
1385
|
+
dispatch(doSetNotification(createNotificationEvent({
|
|
1386
|
+
type: enable ? "requestAudioEnable" : "requestAudioDisable",
|
|
1387
|
+
message: enable
|
|
1388
|
+
? `${client.displayName} has requested for you to speak`
|
|
1389
|
+
: `${client.displayName} has muted your microphone`,
|
|
1390
|
+
props: {
|
|
1391
|
+
client,
|
|
1392
|
+
enable,
|
|
1393
|
+
},
|
|
1394
|
+
})));
|
|
1395
|
+
},
|
|
1396
|
+
});
|
|
1397
|
+
startAppListening({
|
|
1398
|
+
actionCreator: signalEvents.videoEnableRequested,
|
|
1399
|
+
effect: ({ payload }, { dispatch, getState }) => {
|
|
1400
|
+
const { enable, requestedByClientId } = payload;
|
|
1401
|
+
const state = getState();
|
|
1402
|
+
const client = selectRemoteParticipants(state).find(({ id }) => id === requestedByClientId);
|
|
1403
|
+
if (!client) {
|
|
1404
|
+
console.warn("Could not find remote client that requested a local video change");
|
|
1405
|
+
return;
|
|
1406
|
+
}
|
|
1407
|
+
dispatch(doSetNotification(createNotificationEvent({
|
|
1408
|
+
type: enable ? "requestVideoEnable" : "requestVideoDisable",
|
|
1409
|
+
message: enable
|
|
1410
|
+
? `${client.displayName} has requested for you to start video`
|
|
1411
|
+
: `${client.displayName} has stopped your video`,
|
|
1412
|
+
props: {
|
|
1413
|
+
client,
|
|
1414
|
+
enable,
|
|
1415
|
+
},
|
|
1416
|
+
})));
|
|
1417
|
+
},
|
|
1418
|
+
});
|
|
1419
|
+
startAppListening({
|
|
1420
|
+
actionCreator: signalEvents.clientMetadataReceived,
|
|
1421
|
+
effect: (action, { dispatch, getOriginalState, getState }) => {
|
|
1422
|
+
var _a;
|
|
1423
|
+
const { error, payload } = action.payload;
|
|
1424
|
+
if (error || !payload) {
|
|
1425
|
+
return;
|
|
1426
|
+
}
|
|
1427
|
+
const { clientId, stickyReaction } = payload;
|
|
1428
|
+
const state = getState();
|
|
1429
|
+
const canAskToSpeak = selectIsAuthorizedToAskToSpeak(state);
|
|
1430
|
+
if (!canAskToSpeak) {
|
|
1431
|
+
return;
|
|
1432
|
+
}
|
|
1433
|
+
const client = selectRemoteParticipants(state).find(({ id }) => id === clientId);
|
|
1434
|
+
if (!client) {
|
|
1435
|
+
console.warn("Could not find remote client that provided updated metadata");
|
|
1436
|
+
return;
|
|
1437
|
+
}
|
|
1438
|
+
const previousState = getOriginalState();
|
|
1439
|
+
const previousClient = selectRemoteParticipants(previousState).find(({ id }) => id === clientId);
|
|
1440
|
+
if ((!stickyReaction && !(previousClient === null || previousClient === void 0 ? void 0 : previousClient.stickyReaction)) ||
|
|
1441
|
+
(stickyReaction === null || stickyReaction === void 0 ? void 0 : stickyReaction.timestamp) === ((_a = previousClient === null || previousClient === void 0 ? void 0 : previousClient.stickyReaction) === null || _a === void 0 ? void 0 : _a.timestamp)) {
|
|
1442
|
+
return;
|
|
1443
|
+
}
|
|
1444
|
+
dispatch(doSetNotification(createNotificationEvent({
|
|
1445
|
+
type: stickyReaction ? "remoteHandRaised" : "remoteHandLowered",
|
|
1446
|
+
message: `${client.displayName} ${stickyReaction ? "raised" : "lowered"} their hand`,
|
|
1447
|
+
props: {
|
|
1448
|
+
client,
|
|
1449
|
+
stickyReaction,
|
|
1450
|
+
},
|
|
1451
|
+
})));
|
|
1452
|
+
},
|
|
1453
|
+
});
|
|
1454
|
+
createReactor([selectSignalStatus], ({ dispatch, getState }, signalStatus) => {
|
|
1455
|
+
const state = getState();
|
|
1456
|
+
const roomConnectionStatus = selectRoomConnectionStatus(state);
|
|
1457
|
+
if (["left", "kicked"].includes(roomConnectionStatus)) {
|
|
1458
|
+
return;
|
|
1459
|
+
}
|
|
1460
|
+
if (signalStatus === "disconnected") {
|
|
1461
|
+
dispatch(doSetNotification(createNotificationEvent({
|
|
1462
|
+
type: "signalTrouble",
|
|
1463
|
+
message: `Network connection lost. Trying to reconnect you...`,
|
|
1464
|
+
props: {},
|
|
1465
|
+
})));
|
|
1466
|
+
}
|
|
1467
|
+
else if (signalStatus === "connected") {
|
|
1468
|
+
dispatch(doSetNotification(createNotificationEvent({
|
|
1469
|
+
type: "signalOk",
|
|
1470
|
+
message: `Network connection available`,
|
|
1471
|
+
props: {},
|
|
1472
|
+
})));
|
|
1473
|
+
}
|
|
1474
|
+
});
|
|
1475
|
+
startAppListening({
|
|
1476
|
+
actionCreator: signalEvents.clientUnableToJoin,
|
|
1477
|
+
effect: (action, { dispatch }) => {
|
|
1478
|
+
var _a;
|
|
1479
|
+
if (((_a = action.payload) === null || _a === void 0 ? void 0 : _a.error) === "room_full") {
|
|
1480
|
+
dispatch(doSetNotification(createNotificationEvent({
|
|
1481
|
+
type: "clientUnableToJoinFullRoom",
|
|
1482
|
+
message: "Someone tried to join but the room is full and at capacity.",
|
|
1483
|
+
props: {},
|
|
1484
|
+
})));
|
|
1485
|
+
}
|
|
1486
|
+
},
|
|
1487
|
+
});
|
|
1488
|
+
|
|
1489
|
+
const DEFAULT_BREAKOUT_TIMER_DURATION = 1800;
|
|
1490
|
+
function createBreakout({ assignments, groups, startedAt, initiatedBy, breakoutStartedAt, breakoutEndedAt, breakoutNotification, breakoutTimerDuration, autoMoveToGroup, moveToGroupGracePeriod, autoMoveToMain, moveToMainGracePeriod, enforceAssignment, breakoutTimerSetting, } = {}) {
|
|
1491
|
+
return {
|
|
1492
|
+
assignments: assignments || null,
|
|
1493
|
+
groups: groups || null,
|
|
1494
|
+
startedAt: startedAt ? new Date(startedAt) : null,
|
|
1495
|
+
initiatedBy,
|
|
1496
|
+
breakoutStartedAt: breakoutStartedAt || null,
|
|
1497
|
+
breakoutEndedAt: breakoutEndedAt || null,
|
|
1498
|
+
breakoutNotification: breakoutNotification || null,
|
|
1499
|
+
breakoutTimerDuration: breakoutTimerDuration || DEFAULT_BREAKOUT_TIMER_DURATION,
|
|
1500
|
+
autoMoveToGroup: autoMoveToGroup || false,
|
|
1501
|
+
moveToGroupGracePeriod: moveToGroupGracePeriod || 10,
|
|
1502
|
+
autoMoveToMain: autoMoveToMain || false,
|
|
1503
|
+
moveToMainGracePeriod: moveToMainGracePeriod || 30,
|
|
1504
|
+
enforceAssignment: enforceAssignment || false,
|
|
1505
|
+
breakoutTimerSetting: breakoutTimerSetting || false,
|
|
1506
|
+
};
|
|
1507
|
+
}
|
|
1508
|
+
const breakoutSliceInitialState = Object.assign(Object.assign({}, createBreakout()), { error: null });
|
|
1509
|
+
const BREAKOUT_UNAVAILABLE_ERROR = "Breakout groups are not available in peer-to-peer rooms";
|
|
1510
|
+
const breakoutSlice = createSlice({
|
|
1511
|
+
name: "breakout",
|
|
1512
|
+
initialState: breakoutSliceInitialState,
|
|
1513
|
+
reducers: {
|
|
1514
|
+
setBreakoutError: (state, action) => {
|
|
1515
|
+
return Object.assign(Object.assign({}, state), { error: action.payload.error });
|
|
1516
|
+
},
|
|
1517
|
+
},
|
|
1518
|
+
extraReducers: (builder) => {
|
|
1519
|
+
builder.addCase(signalEvents.roomJoined, (state, action) => {
|
|
1520
|
+
if ("error" in action.payload) {
|
|
1521
|
+
return state;
|
|
1522
|
+
}
|
|
1523
|
+
const { breakout } = action.payload || {};
|
|
1524
|
+
state = Object.assign(Object.assign({}, state), { error: null });
|
|
1525
|
+
if (breakout) {
|
|
1526
|
+
return Object.assign(Object.assign({}, state), createBreakout(breakout));
|
|
1527
|
+
}
|
|
1528
|
+
return state;
|
|
1529
|
+
});
|
|
1530
|
+
builder.addCase(signalEvents.breakoutSessionUpdated, (state, action) => {
|
|
1531
|
+
return Object.assign(Object.assign({}, state), createBreakout(action.payload));
|
|
1532
|
+
});
|
|
1533
|
+
},
|
|
1534
|
+
});
|
|
1535
|
+
const { setBreakoutError } = breakoutSlice.actions;
|
|
1536
|
+
const doBreakoutJoin = createAppThunk((payload) => (_, getState) => {
|
|
1537
|
+
const state = getState();
|
|
1538
|
+
const { socket } = selectSignalConnectionRaw(state);
|
|
1539
|
+
socket === null || socket === void 0 ? void 0 : socket.emit("join_breakout_group", { group: payload.group });
|
|
1540
|
+
});
|
|
1541
|
+
function ensureDefaults(state, payload) {
|
|
1542
|
+
const { moveToGroupGracePeriod, moveToMainGracePeriod, breakoutTimerDuration } = state.breakout;
|
|
1543
|
+
const next = Object.assign({}, payload);
|
|
1544
|
+
if (next.autoMoveToGroup === true && next.moveToGroupGracePeriod == null) {
|
|
1545
|
+
next.moveToGroupGracePeriod = moveToGroupGracePeriod !== null && moveToGroupGracePeriod !== void 0 ? moveToGroupGracePeriod : 10;
|
|
1546
|
+
}
|
|
1547
|
+
if (next.autoMoveToMain === true && next.moveToMainGracePeriod == null) {
|
|
1548
|
+
next.moveToMainGracePeriod = moveToMainGracePeriod !== null && moveToMainGracePeriod !== void 0 ? moveToMainGracePeriod : 30;
|
|
1549
|
+
}
|
|
1550
|
+
if (next.breakoutTimerSetting === true && !next.breakoutTimerDuration) {
|
|
1551
|
+
next.breakoutTimerDuration = breakoutTimerDuration || DEFAULT_BREAKOUT_TIMER_DURATION;
|
|
1552
|
+
}
|
|
1553
|
+
return next;
|
|
1554
|
+
}
|
|
1555
|
+
function emitBreakoutSessionUpdate(state, payload) {
|
|
1556
|
+
const { socket } = selectSignalConnectionRaw(state);
|
|
1557
|
+
socket === null || socket === void 0 ? void 0 : socket.emit("update_breakout_session", ensureDefaults(state, payload));
|
|
1558
|
+
}
|
|
1559
|
+
function resolveClientAssignmentsToDeviceAssignments(state, clientAssignments) {
|
|
1560
|
+
const deviceIdByClientId = {};
|
|
1561
|
+
for (const participant of selectRemoteParticipants(state)) {
|
|
1562
|
+
deviceIdByClientId[participant.id] = participant.deviceId;
|
|
1563
|
+
}
|
|
1564
|
+
const localParticipant = selectLocalParticipantRaw(state);
|
|
1565
|
+
const localDeviceId = selectDeviceId(state);
|
|
1566
|
+
if (localParticipant.id && localDeviceId) {
|
|
1567
|
+
deviceIdByClientId[localParticipant.id] = localDeviceId;
|
|
1568
|
+
}
|
|
1569
|
+
const deviceAssignments = {};
|
|
1570
|
+
for (const [clientId, group] of Object.entries(clientAssignments)) {
|
|
1571
|
+
const deviceId = deviceIdByClientId[clientId];
|
|
1572
|
+
if (deviceId) {
|
|
1573
|
+
deviceAssignments[deviceId] = group;
|
|
1574
|
+
}
|
|
1575
|
+
}
|
|
1576
|
+
return deviceAssignments;
|
|
1577
|
+
}
|
|
1578
|
+
const doStartBreakoutSession = createAppAuthorizedThunk((state) => selectIsAuthorizedToManageBreakout(state), (payload) => (dispatch, getState) => {
|
|
1579
|
+
const state = getState();
|
|
1580
|
+
if (!selectBreakoutIsAvailable(state)) {
|
|
1581
|
+
dispatch(setBreakoutError({ error: BREAKOUT_UNAVAILABLE_ERROR }));
|
|
1582
|
+
console.warn(BREAKOUT_UNAVAILABLE_ERROR);
|
|
1583
|
+
return;
|
|
1584
|
+
}
|
|
1585
|
+
dispatch(setBreakoutError({ error: null }));
|
|
1586
|
+
const { assignments } = payload, rest = __rest(payload, ["assignments"]);
|
|
1587
|
+
emitBreakoutSessionUpdate(state, Object.assign(Object.assign(Object.assign({}, rest), (assignments ? { assignments: resolveClientAssignmentsToDeviceAssignments(state, assignments) } : {})), { active: true }));
|
|
1588
|
+
});
|
|
1589
|
+
const doUpdateBreakoutSession = createAppAuthorizedThunk((state) => selectIsAuthorizedToManageBreakout(state), (payload) => (_, getState) => {
|
|
1590
|
+
const state = getState();
|
|
1591
|
+
const { assignments } = payload, rest = __rest(payload, ["assignments"]);
|
|
1592
|
+
emitBreakoutSessionUpdate(state, Object.assign(Object.assign({}, rest), (assignments ? { assignments: resolveClientAssignmentsToDeviceAssignments(state, assignments) } : {})));
|
|
1593
|
+
});
|
|
1594
|
+
const doStopBreakoutSession = createAppAuthorizedThunk((state) => selectIsAuthorizedToManageBreakout(state), () => (_, getState) => {
|
|
1595
|
+
emitBreakoutSessionUpdate(getState(), { active: false });
|
|
1596
|
+
});
|
|
1597
|
+
const doAssignBreakoutParticipants = createAppAuthorizedThunk((state) => selectIsAuthorizedToManageBreakout(state), (payload) => (_, getState) => {
|
|
1598
|
+
const state = getState();
|
|
1599
|
+
const deviceAssignments = resolveClientAssignmentsToDeviceAssignments(state, payload.assignments);
|
|
1600
|
+
const mergedAssignments = Object.assign(Object.assign({}, (selectBreakoutAssignments(state) || {})), deviceAssignments);
|
|
1601
|
+
emitBreakoutSessionUpdate(state, { assignments: mergedAssignments });
|
|
1602
|
+
});
|
|
1603
|
+
const BREAKOUT_GROUPS_MIN_MAX = [2, 20];
|
|
1604
|
+
const GROUP_ID_ALPHABET = "abcdefghijklmnopqrstuvwxyz";
|
|
1605
|
+
function defaultBreakoutGroupName(groupId) {
|
|
1606
|
+
return `Group ${groupId.toUpperCase()}`;
|
|
1607
|
+
}
|
|
1608
|
+
function createBreakoutGroups(count = BREAKOUT_GROUPS_MIN_MAX[0]) {
|
|
1609
|
+
const [min, max] = BREAKOUT_GROUPS_MIN_MAX;
|
|
1610
|
+
const amount = Math.min(Math.max(count, min), max);
|
|
1611
|
+
const groups = {};
|
|
1612
|
+
for (let i = 0; i < amount; i++) {
|
|
1613
|
+
const id = GROUP_ID_ALPHABET[i];
|
|
1614
|
+
groups[id] = defaultBreakoutGroupName(id);
|
|
1615
|
+
}
|
|
1616
|
+
return groups;
|
|
1617
|
+
}
|
|
1618
|
+
function shuffle(items) {
|
|
1619
|
+
return [...items].sort(() => Math.random() - 0.5);
|
|
1620
|
+
}
|
|
1621
|
+
function chunk(items, chunkCount) {
|
|
1622
|
+
let remaining = [...items];
|
|
1623
|
+
let count = chunkCount;
|
|
1624
|
+
const chunks = [];
|
|
1625
|
+
while (remaining.length && count > 0) {
|
|
1626
|
+
const size = Math.ceil(remaining.length / count);
|
|
1627
|
+
chunks.push(remaining.slice(0, size));
|
|
1628
|
+
remaining = remaining.slice(size);
|
|
1629
|
+
count -= 1;
|
|
1630
|
+
}
|
|
1631
|
+
return chunks;
|
|
1632
|
+
}
|
|
1633
|
+
function randomizeAssignments(deviceIds, groupIds) {
|
|
1634
|
+
const assignments = {};
|
|
1635
|
+
chunk(deviceIds, groupIds.length).forEach((chunkOfDevices, index) => {
|
|
1636
|
+
chunkOfDevices.forEach((deviceId) => {
|
|
1637
|
+
assignments[deviceId] = groupIds[index];
|
|
1638
|
+
});
|
|
1639
|
+
});
|
|
1640
|
+
return assignments;
|
|
1641
|
+
}
|
|
1642
|
+
const doAssignAllBreakoutParticipants = createAppAuthorizedThunk((state) => selectIsAuthorizedToManageBreakout(state), () => (_, getState) => {
|
|
1643
|
+
const state = getState();
|
|
1644
|
+
const groupIds = Object.keys(selectBreakoutGroups(state) || {});
|
|
1645
|
+
if (!groupIds.length)
|
|
1646
|
+
return;
|
|
1647
|
+
const deviceIds = shuffle(selectRemoteParticipants(state).map((participant) => participant.deviceId));
|
|
1648
|
+
emitBreakoutSessionUpdate(state, { assignments: randomizeAssignments(deviceIds, groupIds) });
|
|
1649
|
+
});
|
|
1650
|
+
const doUnassignAllBreakoutParticipants = createAppAuthorizedThunk((state) => selectIsAuthorizedToManageBreakout(state), () => (_, getState) => {
|
|
1651
|
+
const state = getState();
|
|
1652
|
+
const assignments = selectBreakoutAssignments(state) || {};
|
|
1653
|
+
const cleared = Object.keys(assignments).reduce((acc, deviceId) => {
|
|
1654
|
+
acc[deviceId] = "";
|
|
1655
|
+
return acc;
|
|
1656
|
+
}, {});
|
|
1657
|
+
emitBreakoutSessionUpdate(state, { assignments: cleared });
|
|
1658
|
+
});
|
|
1659
|
+
const doShuffleBreakoutParticipants = createAppAuthorizedThunk((state) => selectIsAuthorizedToManageBreakout(state), () => (_, getState) => {
|
|
1660
|
+
const state = getState();
|
|
1661
|
+
const groupIds = Object.keys(selectBreakoutGroups(state) || {});
|
|
1662
|
+
if (!groupIds.length)
|
|
1663
|
+
return;
|
|
1664
|
+
const assignments = selectBreakoutAssignments(state) || {};
|
|
1665
|
+
const deviceIds = shuffle(Object.entries(assignments)
|
|
1666
|
+
.filter(([, groupId]) => !!groupId)
|
|
1667
|
+
.map(([deviceId]) => deviceId));
|
|
1668
|
+
emitBreakoutSessionUpdate(state, { assignments: randomizeAssignments(deviceIds, groupIds) });
|
|
1669
|
+
});
|
|
1670
|
+
const doExtendBreakoutTimer = createAppAuthorizedThunk((state) => selectIsAuthorizedToManageBreakout(state), (payload) => (_, getState) => {
|
|
1671
|
+
var _a;
|
|
1672
|
+
const state = getState();
|
|
1673
|
+
const additionalSeconds = (_a = payload === null || payload === void 0 ? void 0 : payload.seconds) !== null && _a !== void 0 ? _a : 60;
|
|
1674
|
+
const breakoutTimerDuration = (selectBreakoutTimerDuration(state) || 0) + additionalSeconds;
|
|
1675
|
+
emitBreakoutSessionUpdate(state, { breakoutTimerDuration });
|
|
1676
|
+
});
|
|
1677
|
+
const doStopBreakoutTimer = createAppAuthorizedThunk((state) => selectIsAuthorizedToManageBreakout(state), () => (_, getState) => {
|
|
1678
|
+
emitBreakoutSessionUpdate(getState(), { breakoutTimerSetting: false });
|
|
1679
|
+
});
|
|
1680
|
+
const selectBreakoutRaw = (state) => state.breakout;
|
|
1681
|
+
const selectBreakoutError = (state) => state.breakout.error;
|
|
1682
|
+
const selectBreakoutIsAvailable = (state) => state.room.mode === "group";
|
|
1683
|
+
const selectBreakoutInitiatedBy = (state) => state.breakout.initiatedBy;
|
|
1684
|
+
const selectBreakoutActive = (state) => !!state.breakout.startedAt;
|
|
1685
|
+
const selectBreakoutAssignments = (state) => state.breakout.assignments;
|
|
1686
|
+
const selectBreakoutGroups = (state) => state.breakout.groups;
|
|
1687
|
+
const selectBreakoutEnforceAssignment = (state) => state.breakout.enforceAssignment;
|
|
1688
|
+
const selectBreakoutTimerSetting = (state) => state.breakout.breakoutTimerSetting;
|
|
1689
|
+
const selectBreakoutTimerDuration = (state) => state.breakout.breakoutTimerDuration;
|
|
1690
|
+
const selectBreakoutAutoMoveToGroup = (state) => state.breakout.autoMoveToGroup;
|
|
1691
|
+
const selectBreakoutMoveToGroupGracePeriod = (state) => state.breakout.moveToGroupGracePeriod;
|
|
1692
|
+
const selectBreakoutAutoMoveToMain = (state) => state.breakout.autoMoveToMain;
|
|
1693
|
+
const selectBreakoutMoveToMainGracePeriod = (state) => state.breakout.moveToMainGracePeriod;
|
|
1694
|
+
const selectBreakoutStartedAt = (state) => state.breakout.startedAt;
|
|
1695
|
+
const selectBreakoutEndTime = createSelector(selectBreakoutRaw, (raw) => {
|
|
1696
|
+
if (!raw.breakoutStartedAt)
|
|
1697
|
+
return null;
|
|
1698
|
+
const startTime = new Date(raw.breakoutStartedAt).getTime();
|
|
1699
|
+
const gracePeriod = raw.autoMoveToGroup ? raw.moveToGroupGracePeriod || 0 : 0;
|
|
1700
|
+
return startTime + ((raw.breakoutTimerDuration || 0) + gracePeriod) * 1000;
|
|
1701
|
+
});
|
|
1702
|
+
const selectBreakoutMoveToGroupAt = createSelector(selectBreakoutRaw, (raw) => {
|
|
1703
|
+
if (!raw.autoMoveToGroup || !raw.breakoutStartedAt)
|
|
1704
|
+
return null;
|
|
1705
|
+
return new Date(raw.breakoutStartedAt).getTime() + (raw.moveToGroupGracePeriod || 0) * 1000;
|
|
1706
|
+
});
|
|
1707
|
+
const selectBreakoutMoveToMainAt = createSelector(selectBreakoutRaw, (raw) => {
|
|
1708
|
+
if (!raw.autoMoveToMain || !raw.breakoutEndedAt)
|
|
1709
|
+
return null;
|
|
1710
|
+
return new Date(raw.breakoutEndedAt).getTime() + (raw.moveToMainGracePeriod || 0) * 1000;
|
|
1711
|
+
});
|
|
1712
|
+
const selectBreakoutCurrentId = createSelector(selectLocalParticipantBreakoutGroup, (localParticipantBreakoutGroup) => localParticipantBreakoutGroup || "");
|
|
1713
|
+
const selectBreakoutCurrentGroup = createSelector(selectBreakoutRaw, selectBreakoutCurrentId, (raw, breakoutCurrentId) => {
|
|
1714
|
+
var _a;
|
|
1715
|
+
const name = (_a = raw.groups) === null || _a === void 0 ? void 0 : _a[breakoutCurrentId];
|
|
1716
|
+
if (!name)
|
|
1717
|
+
return null;
|
|
1718
|
+
return { id: breakoutCurrentId, name };
|
|
1719
|
+
});
|
|
1720
|
+
startAppListening({
|
|
1721
|
+
actionCreator: signalEvents.breakoutMoveToGroup,
|
|
1722
|
+
effect: (_, { dispatch, getState }) => {
|
|
1723
|
+
const state = getState();
|
|
1724
|
+
const localParticipant = selectLocalParticipantRaw(state);
|
|
1725
|
+
const breakoutGroupAssigned = localParticipant.breakoutGroupAssigned;
|
|
1726
|
+
if (breakoutGroupAssigned) {
|
|
1727
|
+
dispatch(doBreakoutJoin({ group: breakoutGroupAssigned }));
|
|
1728
|
+
}
|
|
1729
|
+
},
|
|
1730
|
+
});
|
|
1731
|
+
startAppListening({
|
|
1732
|
+
actionCreator: signalEvents.breakoutMoveToMain,
|
|
1733
|
+
effect: (_, { dispatch }) => {
|
|
1734
|
+
dispatch(doBreakoutJoin({ group: "" }));
|
|
1735
|
+
},
|
|
1736
|
+
});
|
|
1737
|
+
startAppListening({
|
|
1738
|
+
actionCreator: signalEvents.breakoutSessionUpdated,
|
|
1739
|
+
effect: ({ payload }, { dispatch, getState }) => {
|
|
1740
|
+
var _a;
|
|
1741
|
+
const state = getState();
|
|
1742
|
+
const autoMoveToMain = selectBreakoutRaw(state).autoMoveToMain;
|
|
1743
|
+
if (((_a = payload.initiatedBy) === null || _a === void 0 ? void 0 : _a.active) === false) {
|
|
1744
|
+
if (!autoMoveToMain) {
|
|
1745
|
+
dispatch(doBreakoutJoin({ group: "" }));
|
|
1746
|
+
}
|
|
1747
|
+
}
|
|
1748
|
+
},
|
|
1749
|
+
});
|
|
1750
|
+
startAppListening({
|
|
1751
|
+
actionCreator: signalEvents.breakoutEnding,
|
|
1752
|
+
effect: (_, { dispatch }) => {
|
|
1753
|
+
dispatch(doSetNotification(createNotificationEvent({
|
|
1754
|
+
type: "breakoutTimerEnding",
|
|
1755
|
+
message: "The breakout session is ending soon",
|
|
1756
|
+
props: {},
|
|
1757
|
+
})));
|
|
1758
|
+
},
|
|
1759
|
+
});
|
|
1760
|
+
startAppListening({
|
|
1761
|
+
actionCreator: signalEvents.breakoutTimerExtended,
|
|
1762
|
+
effect: (_, { dispatch }) => {
|
|
1763
|
+
dispatch(doSetNotification(createNotificationEvent({
|
|
1764
|
+
type: "breakoutTimerExtended",
|
|
1765
|
+
message: "The breakout timer was extended",
|
|
1766
|
+
props: {},
|
|
1767
|
+
})));
|
|
1768
|
+
},
|
|
1769
|
+
});
|
|
1770
|
+
startAppListening({
|
|
1771
|
+
actionCreator: signalEvents.breakoutTimerEnded,
|
|
1772
|
+
effect: (_, { dispatch }) => {
|
|
1773
|
+
dispatch(doSetNotification(createNotificationEvent({
|
|
1774
|
+
type: "breakoutTimerEnded",
|
|
1775
|
+
message: "The breakout timer ended",
|
|
1776
|
+
props: {},
|
|
1777
|
+
})));
|
|
1778
|
+
},
|
|
1779
|
+
});
|
|
1780
|
+
|
|
1781
|
+
const chatSliceInitialState = {
|
|
1782
|
+
chatMessages: [],
|
|
1783
|
+
};
|
|
1784
|
+
const chatSlice = createSlice({
|
|
1785
|
+
name: "chat",
|
|
1786
|
+
initialState: chatSliceInitialState,
|
|
1787
|
+
reducers: {},
|
|
1788
|
+
extraReducers(builder) {
|
|
1789
|
+
builder.addCase(signalEvents.chatMessage, (state, action) => {
|
|
1790
|
+
const message = Object.assign({ id: action.payload.id, senderId: action.payload.senderId, parentId: action.payload.parentId, timestamp: action.payload.timestamp, text: action.payload.text, sig: action.payload.sig, removed: false }, (action.payload.file && { file: action.payload.file }));
|
|
1791
|
+
return Object.assign(Object.assign({}, state), { chatMessages: [...state.chatMessages, message] });
|
|
1792
|
+
});
|
|
1793
|
+
builder.addCase(signalEvents.chatMessageRemoved, (state, action) => {
|
|
1794
|
+
return Object.assign(Object.assign({}, state), { chatMessages: state.chatMessages.map((m) => {
|
|
1795
|
+
return Object.assign(Object.assign({}, m), (m.id === action.payload.id && {
|
|
1796
|
+
removed: true,
|
|
1797
|
+
}));
|
|
1798
|
+
}) });
|
|
1799
|
+
});
|
|
1800
|
+
},
|
|
1801
|
+
});
|
|
1802
|
+
const doSendChatMessage = createRoomConnectedThunk((payload) => (_, getState) => {
|
|
1803
|
+
const state = getState();
|
|
1804
|
+
const socket = selectSignalConnectionRaw(state).socket;
|
|
1805
|
+
const breakoutCurrentId = selectBreakoutCurrentId(state);
|
|
1806
|
+
socket === null || socket === void 0 ? void 0 : socket.emit("chat_message", Object.assign(Object.assign(Object.assign({ text: payload.text }, (payload.parentId && { parentId: payload.parentId })), (breakoutCurrentId && { breakoutGroup: breakoutCurrentId })), (payload.isBroadcast && { broadcast: true })));
|
|
1807
|
+
});
|
|
1808
|
+
const doRemoveChatMessage = createRoomConnectedThunk(({ id, sig }) => (_, getState) => {
|
|
1809
|
+
const state = getState();
|
|
1810
|
+
const socket = selectSignalConnectionRaw(state).socket;
|
|
1811
|
+
socket === null || socket === void 0 ? void 0 : socket.emit("remove_chat_message", {
|
|
1812
|
+
id,
|
|
1813
|
+
sig,
|
|
1814
|
+
});
|
|
1815
|
+
});
|
|
1816
|
+
const selectChatRaw = (state) => state.chat;
|
|
1817
|
+
const selectChatMessages = (state) => state.chat.chatMessages;
|
|
1818
|
+
|
|
1819
|
+
const initialCloudRecordingState = {
|
|
1820
|
+
isInitiator: false,
|
|
1821
|
+
isRecording: false,
|
|
1822
|
+
startedAt: undefined,
|
|
1823
|
+
};
|
|
1824
|
+
const cloudRecordingSlice = createSlice({
|
|
1825
|
+
name: "cloudRecording",
|
|
1826
|
+
initialState: initialCloudRecordingState,
|
|
1827
|
+
reducers: {
|
|
1828
|
+
recordingRequestStarted: (state) => {
|
|
1829
|
+
return Object.assign(Object.assign({}, state), { isInitiator: true, status: "requested" });
|
|
1830
|
+
},
|
|
1831
|
+
},
|
|
1832
|
+
extraReducers: (builder) => {
|
|
1833
|
+
builder.addCase(signalEvents.cloudRecordingStopped, (state) => {
|
|
1834
|
+
return Object.assign(Object.assign({}, state), { isInitiator: false, isRecording: false, status: undefined });
|
|
1835
|
+
});
|
|
1836
|
+
builder.addCase(signalEvents.cloudRecordingStarted, (state, action) => {
|
|
1837
|
+
const { payload } = action;
|
|
1838
|
+
if (!payload.error) {
|
|
1445
1839
|
return state;
|
|
1446
1840
|
}
|
|
1447
|
-
|
|
1448
|
-
return updateParticipant(state, clientId, {
|
|
1449
|
-
displayName,
|
|
1450
|
-
stickyReaction,
|
|
1451
|
-
});
|
|
1452
|
-
});
|
|
1453
|
-
builder.addCase(signalEvents.breakoutGroupJoined, (state, action) => {
|
|
1454
|
-
const { clientId, group } = action.payload;
|
|
1455
|
-
return updateParticipant(state, clientId, {
|
|
1456
|
-
breakoutGroup: group || null,
|
|
1457
|
-
});
|
|
1458
|
-
});
|
|
1459
|
-
builder.addCase(signalEvents.screenshareStarted, (state, action) => {
|
|
1460
|
-
const { clientId, streamId } = action.payload;
|
|
1461
|
-
return addStreamId(state, clientId, streamId);
|
|
1841
|
+
return Object.assign(Object.assign({}, state), { isInitiator: false, isRecording: false, status: "error", error: payload.error });
|
|
1462
1842
|
});
|
|
1463
|
-
builder.addCase(signalEvents.
|
|
1464
|
-
|
|
1465
|
-
|
|
1843
|
+
builder.addCase(signalEvents.newClient, (state, { payload }) => {
|
|
1844
|
+
var _a;
|
|
1845
|
+
const { client } = payload;
|
|
1846
|
+
if (((_a = client.role) === null || _a === void 0 ? void 0 : _a.roleName) === "recorder") {
|
|
1847
|
+
return Object.assign(Object.assign({}, state), { isRecording: true, status: "recording", startedAt: client.startedCloudRecordingAt
|
|
1848
|
+
? new Date(client.startedCloudRecordingAt).getTime()
|
|
1849
|
+
: new Date().getTime() });
|
|
1850
|
+
}
|
|
1851
|
+
return state;
|
|
1466
1852
|
});
|
|
1467
1853
|
},
|
|
1468
1854
|
});
|
|
1469
|
-
const {
|
|
1470
|
-
const
|
|
1855
|
+
const { recordingRequestStarted } = cloudRecordingSlice.actions;
|
|
1856
|
+
const doStartCloudRecording = createRoomConnectedThunk(() => (dispatch, getState) => {
|
|
1471
1857
|
const state = getState();
|
|
1472
|
-
const
|
|
1473
|
-
|
|
1474
|
-
|
|
1858
|
+
const socket = selectSignalConnectionRaw(state).socket;
|
|
1859
|
+
const status = selectCloudRecordingStatus(state);
|
|
1860
|
+
if (status && ["recording", "requested"].includes(status)) {
|
|
1475
1861
|
return;
|
|
1476
1862
|
}
|
|
1477
|
-
|
|
1478
|
-
|
|
1863
|
+
socket === null || socket === void 0 ? void 0 : socket.emit("start_recording", {
|
|
1864
|
+
recording: "cloud",
|
|
1865
|
+
});
|
|
1866
|
+
dispatch(recordingRequestStarted());
|
|
1479
1867
|
});
|
|
1480
|
-
const
|
|
1868
|
+
const doStopCloudRecording = createRoomConnectedThunk(() => (dispatch, getState) => {
|
|
1481
1869
|
const state = getState();
|
|
1482
1870
|
const socket = selectSignalConnectionRaw(state).socket;
|
|
1483
|
-
socket === null || socket === void 0 ? void 0 : socket.emit("
|
|
1484
|
-
});
|
|
1485
|
-
const selectRemoteParticipantsRaw = (state) => state.remoteParticipants;
|
|
1486
|
-
const selectRemoteClients = (state) => state.remoteParticipants.remoteParticipants;
|
|
1487
|
-
const selectRemoteParticipants = createSelector(selectRemoteClients, (clients) => clients.filter((c) => !NON_PERSON_ROLES.includes(c.roleName)));
|
|
1488
|
-
const selectNumClients = createSelector(selectRemoteClients, (clients) => clients.length + 1);
|
|
1489
|
-
const selectNumParticipants = createSelector(selectRemoteParticipants, selectLocalParticipantRaw, (clients, localParticipant) => {
|
|
1490
|
-
if (NON_PERSON_ROLES.includes(localParticipant.roleName)) {
|
|
1491
|
-
return clients.length;
|
|
1492
|
-
}
|
|
1493
|
-
return clients.length + 1;
|
|
1871
|
+
socket === null || socket === void 0 ? void 0 : socket.emit("stop_recording");
|
|
1494
1872
|
});
|
|
1873
|
+
const selectCloudRecordingRaw = (state) => state.cloudRecording;
|
|
1874
|
+
const selectCloudRecordingStatus = (state) => state.cloudRecording.status;
|
|
1875
|
+
const selectCloudRecordingStartedAt = (state) => state.cloudRecording.startedAt;
|
|
1876
|
+
const selectCloudRecordingError = (state) => state.cloudRecording.error;
|
|
1877
|
+
const selectIsCloudRecording = (state) => state.cloudRecording.isRecording;
|
|
1878
|
+
const selectCloudRecordingIsInitiator = (state) => state.cloudRecording.isInitiator;
|
|
1495
1879
|
|
|
1496
1880
|
const localScreenshareSliceInitialState = {
|
|
1497
1881
|
status: "inactive",
|
|
@@ -1587,6 +1971,7 @@ function isRecorderClient(client) {
|
|
|
1587
1971
|
}
|
|
1588
1972
|
const roomSliceInitialState = {
|
|
1589
1973
|
isLocked: false,
|
|
1974
|
+
mode: null,
|
|
1590
1975
|
};
|
|
1591
1976
|
const roomSlice = createSlice({
|
|
1592
1977
|
name: "room",
|
|
@@ -1594,6 +1979,7 @@ const roomSlice = createSlice({
|
|
|
1594
1979
|
reducers: {},
|
|
1595
1980
|
extraReducers: (builder) => {
|
|
1596
1981
|
builder.addCase(signalEvents.roomJoined, (state, action) => {
|
|
1982
|
+
var _a;
|
|
1597
1983
|
if ("error" in action.payload) {
|
|
1598
1984
|
if (action.payload.error === "room_locked") {
|
|
1599
1985
|
return Object.assign(Object.assign({}, state), { isLocked: Boolean(action.payload.isLocked) });
|
|
@@ -1601,7 +1987,7 @@ const roomSlice = createSlice({
|
|
|
1601
1987
|
return state;
|
|
1602
1988
|
}
|
|
1603
1989
|
const { room } = action.payload;
|
|
1604
|
-
return Object.assign(Object.assign({}, state), { isLocked: Boolean(room.isLocked) });
|
|
1990
|
+
return Object.assign(Object.assign({}, state), { isLocked: Boolean(room.isLocked), mode: (_a = room.mode) !== null && _a !== void 0 ? _a : (room.sfuServer ? "group" : "normal") });
|
|
1605
1991
|
});
|
|
1606
1992
|
builder.addCase(signalEvents.roomLocked, (state, action) => {
|
|
1607
1993
|
const { isLocked } = action.payload;
|
|
@@ -1631,6 +2017,7 @@ const doEndMeeting = createAppAuthorizedThunk((state) => selectIsAuthorizedToEnd
|
|
|
1631
2017
|
}
|
|
1632
2018
|
});
|
|
1633
2019
|
const selectRoomIsLocked = (state) => state.room.isLocked;
|
|
2020
|
+
const selectRoomMode = (state) => state.room.mode;
|
|
1634
2021
|
const selectScreenshares = createSelector(selectLocalScreenshareStream, selectLocalParticipantRaw, selectRemoteParticipants, (localScreenshareStream, localParticipant, remoteParticipants) => {
|
|
1635
2022
|
const screenshares = [];
|
|
1636
2023
|
if (localScreenshareStream) {
|
|
@@ -1972,8 +2359,7 @@ const doHandleAcceptStreams = createAppThunk((payload) => (dispatch, getState) =
|
|
|
1972
2359
|
const participant = remoteClients.find((p) => p.id === clientId);
|
|
1973
2360
|
if (!participant)
|
|
1974
2361
|
continue;
|
|
1975
|
-
if (state === "to_accept" ||
|
|
1976
|
-
(state === "new_accept" && shouldAcceptNewClients)) {
|
|
2362
|
+
if (state === "to_accept" || (state === "new_accept" && shouldAcceptNewClients)) {
|
|
1977
2363
|
rtcManager.acceptNewStream({
|
|
1978
2364
|
streamId: streamId === CAMERA_STREAM_ID ? clientId : streamId,
|
|
1979
2365
|
clientId,
|
|
@@ -2016,7 +2402,10 @@ const doRtcManagerInitialize = createAppThunk(() => (dispatch, getState) => {
|
|
|
2016
2402
|
const isCameraEnabled = selectIsCameraEnabled(getState());
|
|
2017
2403
|
const isMicrophoneEnabled = selectIsMicrophoneEnabled(getState());
|
|
2018
2404
|
if (localMediaStream && rtcManager) {
|
|
2019
|
-
rtcManager.addCameraStream(localMediaStream, {
|
|
2405
|
+
rtcManager.addCameraStream(localMediaStream, {
|
|
2406
|
+
audioPaused: !isMicrophoneEnabled,
|
|
2407
|
+
videoPaused: !isCameraEnabled,
|
|
2408
|
+
});
|
|
2020
2409
|
}
|
|
2021
2410
|
dispatch(rtcManagerInitialized());
|
|
2022
2411
|
});
|
|
@@ -2159,7 +2548,7 @@ const selectStreamsToAccept = createSelector(selectRtcStatus, selectRemoteClient
|
|
|
2159
2548
|
}
|
|
2160
2549
|
if ((!client.breakoutGroup && !breakoutCurrentId) ||
|
|
2161
2550
|
client.breakoutGroup === breakoutCurrentId ||
|
|
2162
|
-
(
|
|
2551
|
+
(!client.breakoutGroup && clientSpotlight) ||
|
|
2163
2552
|
ignoreBreakoutGroups) {
|
|
2164
2553
|
if (state === "done_accept")
|
|
2165
2554
|
continue;
|
|
@@ -2745,190 +3134,21 @@ createReactor([
|
|
|
2745
3134
|
dispatch(doSendClientMetadata());
|
|
2746
3135
|
}
|
|
2747
3136
|
});
|
|
2748
|
-
createReactor([selectBreakoutAssignments, selectDeviceId, selectLocalParticipantRaw], ({ dispatch }, breakoutAssignments, deviceId, localParticipant) => {
|
|
3137
|
+
createReactor([selectBreakoutAssignments, selectDeviceId, selectLocalParticipantRaw, selectBreakoutGroups, selectBreakoutActive], ({ dispatch }, breakoutAssignments, deviceId, localParticipant, breakoutGroups, breakoutActive) => {
|
|
2749
3138
|
const breakoutGroupAssigned = (breakoutAssignments === null || breakoutAssignments === void 0 ? void 0 : breakoutAssignments[deviceId || ""]) || "";
|
|
2750
3139
|
if (localParticipant.breakoutGroupAssigned === breakoutGroupAssigned) {
|
|
2751
3140
|
return;
|
|
2752
3141
|
}
|
|
2753
3142
|
dispatch(setBreakoutGroupAssigned({ breakoutGroupAssigned }));
|
|
2754
|
-
|
|
2755
|
-
|
|
2756
|
-
const emitter = new EventEmitter();
|
|
2757
|
-
function createNotificationEvent(payload) {
|
|
2758
|
-
const notificationEvent = Object.assign(Object.assign({}, payload), { timestamp: Date.now() });
|
|
2759
|
-
return notificationEvent;
|
|
2760
|
-
}
|
|
2761
|
-
const initialNotificationsState = {
|
|
2762
|
-
emitter,
|
|
2763
|
-
events: [],
|
|
2764
|
-
};
|
|
2765
|
-
const notificationsSlice = createSlice({
|
|
2766
|
-
name: "notifications",
|
|
2767
|
-
initialState: initialNotificationsState,
|
|
2768
|
-
reducers: {
|
|
2769
|
-
addNotification: (state, action) => {
|
|
2770
|
-
return Object.assign(Object.assign({}, state), { events: [...state.events, Object.assign({}, action.payload)] });
|
|
2771
|
-
},
|
|
2772
|
-
doClearNotifications: (state) => {
|
|
2773
|
-
return Object.assign(Object.assign({}, state), { events: [] });
|
|
2774
|
-
},
|
|
2775
|
-
},
|
|
2776
|
-
});
|
|
2777
|
-
const { doClearNotifications } = notificationsSlice.actions;
|
|
2778
|
-
const doSetNotification = createAppThunk((payload) => (dispatch, getState) => {
|
|
2779
|
-
dispatch(notificationsSlice.actions.addNotification(payload));
|
|
2780
|
-
const state = getState();
|
|
2781
|
-
const emitter = selectNotificationsEmitter(state);
|
|
2782
|
-
emitter.emit(payload.type, payload);
|
|
2783
|
-
emitter.emit("*", payload);
|
|
2784
|
-
});
|
|
2785
|
-
const selectNotificationsRaw = (state) => state.notifications;
|
|
2786
|
-
const selectNotificationsEvents = (state) => state.notifications.events;
|
|
2787
|
-
const selectNotificationsEmitter = (state) => state.notifications.emitter;
|
|
2788
|
-
startAppListening({
|
|
2789
|
-
actionCreator: signalEvents.chatMessage,
|
|
2790
|
-
effect: ({ payload }, { dispatch, getState }) => {
|
|
2791
|
-
const state = getState();
|
|
2792
|
-
const selfId = selectSelfId(state);
|
|
2793
|
-
if (selfId === payload.senderId) {
|
|
2794
|
-
return;
|
|
2795
|
-
}
|
|
2796
|
-
const client = selectRemoteParticipants(state).find(({ id }) => id === payload.senderId);
|
|
2797
|
-
if (!client) {
|
|
2798
|
-
console.warn("Could not find remote client that sent chat message");
|
|
2799
|
-
return;
|
|
2800
|
-
}
|
|
2801
|
-
dispatch(doSetNotification(createNotificationEvent({
|
|
2802
|
-
type: "chatMessageReceived",
|
|
2803
|
-
message: `${client.displayName} says: ${payload.text}`,
|
|
2804
|
-
props: {
|
|
2805
|
-
client,
|
|
2806
|
-
chatMessage: {
|
|
2807
|
-
id: payload.id,
|
|
2808
|
-
senderId: payload.senderId,
|
|
2809
|
-
parentId: payload.parentId,
|
|
2810
|
-
timestamp: payload.timestamp,
|
|
2811
|
-
text: payload.text,
|
|
2812
|
-
sig: payload.sig,
|
|
2813
|
-
removed: false,
|
|
2814
|
-
},
|
|
2815
|
-
},
|
|
2816
|
-
})));
|
|
2817
|
-
},
|
|
2818
|
-
});
|
|
2819
|
-
startAppListening({
|
|
2820
|
-
actionCreator: signalEvents.audioEnableRequested,
|
|
2821
|
-
effect: ({ payload }, { dispatch, getState }) => {
|
|
2822
|
-
const { enable, requestedByClientId } = payload;
|
|
2823
|
-
const state = getState();
|
|
2824
|
-
const client = selectRemoteParticipants(state).find(({ id }) => id === requestedByClientId);
|
|
2825
|
-
if (!client) {
|
|
2826
|
-
console.warn("Could not find remote client that requested a local audio change");
|
|
2827
|
-
return;
|
|
2828
|
-
}
|
|
2829
|
-
dispatch(doSetNotification(createNotificationEvent({
|
|
2830
|
-
type: enable ? "requestAudioEnable" : "requestAudioDisable",
|
|
2831
|
-
message: enable
|
|
2832
|
-
? `${client.displayName} has requested for you to speak`
|
|
2833
|
-
: `${client.displayName} has muted your microphone`,
|
|
2834
|
-
props: {
|
|
2835
|
-
client,
|
|
2836
|
-
enable,
|
|
2837
|
-
},
|
|
2838
|
-
})));
|
|
2839
|
-
},
|
|
2840
|
-
});
|
|
2841
|
-
startAppListening({
|
|
2842
|
-
actionCreator: signalEvents.videoEnableRequested,
|
|
2843
|
-
effect: ({ payload }, { dispatch, getState }) => {
|
|
2844
|
-
const { enable, requestedByClientId } = payload;
|
|
2845
|
-
const state = getState();
|
|
2846
|
-
const client = selectRemoteParticipants(state).find(({ id }) => id === requestedByClientId);
|
|
2847
|
-
if (!client) {
|
|
2848
|
-
console.warn("Could not find remote client that requested a local video change");
|
|
2849
|
-
return;
|
|
2850
|
-
}
|
|
2851
|
-
dispatch(doSetNotification(createNotificationEvent({
|
|
2852
|
-
type: enable ? "requestVideoEnable" : "requestVideoDisable",
|
|
2853
|
-
message: enable
|
|
2854
|
-
? `${client.displayName} has requested for you to start video`
|
|
2855
|
-
: `${client.displayName} has stopped your video`,
|
|
2856
|
-
props: {
|
|
2857
|
-
client,
|
|
2858
|
-
enable,
|
|
2859
|
-
},
|
|
2860
|
-
})));
|
|
2861
|
-
},
|
|
2862
|
-
});
|
|
2863
|
-
startAppListening({
|
|
2864
|
-
actionCreator: signalEvents.clientMetadataReceived,
|
|
2865
|
-
effect: (action, { dispatch, getOriginalState, getState }) => {
|
|
2866
|
-
var _a;
|
|
2867
|
-
const { error, payload } = action.payload;
|
|
2868
|
-
if (error || !payload) {
|
|
2869
|
-
return;
|
|
2870
|
-
}
|
|
2871
|
-
const { clientId, stickyReaction } = payload;
|
|
2872
|
-
const state = getState();
|
|
2873
|
-
const canAskToSpeak = selectIsAuthorizedToAskToSpeak(state);
|
|
2874
|
-
if (!canAskToSpeak) {
|
|
2875
|
-
return;
|
|
2876
|
-
}
|
|
2877
|
-
const client = selectRemoteParticipants(state).find(({ id }) => id === clientId);
|
|
2878
|
-
if (!client) {
|
|
2879
|
-
console.warn("Could not find remote client that provided updated metadata");
|
|
2880
|
-
return;
|
|
2881
|
-
}
|
|
2882
|
-
const previousState = getOriginalState();
|
|
2883
|
-
const previousClient = selectRemoteParticipants(previousState).find(({ id }) => id === clientId);
|
|
2884
|
-
if ((!stickyReaction && !(previousClient === null || previousClient === void 0 ? void 0 : previousClient.stickyReaction)) ||
|
|
2885
|
-
(stickyReaction === null || stickyReaction === void 0 ? void 0 : stickyReaction.timestamp) === ((_a = previousClient === null || previousClient === void 0 ? void 0 : previousClient.stickyReaction) === null || _a === void 0 ? void 0 : _a.timestamp)) {
|
|
2886
|
-
return;
|
|
2887
|
-
}
|
|
2888
|
-
dispatch(doSetNotification(createNotificationEvent({
|
|
2889
|
-
type: stickyReaction ? "remoteHandRaised" : "remoteHandLowered",
|
|
2890
|
-
message: `${client.displayName} ${stickyReaction ? "raised" : "lowered"} their hand`,
|
|
2891
|
-
props: {
|
|
2892
|
-
client,
|
|
2893
|
-
stickyReaction,
|
|
2894
|
-
},
|
|
2895
|
-
})));
|
|
2896
|
-
},
|
|
2897
|
-
});
|
|
2898
|
-
createReactor([selectSignalStatus], ({ dispatch, getState }, signalStatus) => {
|
|
2899
|
-
const state = getState();
|
|
2900
|
-
const roomConnectionStatus = selectRoomConnectionStatus(state);
|
|
2901
|
-
if (["left", "kicked"].includes(roomConnectionStatus)) {
|
|
2902
|
-
return;
|
|
2903
|
-
}
|
|
2904
|
-
if (signalStatus === "disconnected") {
|
|
3143
|
+
if (breakoutGroupAssigned && breakoutActive) {
|
|
3144
|
+
const groupName = (breakoutGroups === null || breakoutGroups === void 0 ? void 0 : breakoutGroups[breakoutGroupAssigned]) || "";
|
|
2905
3145
|
dispatch(doSetNotification(createNotificationEvent({
|
|
2906
|
-
type: "
|
|
2907
|
-
message: `
|
|
2908
|
-
props: {},
|
|
2909
|
-
})));
|
|
2910
|
-
}
|
|
2911
|
-
else if (signalStatus === "connected") {
|
|
2912
|
-
dispatch(doSetNotification(createNotificationEvent({
|
|
2913
|
-
type: "signalOk",
|
|
2914
|
-
message: `Network connection available`,
|
|
2915
|
-
props: {},
|
|
3146
|
+
type: "breakoutGroupAssigned",
|
|
3147
|
+
message: groupName ? `You've been assigned to ${groupName}` : "You've been assigned to a group",
|
|
3148
|
+
props: { group: breakoutGroupAssigned, groupName },
|
|
2916
3149
|
})));
|
|
2917
3150
|
}
|
|
2918
3151
|
});
|
|
2919
|
-
startAppListening({
|
|
2920
|
-
actionCreator: signalEvents.clientUnableToJoin,
|
|
2921
|
-
effect: (action, { dispatch }) => {
|
|
2922
|
-
var _a;
|
|
2923
|
-
if (((_a = action.payload) === null || _a === void 0 ? void 0 : _a.error) === "room_full") {
|
|
2924
|
-
dispatch(doSetNotification(createNotificationEvent({
|
|
2925
|
-
type: "clientUnableToJoinFullRoom",
|
|
2926
|
-
message: "Someone tried to join but the room is full and at capacity.",
|
|
2927
|
-
props: {},
|
|
2928
|
-
})));
|
|
2929
|
-
}
|
|
2930
|
-
},
|
|
2931
|
-
});
|
|
2932
3152
|
|
|
2933
3153
|
const organizationSliceInitialState = {
|
|
2934
3154
|
data: null,
|
|
@@ -2989,6 +3209,7 @@ const roomConnectionSliceInitialState = {
|
|
|
2989
3209
|
session: null,
|
|
2990
3210
|
status: "ready",
|
|
2991
3211
|
error: null,
|
|
3212
|
+
knockResponse: null,
|
|
2992
3213
|
};
|
|
2993
3214
|
const roomConnectionSlice = createSlice({
|
|
2994
3215
|
name: "roomConnection",
|
|
@@ -2997,6 +3218,9 @@ const roomConnectionSlice = createSlice({
|
|
|
2997
3218
|
connectionStatusChanged: (state, action) => {
|
|
2998
3219
|
return Object.assign(Object.assign({}, state), { status: action.payload });
|
|
2999
3220
|
},
|
|
3221
|
+
knockResponseReceived: (state, action) => {
|
|
3222
|
+
return Object.assign(Object.assign({}, state), { knockResponse: action.payload });
|
|
3223
|
+
},
|
|
3000
3224
|
},
|
|
3001
3225
|
extraReducers: (builder) => {
|
|
3002
3226
|
builder.addCase(signalEvents.roomJoined, (state, action) => {
|
|
@@ -3038,7 +3262,7 @@ const roomConnectionSlice = createSlice({
|
|
|
3038
3262
|
});
|
|
3039
3263
|
},
|
|
3040
3264
|
});
|
|
3041
|
-
const { connectionStatusChanged } = roomConnectionSlice.actions;
|
|
3265
|
+
const { connectionStatusChanged, knockResponseReceived } = roomConnectionSlice.actions;
|
|
3042
3266
|
const doKnockRoom = createAppThunk(() => (dispatch, getState) => {
|
|
3043
3267
|
const state = getState();
|
|
3044
3268
|
const socket = selectSignalConnectionRaw(state).socket;
|
|
@@ -3131,6 +3355,7 @@ createReactor([selectShouldConnectRoom], ({ dispatch }, shouldConnectRoom) => {
|
|
|
3131
3355
|
startAppListening({
|
|
3132
3356
|
actionCreator: signalEvents.knockHandled,
|
|
3133
3357
|
effect: ({ payload }, { dispatch, getState }) => {
|
|
3358
|
+
var _a, _b;
|
|
3134
3359
|
const { clientId, resolution } = payload;
|
|
3135
3360
|
const state = getState();
|
|
3136
3361
|
const selfId = selectSelfId(state);
|
|
@@ -3141,7 +3366,12 @@ startAppListening({
|
|
|
3141
3366
|
dispatch(setRoomKey(payload.metadata.roomKey));
|
|
3142
3367
|
dispatch(doConnectRoom());
|
|
3143
3368
|
}
|
|
3369
|
+
else if (resolution === "on_hold") {
|
|
3370
|
+
dispatch(knockResponseReceived((_a = payload.knockResponse) !== null && _a !== void 0 ? _a : null));
|
|
3371
|
+
dispatch(connectionStatusChanged("knock_on_hold"));
|
|
3372
|
+
}
|
|
3144
3373
|
else if (resolution === "rejected") {
|
|
3374
|
+
dispatch(knockResponseReceived((_b = payload.knockResponse) !== null && _b !== void 0 ? _b : null));
|
|
3145
3375
|
dispatch(connectionStatusChanged("knock_rejected"));
|
|
3146
3376
|
}
|
|
3147
3377
|
},
|
|
@@ -3420,17 +3650,33 @@ const doAcceptWaitingParticipant = createRoomConnectedThunk((payload) => (dispat
|
|
|
3420
3650
|
socket === null || socket === void 0 ? void 0 : socket.emit("handle_knock", {
|
|
3421
3651
|
action: "accept",
|
|
3422
3652
|
clientId: participantId,
|
|
3423
|
-
|
|
3653
|
+
knockResponse: {},
|
|
3654
|
+
});
|
|
3655
|
+
});
|
|
3656
|
+
const doHoldWaitingParticipant = createRoomConnectedThunk((payload) => (dispatch, getState) => {
|
|
3657
|
+
const { participantId, response } = payload;
|
|
3658
|
+
const state = getState();
|
|
3659
|
+
const socket = selectSignalConnectionSocket(state);
|
|
3660
|
+
const message = response === null || response === void 0 ? void 0 : response.trim();
|
|
3661
|
+
const knockResponse = message
|
|
3662
|
+
? { message, sender: { displayName: selectLocalParticipantDisplayName(state) } }
|
|
3663
|
+
: {};
|
|
3664
|
+
socket === null || socket === void 0 ? void 0 : socket.emit("handle_knock", {
|
|
3665
|
+
action: "hold",
|
|
3666
|
+
clientId: participantId,
|
|
3667
|
+
knockResponse,
|
|
3424
3668
|
});
|
|
3425
3669
|
});
|
|
3426
3670
|
const doRejectWaitingParticipant = createRoomConnectedThunk((payload) => (dispatch, getState) => {
|
|
3427
|
-
const { participantId } = payload;
|
|
3671
|
+
const { participantId, response } = payload;
|
|
3428
3672
|
const state = getState();
|
|
3429
3673
|
const socket = selectSignalConnectionSocket(state);
|
|
3674
|
+
const message = response === null || response === void 0 ? void 0 : response.trim();
|
|
3675
|
+
const knockResponse = message ? { message, sender: {} } : {};
|
|
3430
3676
|
socket === null || socket === void 0 ? void 0 : socket.emit("handle_knock", {
|
|
3431
3677
|
action: "reject",
|
|
3432
3678
|
clientId: participantId,
|
|
3433
|
-
|
|
3679
|
+
knockResponse,
|
|
3434
3680
|
});
|
|
3435
3681
|
});
|
|
3436
3682
|
const selectWaitingParticipantsRaw = (state) => state.waitingParticipants;
|
|
@@ -4531,4 +4777,4 @@ function createServices() {
|
|
|
4531
4777
|
};
|
|
4532
4778
|
}
|
|
4533
4779
|
|
|
4534
|
-
export { ACCEPTED_FILE_TYPES, MAX_FILES_PER_UPLOAD, MAX_FILE_SIZE, addAppListener, addSpotlight, appSlice, authorizationSlice, authorizationSliceInitialState, breakoutSlice, breakoutSliceInitialState, captioningRequestStarted, chatSlice, chatSliceInitialState, clearCaption, clearFileUploads, cloudRecordingSlice, connectionMonitorSlice, connectionMonitorSliceInitialState, connectionMonitorStarted, connectionMonitorStopped, createAppAsyncThunk, createAppAuthorizedThunk, createAppThunk, createAsyncRoomConnectedThunk, createAuthorizedRoomConnectedThunk, createReactor, createRemoteParticipant, createRoomConnectedThunk, createServices, createStore, createWebRtcEmitter, deviceBusy, deviceCredentialsSlice, deviceCredentialsSliceInitialState, deviceIdentified, deviceIdentifying, doAcceptWaitingParticipant, doAppStart, doAppStop, doBreakoutJoin, doCancelKnock, doClearNotifications, doConnectRoom, doConnectRtc, doDisconnectRtc, doDownloadFile, doEnableAudio, doEnableVideo, doEndMeeting, doGetDeviceCredentials, doHandleAcceptStreams, doHandleStreamingStarted, doHandleStreamingStopped, doKickParticipant, doKnockRoom, doLocalStreamEffect, doLockRoom, doOrganizationFetch, doRejectWaitingParticipant, doRemoveChatMessage, doRemoveSpotlight, doRequestAudioEnable, doRequestVideoEnable, doRtcAnalyticsCustomEventsInitialize, doRtcManagerCreated, doRtcManagerInitialize, doRtcReportStreamResolution, doSendChatMessage, doSendClientMetadata, doSendFiles, doSetDevice, doSetDisplayName, doSetLocalStickyReaction, doSetNotification, doSignalConnect, doSignalDisconnect, doSignalIdentifyDevice, doSpotlightParticipant, doStartCloudRecording, doStartConnectionMonitor, doStartLiveCaptions, doStartLiveTranscription, doStartLocalMedia, doStartScreenshare, doStopCloudRecording, doStopConnectionMonitor, doStopLiveCaptions, doStopLiveTranscription, doStopLocalMedia, doStopScreenshare, doSwitchLocalStream, doToggleCamera, doTriggerLocalStreamRefresh, doUpdateDeviceList, fileShareRequestSettled, fileShareSlice, fileShareSliceInitialState, fileUploadFailed, fileUploadSucceeded, fileUploadsStarted, initialCloudRecordingState, initialLiveCaptionsState, initialLiveTranscriptionState, initialLocalMediaState, initialNotificationsState, initialState$2 as initialState, isAcceptingStreams, isClientSpotlighted, listenerMiddleware, liveCaptionsSlice, liveTranscriptionSlice, localMediaSlice, localMediaStopped, localParticipantSlice, localParticipantSliceInitialState, localScreenshareSlice, localScreenshareSliceInitialState, localStreamMetadataUpdated, notificationsSlice, observeStore, organizationSlice, organizationSliceInitialState, participantStreamAdded, participantStreamIdAdded, recordingRequestStarted, remoteParticipantsSlice, remoteParticipantsSliceInitialState, removeSpotlight, resolutionReported, roomConnectionSlice, roomConnectionSliceInitialState, roomSlice, roomSliceInitialState, rootReducer, rtcAnalyticsCustomEvents, rtcAnalyticsSlice, rtcAnalyticsSliceInitialState, rtcClientConnectionStatusChanged, rtcConnectionSlice, rtcConnectionSliceInitialState, rtcDisconnected, rtcDispatcherCreated, rtcEvents, rtcManagerCreated, rtcManagerDestroyed, rtcManagerInitialized, selectAllClientViews, selectAllClientViewsInCurrentGroup, selectAppDisplayName, selectAppExternalId, selectAppIgnoreBreakoutGroups, selectAppInitialConfig, selectAppIsActive, selectAppIsAssistant, selectAppIsAudioRecorder, selectAppIsDialIn, selectAppIsNodeSdk, selectAppRaw, selectAppRoomName, selectAppRoomUrl, selectAppUserAgent, selectAssistantKey, selectAuthorizationRoleName, selectBreakoutActive, selectBreakoutAssignments, selectBreakoutCurrentGroup, selectBreakoutCurrentId, selectBreakoutGroupedParticipants, selectBreakoutGroups, selectBreakoutInitiatedBy, selectBreakoutRaw, selectBusyDeviceIds, selectCameraDeviceError, selectCameraDevices, selectChatMessages, selectChatRaw, selectCloudRecordingError, selectCloudRecordingIsInitiator, selectCloudRecordingRaw, selectCloudRecordingStartedAt, selectCloudRecordingStatus, selectConnectionMonitorIsRunning, selectCurrentCameraDeviceId, selectCurrentMicrophoneDeviceId, selectCurrentSpeakerDeviceId, selectDeviceCredentialsRaw, selectDeviceId, selectFileShareRaw, selectFileShareRequestInFlight, selectFileUploads, selectHasFetchedDeviceCredentials, selectIsAcceptingStreams, selectIsAuthorizedToAskToSpeak, selectIsAuthorizedToEndMeeting, selectIsAuthorizedToKickClient, selectIsAuthorizedToLockRoom, selectIsAuthorizedToRequestAudioEnable, selectIsAuthorizedToRequestVideoEnable, selectIsAuthorizedToSpotlight, selectIsCameraEnabled, selectIsCloudRecording, selectIsHDModeEnabled, selectIsLiveCaptions, selectIsLiveTranscription, selectIsLocalMediaStarting, selectIsLocalParticipantSpotlighted, selectIsLowDataModeEnabled, selectIsMicrophoneEnabled, selectIsSettingCameraDevice, selectIsSettingMicrophoneDevice, selectIsToggleCamera, selectIsWidescreenModeEnabled, selectLiveCaptionsError, selectLiveCaptionsLog, selectLiveCaptionsRaw, selectLiveCaptionsStartedAt, selectLiveCaptionsStatus, selectLiveTranscriptionError, selectLiveTranscriptionIsInitiator, selectLiveTranscriptionRaw, selectLiveTranscriptionStartedAt, selectLiveTranscriptionStatus, selectLocalMediaBeforeEffectTracks, selectLocalMediaConstraintsOptions, selectLocalMediaDevices, selectLocalMediaIsSwitchingStream, selectLocalMediaOptions, selectLocalMediaOwnsStream, selectLocalMediaRaw, selectLocalMediaShouldStartWithOptions, selectLocalMediaShouldStop, selectLocalMediaStartError, selectLocalMediaStatus, selectLocalMediaStream, selectLocalParticipantBreakoutAssigned, selectLocalParticipantBreakoutGroup, selectLocalParticipantClientClaim, selectLocalParticipantDisplayName, selectLocalParticipantIsScreenSharing, selectLocalParticipantRaw, selectLocalParticipantStickyReaction, selectLocalParticipantView, selectLocalScreenshareRaw, selectLocalScreenshareStatus, selectLocalScreenshareStream, selectMicrophoneDeviceError, selectMicrophoneDevices, selectNotificationsEmitter, selectNotificationsEvents, selectNotificationsRaw, selectNumClients, selectNumParticipants, selectOrganizationId, selectOrganizationPreferences, selectOrganizationRaw, selectRemoteClientViews, selectRemoteClients, selectRemoteParticipants, selectRemoteParticipantsRaw, selectRoomConnectionError, selectRoomConnectionRaw, selectRoomConnectionSession, selectRoomConnectionSessionId, selectRoomConnectionStatus, selectRoomIsLocked, selectRoomKey, selectRtcConnectionRaw, selectRtcDispatcherCreated, selectRtcIsCreatingDispatcher, selectRtcManager, selectRtcManagerInitialized, selectRtcStatus, selectScreenshares, selectSelfId, selectShouldConnectRoom, selectShouldConnectRtc, selectShouldConnectSignal, selectShouldDisconnectRtc, selectShouldFetchDeviceCredentials, selectShouldFetchOrganization, selectShouldIdentifyDevice, selectShouldInitializeRtc, selectShouldStartConnectionMonitor, selectShouldStopConnectionMonitor, selectSignalConnectionDeviceIdentified, selectSignalConnectionRaw, selectSignalConnectionSocket, selectSignalIsIdentifyingDevice, selectSignalStatus, selectSpeakerDevices, selectSpotlightedClientViews, selectSpotlights, selectSpotlightsRaw, selectStopCallbackFunction, selectStreamingRaw, selectStreamsToAccept, selectWaitingParticipants, selectWaitingParticipantsRaw, setBreakoutGroupAssigned, setCurrentCameraDeviceId, setCurrentMicrophoneDeviceId, setCurrentSpeakerDeviceId, setDisplayName, setLocalMediaOptions, setLocalMediaStream, setRoomKey, signalConnectionSlice, signalConnectionSliceInitialState, signalEvents, socketConnected, socketConnecting, socketDisconnected, socketReconnecting, spotlightsSlice, spotlightsSliceInitialState, startAppListening, stopScreenshare, streamIdForClient, streamStatusUpdated, streamingSlice, streamingSliceInitialState, toggleCameraEnabled, toggleHdModeEnabled, toggleLowDataModeEnabled, toggleMicrophoneEnabled, toggleWidescreenModeEnabled, transcribingRequestStarted, updateReportedValues, waitingParticipantsSlice, waitingParticipantsSliceInitialState };
|
|
4780
|
+
export { ACCEPTED_FILE_TYPES, BREAKOUT_GROUPS_MIN_MAX, BREAKOUT_UNAVAILABLE_ERROR, DEFAULT_BREAKOUT_TIMER_DURATION, MAX_FILES_PER_UPLOAD, MAX_FILE_SIZE, addAppListener, addSpotlight, appSlice, authorizationSlice, authorizationSliceInitialState, breakoutSlice, breakoutSliceInitialState, captioningRequestStarted, chatSlice, chatSliceInitialState, clearCaption, clearFileUploads, cloudRecordingSlice, connectionMonitorSlice, connectionMonitorSliceInitialState, connectionMonitorStarted, connectionMonitorStopped, createAppAsyncThunk, createAppAuthorizedThunk, createAppThunk, createAsyncRoomConnectedThunk, createAuthorizedRoomConnectedThunk, createBreakoutGroups, createNotificationEvent, createReactor, createRemoteParticipant, createRoomConnectedThunk, createServices, createStore, createWebRtcEmitter, defaultBreakoutGroupName, deviceBusy, deviceCredentialsSlice, deviceCredentialsSliceInitialState, deviceIdentified, deviceIdentifying, doAcceptWaitingParticipant, doAppStart, doAppStop, doAssignAllBreakoutParticipants, doAssignBreakoutParticipants, doBreakoutJoin, doCancelKnock, doClearNotifications, doConnectRoom, doConnectRtc, doDisconnectRtc, doDownloadFile, doEnableAudio, doEnableVideo, doEndMeeting, doExtendBreakoutTimer, doGetDeviceCredentials, doHandleAcceptStreams, doHandleStreamingStarted, doHandleStreamingStopped, doHoldWaitingParticipant, doKickParticipant, doKnockRoom, doLocalStreamEffect, doLockRoom, doOrganizationFetch, doRejectWaitingParticipant, doRemoveChatMessage, doRemoveSpotlight, doRequestAudioEnable, doRequestVideoEnable, doRtcAnalyticsCustomEventsInitialize, doRtcManagerCreated, doRtcManagerInitialize, doRtcReportStreamResolution, doSendChatMessage, doSendClientMetadata, doSendFiles, doSetDevice, doSetDisplayName, doSetLocalStickyReaction, doSetNotification, doShuffleBreakoutParticipants, doSignalConnect, doSignalDisconnect, doSignalIdentifyDevice, doSpotlightParticipant, doStartBreakoutSession, doStartCloudRecording, doStartConnectionMonitor, doStartLiveCaptions, doStartLiveTranscription, doStartLocalMedia, doStartScreenshare, doStopBreakoutSession, doStopBreakoutTimer, doStopCloudRecording, doStopConnectionMonitor, doStopLiveCaptions, doStopLiveTranscription, doStopLocalMedia, doStopScreenshare, doSwitchLocalStream, doToggleCamera, doTriggerLocalStreamRefresh, doUnassignAllBreakoutParticipants, doUpdateBreakoutSession, doUpdateDeviceList, fileShareRequestSettled, fileShareSlice, fileShareSliceInitialState, fileUploadFailed, fileUploadSucceeded, fileUploadsStarted, initialCloudRecordingState, initialLiveCaptionsState, initialLiveTranscriptionState, initialLocalMediaState, initialNotificationsState, initialState$2 as initialState, isAcceptingStreams, isClientSpotlighted, listenerMiddleware, liveCaptionsSlice, liveTranscriptionSlice, localMediaSlice, localMediaStopped, localParticipantSlice, localParticipantSliceInitialState, localScreenshareSlice, localScreenshareSliceInitialState, localStreamMetadataUpdated, notificationsSlice, observeStore, organizationSlice, organizationSliceInitialState, participantStreamAdded, participantStreamIdAdded, recordingRequestStarted, remoteParticipantsSlice, remoteParticipantsSliceInitialState, removeSpotlight, resolutionReported, roomConnectionSlice, roomConnectionSliceInitialState, roomSlice, roomSliceInitialState, rootReducer, rtcAnalyticsCustomEvents, rtcAnalyticsSlice, rtcAnalyticsSliceInitialState, rtcClientConnectionStatusChanged, rtcConnectionSlice, rtcConnectionSliceInitialState, rtcDisconnected, rtcDispatcherCreated, rtcEvents, rtcManagerCreated, rtcManagerDestroyed, rtcManagerInitialized, selectAllClientViews, selectAllClientViewsInCurrentGroup, selectAppDisplayName, selectAppExternalId, selectAppIgnoreBreakoutGroups, selectAppInitialConfig, selectAppIsActive, selectAppIsAssistant, selectAppIsAudioRecorder, selectAppIsDialIn, selectAppIsNodeSdk, selectAppRaw, selectAppRoomName, selectAppRoomUrl, selectAppUserAgent, selectAssistantKey, selectAuthorizationRoleName, selectBreakoutActive, selectBreakoutAssignments, selectBreakoutAutoMoveToGroup, selectBreakoutAutoMoveToMain, selectBreakoutCurrentGroup, selectBreakoutCurrentId, selectBreakoutEndTime, selectBreakoutEnforceAssignment, selectBreakoutError, selectBreakoutGroupedParticipants, selectBreakoutGroups, selectBreakoutInitiatedBy, selectBreakoutIsAvailable, selectBreakoutMoveToGroupAt, selectBreakoutMoveToGroupGracePeriod, selectBreakoutMoveToMainAt, selectBreakoutMoveToMainGracePeriod, selectBreakoutRaw, selectBreakoutStartedAt, selectBreakoutTimerDuration, selectBreakoutTimerSetting, selectBusyDeviceIds, selectCameraDeviceError, selectCameraDevices, selectChatMessages, selectChatRaw, selectCloudRecordingError, selectCloudRecordingIsInitiator, selectCloudRecordingRaw, selectCloudRecordingStartedAt, selectCloudRecordingStatus, selectConnectionMonitorIsRunning, selectCurrentCameraDeviceId, selectCurrentMicrophoneDeviceId, selectCurrentSpeakerDeviceId, selectDeviceCredentialsRaw, selectDeviceId, selectFileShareRaw, selectFileShareRequestInFlight, selectFileUploads, selectHasFetchedDeviceCredentials, selectIsAcceptingStreams, selectIsAuthorizedToAskToSpeak, selectIsAuthorizedToEndMeeting, selectIsAuthorizedToKickClient, selectIsAuthorizedToLockRoom, selectIsAuthorizedToManageBreakout, selectIsAuthorizedToRequestAudioEnable, selectIsAuthorizedToRequestVideoEnable, selectIsAuthorizedToSpotlight, selectIsCameraEnabled, selectIsCloudRecording, selectIsHDModeEnabled, selectIsLiveCaptions, selectIsLiveTranscription, selectIsLocalMediaStarting, selectIsLocalParticipantSpotlighted, selectIsLowDataModeEnabled, selectIsMicrophoneEnabled, selectIsSettingCameraDevice, selectIsSettingMicrophoneDevice, selectIsToggleCamera, selectIsWidescreenModeEnabled, selectLiveCaptionsError, selectLiveCaptionsLog, selectLiveCaptionsRaw, selectLiveCaptionsStartedAt, selectLiveCaptionsStatus, selectLiveTranscriptionError, selectLiveTranscriptionIsInitiator, selectLiveTranscriptionRaw, selectLiveTranscriptionStartedAt, selectLiveTranscriptionStatus, selectLocalMediaBeforeEffectTracks, selectLocalMediaConstraintsOptions, selectLocalMediaDevices, selectLocalMediaIsSwitchingStream, selectLocalMediaOptions, selectLocalMediaOwnsStream, selectLocalMediaRaw, selectLocalMediaShouldStartWithOptions, selectLocalMediaShouldStop, selectLocalMediaStartError, selectLocalMediaStatus, selectLocalMediaStream, selectLocalParticipantBreakoutAssigned, selectLocalParticipantBreakoutGroup, selectLocalParticipantClientClaim, selectLocalParticipantDisplayName, selectLocalParticipantIsScreenSharing, selectLocalParticipantRaw, selectLocalParticipantStickyReaction, selectLocalParticipantView, selectLocalScreenshareRaw, selectLocalScreenshareStatus, selectLocalScreenshareStream, selectMicrophoneDeviceError, selectMicrophoneDevices, selectNotificationsEmitter, selectNotificationsEvents, selectNotificationsRaw, selectNumClients, selectNumParticipants, selectOrganizationId, selectOrganizationPreferences, selectOrganizationRaw, selectRemoteClientViews, selectRemoteClients, selectRemoteParticipants, selectRemoteParticipantsRaw, selectRoomConnectionError, selectRoomConnectionKnockResponse, selectRoomConnectionRaw, selectRoomConnectionSession, selectRoomConnectionSessionId, selectRoomConnectionStatus, selectRoomIsLocked, selectRoomKey, selectRoomMode, selectRtcConnectionRaw, selectRtcDispatcherCreated, selectRtcIsCreatingDispatcher, selectRtcManager, selectRtcManagerInitialized, selectRtcStatus, selectScreenshares, selectSelfId, selectShouldConnectRoom, selectShouldConnectRtc, selectShouldConnectSignal, selectShouldDisconnectRtc, selectShouldFetchDeviceCredentials, selectShouldFetchOrganization, selectShouldIdentifyDevice, selectShouldInitializeRtc, selectShouldStartConnectionMonitor, selectShouldStopConnectionMonitor, selectSignalConnectionDeviceIdentified, selectSignalConnectionRaw, selectSignalConnectionSocket, selectSignalIsIdentifyingDevice, selectSignalStatus, selectSpeakerDevices, selectSpotlightedClientViews, selectSpotlights, selectSpotlightsRaw, selectStopCallbackFunction, selectStreamingRaw, selectStreamsToAccept, selectWaitingParticipants, selectWaitingParticipantsRaw, setBreakoutError, setBreakoutGroupAssigned, setCurrentCameraDeviceId, setCurrentMicrophoneDeviceId, setCurrentSpeakerDeviceId, setDisplayName, setLocalMediaOptions, setLocalMediaStream, setRoomKey, signalConnectionSlice, signalConnectionSliceInitialState, signalEvents, socketConnected, socketConnecting, socketDisconnected, socketReconnecting, spotlightsSlice, spotlightsSliceInitialState, startAppListening, stopScreenshare, streamIdForClient, streamStatusUpdated, streamingSlice, streamingSliceInitialState, toggleCameraEnabled, toggleHdModeEnabled, toggleLowDataModeEnabled, toggleMicrophoneEnabled, toggleWidescreenModeEnabled, transcribingRequestStarted, updateReportedValues, waitingParticipantsSlice, waitingParticipantsSliceInitialState };
|