@whereby.com/core 0.23.1 → 0.24.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 +17 -8
- package/dist/index.d.cts +162 -28
- package/dist/index.d.mts +162 -28
- package/dist/index.d.ts +162 -28
- package/dist/index.mjs +17 -8
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -45,7 +45,7 @@ const createReactor = (selectors, callback) => {
|
|
|
45
45
|
});
|
|
46
46
|
};
|
|
47
47
|
|
|
48
|
-
const coreVersion = "0.
|
|
48
|
+
const coreVersion = "0.24.0";
|
|
49
49
|
|
|
50
50
|
const initialState$f = {
|
|
51
51
|
isNodeSdk: false,
|
|
@@ -92,6 +92,7 @@ const signalEvents = {
|
|
|
92
92
|
clientLeft: createSignalEventAction("clientLeft"),
|
|
93
93
|
clientKicked: createSignalEventAction("clientKicked"),
|
|
94
94
|
clientMetadataReceived: createSignalEventAction("clientMetadataReceived"),
|
|
95
|
+
clientUnableToJoin: createSignalEventAction("clientUnableToJoin"),
|
|
95
96
|
cloudRecordingStarted: createSignalEventAction("cloudRecordingStarted"),
|
|
96
97
|
cloudRecordingStopped: createSignalEventAction("cloudRecordingStopped"),
|
|
97
98
|
disconnect: createSignalEventAction("disconnect"),
|
|
@@ -247,6 +248,7 @@ function forwardSocketEvents(socket, dispatch) {
|
|
|
247
248
|
socket.on("new_client", (payload) => dispatch(signalEvents.newClient(payload)));
|
|
248
249
|
socket.on("client_left", (payload) => dispatch(signalEvents.clientLeft(payload)));
|
|
249
250
|
socket.on("client_kicked", (payload) => dispatch(signalEvents.clientKicked(payload)));
|
|
251
|
+
socket.on("client_unable_to_join", (payload) => dispatch(signalEvents.clientUnableToJoin(payload)));
|
|
250
252
|
socket.on("audio_enabled", (payload) => dispatch(signalEvents.audioEnabled(payload)));
|
|
251
253
|
socket.on("video_enabled", (payload) => dispatch(signalEvents.videoEnabled(payload)));
|
|
252
254
|
socket.on("audio_enable_requested", (payload) => dispatch(signalEvents.audioEnableRequested(payload)));
|
|
@@ -1388,19 +1390,13 @@ const remoteParticipantsSlice = toolkit.createSlice({
|
|
|
1388
1390
|
return state;
|
|
1389
1391
|
const selfId = action.payload.selfId;
|
|
1390
1392
|
const { clients } = action.payload.room;
|
|
1391
|
-
return Object.assign(Object.assign({}, state), { remoteParticipants: clients
|
|
1392
|
-
.filter((c) => c.id !== selfId)
|
|
1393
|
-
.filter((c) => !NON_PERSON_ROLES.includes(c.role.roleName))
|
|
1394
|
-
.map((c) => createRemoteParticipant(c)) });
|
|
1393
|
+
return Object.assign(Object.assign({}, state), { remoteParticipants: clients.filter((c) => c.id !== selfId).map((c) => createRemoteParticipant(c)) });
|
|
1395
1394
|
});
|
|
1396
1395
|
builder.addCase(rtcEvents.streamAdded, (state, action) => {
|
|
1397
1396
|
return addStream(state, action.payload);
|
|
1398
1397
|
});
|
|
1399
1398
|
builder.addCase(signalEvents.newClient, (state, action) => {
|
|
1400
1399
|
const { client } = action.payload;
|
|
1401
|
-
if (NON_PERSON_ROLES.includes(client.role.roleName)) {
|
|
1402
|
-
return state;
|
|
1403
|
-
}
|
|
1404
1400
|
return addParticipant(state, createRemoteParticipant(client, true));
|
|
1405
1401
|
});
|
|
1406
1402
|
builder.addCase(signalEvents.clientLeft, (state, action) => {
|
|
@@ -1819,6 +1815,19 @@ createReactor([selectSignalStatus], ({ dispatch, getState }, signalStatus) => {
|
|
|
1819
1815
|
})));
|
|
1820
1816
|
}
|
|
1821
1817
|
});
|
|
1818
|
+
startAppListening({
|
|
1819
|
+
actionCreator: signalEvents.clientUnableToJoin,
|
|
1820
|
+
effect: (action, { dispatch }) => {
|
|
1821
|
+
var _a;
|
|
1822
|
+
if (((_a = action.payload) === null || _a === void 0 ? void 0 : _a.error) === "room_full") {
|
|
1823
|
+
dispatch(doSetNotification(createNotificationEvent({
|
|
1824
|
+
type: "clientUnableToJoinFullRoom",
|
|
1825
|
+
message: "Someone tried to join but the room is full and at capacity.",
|
|
1826
|
+
props: {},
|
|
1827
|
+
})));
|
|
1828
|
+
}
|
|
1829
|
+
},
|
|
1830
|
+
});
|
|
1822
1831
|
|
|
1823
1832
|
function isStreamerClient(client) {
|
|
1824
1833
|
return client.roleName === "streamer";
|