@whereby.com/core 1.14.1 → 1.15.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 +123 -15
- package/dist/index.d.cts +36 -3
- package/dist/index.d.mts +36 -3
- package/dist/index.d.ts +36 -3
- package/dist/index.mjs +121 -16
- package/dist/legacy-esm.js +121 -16
- package/dist/redux/index.cjs +111 -14
- package/dist/redux/index.d.cts +217 -100
- package/dist/redux/index.d.mts +217 -100
- package/dist/redux/index.d.ts +217 -100
- package/dist/redux/index.js +100 -15
- package/dist/redux/index.mjs +100 -15
- package/package.json +4 -4
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AxiosRequestConfig } from 'axios';
|
|
2
2
|
import { EventEmitter } from 'events';
|
|
3
|
-
import { RoleName, ChatMessage as ChatMessage$2, ChatFileShare, FileShareErrorCode, BreakoutConfig, RtcManager, RtcManagerDispatcher, ServerSocket, RoomJoinedErrors, RoomJoinedSuccess } from '@whereby.com/media';
|
|
3
|
+
import { LiveCaptionEvent, RoleName, ChatMessage as ChatMessage$2, ChatFileShare, FileShareErrorCode, BreakoutConfig, RtcManager, RtcManagerDispatcher, ServerSocket, RoomJoinedErrors, RoomJoinedSuccess } from '@whereby.com/media';
|
|
4
4
|
export { ChatFileShare, RoomJoinedSuccess } from '@whereby.com/media';
|
|
5
5
|
import * as redux_thunk from 'redux-thunk';
|
|
6
6
|
import * as _reduxjs_toolkit from '@reduxjs/toolkit';
|
|
@@ -385,6 +385,14 @@ declare class RoomService {
|
|
|
385
385
|
}): any;
|
|
386
386
|
}
|
|
387
387
|
|
|
388
|
+
declare class LiveCaption {
|
|
389
|
+
resultId: string;
|
|
390
|
+
participantId: string;
|
|
391
|
+
text: string;
|
|
392
|
+
timestamp: number;
|
|
393
|
+
constructor({ resultId, senderId, text }: LiveCaptionEvent);
|
|
394
|
+
}
|
|
395
|
+
|
|
388
396
|
declare function getUsableCameraEffectPresets(): Promise<string[]>;
|
|
389
397
|
declare function isAudioDenoiserSupported(): Promise<boolean>;
|
|
390
398
|
|
|
@@ -596,6 +604,14 @@ interface LiveTranscriptionState$1 {
|
|
|
596
604
|
startedAt?: number;
|
|
597
605
|
}
|
|
598
606
|
|
|
607
|
+
interface LiveCaptionsState$1 {
|
|
608
|
+
isCaptioning: boolean;
|
|
609
|
+
error?: string;
|
|
610
|
+
status?: "captioning" | "requested" | "error";
|
|
611
|
+
startedAt?: number;
|
|
612
|
+
captionLog: Array<LiveCaption>;
|
|
613
|
+
}
|
|
614
|
+
|
|
599
615
|
type FileShareError = FileShareErrorCode | "upload_failed" | "too_many_files" | "unsupported_file_type" | "file_too_large";
|
|
600
616
|
declare const MAX_FILES_PER_UPLOAD = 10;
|
|
601
617
|
declare const MAX_FILE_SIZE: number;
|
|
@@ -816,6 +832,7 @@ declare const appReducer: redux.Reducer<{
|
|
|
816
832
|
connectionMonitor: ConnectionMonitorState;
|
|
817
833
|
deviceCredentials: DeviceCredentialsState;
|
|
818
834
|
fileShare: FileShareState;
|
|
835
|
+
liveCaptions: LiveCaptionsState$1;
|
|
819
836
|
liveTranscription: LiveTranscriptionState$1;
|
|
820
837
|
localMedia: LocalMediaState$1;
|
|
821
838
|
localParticipant: LocalParticipantState$1;
|
|
@@ -842,6 +859,7 @@ declare const appReducer: redux.Reducer<{
|
|
|
842
859
|
connectionMonitor: ConnectionMonitorState | undefined;
|
|
843
860
|
deviceCredentials: DeviceCredentialsState | undefined;
|
|
844
861
|
fileShare: FileShareState | undefined;
|
|
862
|
+
liveCaptions: LiveCaptionsState$1 | undefined;
|
|
845
863
|
liveTranscription: LiveTranscriptionState$1 | undefined;
|
|
846
864
|
localMedia: LocalMediaState$1 | undefined;
|
|
847
865
|
localParticipant: LocalParticipantState$1 | undefined;
|
|
@@ -872,6 +890,7 @@ declare const createStore: ({ preloadedState, injectServices, }: {
|
|
|
872
890
|
connectionMonitor: ConnectionMonitorState;
|
|
873
891
|
deviceCredentials: DeviceCredentialsState;
|
|
874
892
|
fileShare: FileShareState;
|
|
893
|
+
liveCaptions: LiveCaptionsState$1;
|
|
875
894
|
liveTranscription: LiveTranscriptionState$1;
|
|
876
895
|
localMedia: LocalMediaState$1;
|
|
877
896
|
localParticipant: LocalParticipantState$1;
|
|
@@ -899,6 +918,7 @@ declare const createStore: ({ preloadedState, injectServices, }: {
|
|
|
899
918
|
connectionMonitor: ConnectionMonitorState;
|
|
900
919
|
deviceCredentials: DeviceCredentialsState;
|
|
901
920
|
fileShare: FileShareState;
|
|
921
|
+
liveCaptions: LiveCaptionsState$1;
|
|
902
922
|
liveTranscription: LiveTranscriptionState$1;
|
|
903
923
|
localMedia: LocalMediaState$1;
|
|
904
924
|
localParticipant: LocalParticipantState$1;
|
|
@@ -1116,6 +1136,12 @@ type CloudRecordingState = {
|
|
|
1116
1136
|
status: "recording" | "requested" | "error";
|
|
1117
1137
|
startedAt?: number;
|
|
1118
1138
|
};
|
|
1139
|
+
type LiveCaptionsState = {
|
|
1140
|
+
error?: string;
|
|
1141
|
+
status: "captioning" | "requested" | "error";
|
|
1142
|
+
startedAt?: number;
|
|
1143
|
+
captionLog: Array<LiveCaption>;
|
|
1144
|
+
};
|
|
1119
1145
|
type LiveTranscriptionState = {
|
|
1120
1146
|
error?: string;
|
|
1121
1147
|
status: "transcribing" | "requested" | "error";
|
|
@@ -1151,6 +1177,7 @@ interface RoomConnectionState {
|
|
|
1151
1177
|
isCameraEnabled: boolean;
|
|
1152
1178
|
isMicrophoneEnabled: boolean;
|
|
1153
1179
|
liveStream?: LiveStreamState;
|
|
1180
|
+
liveCaptions?: LiveCaptionsState;
|
|
1154
1181
|
liveTranscription?: LiveTranscriptionState;
|
|
1155
1182
|
localScreenshareStatus?: LocalScreenshareStatus;
|
|
1156
1183
|
localParticipant?: LocalParticipantState;
|
|
@@ -1164,6 +1191,7 @@ declare const BREAKOUT_CONFIG_CHANGED = "breakout:config-changed";
|
|
|
1164
1191
|
declare const CHAT_NEW_MESSAGE = "chat:new-message";
|
|
1165
1192
|
declare const CLOUD_RECORDING_STATUS_CHANGED = "cloud-recording:status-changed";
|
|
1166
1193
|
declare const CONNECTION_STATUS_CHANGED = "connection:status-changed";
|
|
1194
|
+
declare const LIVE_CAPTIONS_STATUS_CHANGED = "live-captions:status-changed";
|
|
1167
1195
|
declare const LIVE_TRANSCRIPTION_STATUS_CHANGED = "live-transcription:status-changed";
|
|
1168
1196
|
declare const CONNECTION_ERROR_CHANGED = "connection:error-changed";
|
|
1169
1197
|
declare const LOCAL_PARTICIPANT_CHANGED = "local-participant:changed";
|
|
@@ -1191,6 +1219,7 @@ type RoomConnectionEvents = {
|
|
|
1191
1219
|
[CHAT_NEW_MESSAGE]: [message: ChatMessage$1];
|
|
1192
1220
|
[CLOUD_RECORDING_STATUS_CHANGED]: [status: CloudRecordingState | undefined];
|
|
1193
1221
|
[CONNECTION_STATUS_CHANGED]: [status: ConnectionStatus];
|
|
1222
|
+
[LIVE_CAPTIONS_STATUS_CHANGED]: [status: LiveCaptionsState | undefined];
|
|
1194
1223
|
[LIVE_TRANSCRIPTION_STATUS_CHANGED]: [status: LiveTranscriptionState | undefined];
|
|
1195
1224
|
[CONNECTION_ERROR_CHANGED]: [error: string | null];
|
|
1196
1225
|
[LOCAL_PARTICIPANT_CHANGED]: [participant?: LocalParticipantState];
|
|
@@ -1220,6 +1249,7 @@ declare class RoomConnectionClient extends BaseClient<RoomConnectionState, RoomC
|
|
|
1220
1249
|
private connectionErrorSubscribers;
|
|
1221
1250
|
private connectionStatusSubscribers;
|
|
1222
1251
|
private liveStreamSubscribers;
|
|
1252
|
+
private liveCaptionsSubscribers;
|
|
1223
1253
|
private liveTranscriptionSubscribers;
|
|
1224
1254
|
private localParticipantSubscribers;
|
|
1225
1255
|
private localScreenshareStatusSubscribers;
|
|
@@ -1234,6 +1264,7 @@ declare class RoomConnectionClient extends BaseClient<RoomConnectionState, RoomC
|
|
|
1234
1264
|
subscribeToChatMessages(callback: (messages: ChatMessage[]) => void): () => void;
|
|
1235
1265
|
subscribeToFileUploads(callback: (uploads: FileUpload[]) => void): () => void;
|
|
1236
1266
|
subscribeToCloudRecording(callback: (status: CloudRecordingState | undefined) => void): () => void;
|
|
1267
|
+
subscribeToLiveCaptions(callback: (status: LiveCaptionsState | undefined) => void): () => void;
|
|
1237
1268
|
subscribeToLiveTranscription(callback: (status: LiveTranscriptionState | undefined) => void): () => void;
|
|
1238
1269
|
subscribeToBreakoutConfig(callback: (config: BreakoutState) => void): () => void;
|
|
1239
1270
|
subscribeToConnectionStatus(callback: (status: ConnectionStatus) => void): () => void;
|
|
@@ -1275,6 +1306,8 @@ declare class RoomConnectionClient extends BaseClient<RoomConnectionState, RoomC
|
|
|
1275
1306
|
stopCloudRecording(): void;
|
|
1276
1307
|
startLiveTranscription(): void;
|
|
1277
1308
|
stopLiveTranscription(): void;
|
|
1309
|
+
startLiveCaptions(): void;
|
|
1310
|
+
stopLiveCaptions(): void;
|
|
1278
1311
|
startScreenshare(): void;
|
|
1279
1312
|
stopScreenshare(): void;
|
|
1280
1313
|
lockRoom(locked: boolean): void;
|
|
@@ -1309,5 +1342,5 @@ declare class WherebyClient {
|
|
|
1309
1342
|
destroy(): void;
|
|
1310
1343
|
}
|
|
1311
1344
|
|
|
1312
|
-
export { ACCEPTED_FILE_TYPES, ApiClient, BREAKOUT_CONFIG_CHANGED, CAMERA_DEVICES_CHANGED, CAMERA_DEVICE_ERROR_CHANGED, CAMERA_STATE_CHANGED, CHAT_NEW_MESSAGE, CLIENT_VIEW_CHANGED, CLIENT_VIEW_SPOTLIGHTS_CHANGED, CLOUD_RECORDING_STATUS_CHANGED, CONNECTION_ERROR_CHANGED, CONNECTION_STATUS_CHANGED, CURRENT_CAMERA_CHANGED, CURRENT_MICROPHONE_CHANGED, CURRENT_SPEAKER_CHANGED, Credentials, CredentialsService, GridClient, IS_SETTING_CAMERA_DEVICE, IS_SETTING_MICROPHONE_DEVICE, LIVE_TRANSCRIPTION_STATUS_CHANGED, LOCAL_MEDIA_STARTING, LOCAL_MEDIA_START_ERROR_CHANGED, LOCAL_PARTICIPANT_CHANGED, LOCAL_SCREENSHARE_STATUS_CHANGED, LOCAL_STREAM_CHANGED, LocalMediaClient, LocalParticipant, MAX_FILES_PER_UPLOAD, MAX_FILE_SIZE, MICROPHONE_DEVICES_CHANGED, MICROPHONE_DEVICE_ERROR_CHANGED, MICROPHONE_STATE_CHANGED, NUMBER_OF_CLIENT_VIEWS_CHANGED, OrganizationApiClient, OrganizationService, OrganizationServiceCache, REMOTE_PARTICIPANTS_CHANGED, ROOM_JOINED, ROOM_JOINED_ERROR, RoomConnectionClient, RoomService, SCREENSHARE_STARTED, SCREENSHARE_STOPPED, SPEAKER_DEVICES_CHANGED, SPOTLIGHT_PARTICIPANT_ADDED, SPOTLIGHT_PARTICIPANT_REMOVED, STREAMING_STARTED, STREAMING_STOPPED, WAITING_PARTICIPANT_JOINED, WAITING_PARTICIPANT_LEFT, WherebyClient, createServices, debounce, getAudioTrack, getFakeMediaStream, getUsableCameraEffectPresets, getVideoTrack, hasValue, isAudioDenoiserSupported, parseUnverifiedRoomKeyData };
|
|
1313
|
-
export type { AppConfig, BreakoutState, ChatMessage, ChatMessageEvent, ChatMessageState, ClientView, CloudRecordingState, ConnectionStatus, FileShareError, FileUpload, FullOrganizationPermissions, GridEvents, GridState, LiveStreamState, LiveTranscriptionState, LocalMediaEvents, LocalMediaOptions, LocalMediaState, LocalParticipantState, LocalScreenshareStatus, NotificationEvents, NotificationsEventEmitter, OrganizationLimits, OrganizationOnboardingSurvey, OrganizationPermissionAction, OrganizationPermissions, OrganizationPreferences, RemoteParticipant, RemoteParticipantData, RemoteParticipantState, RequestAudioEvent, RequestVideoEvent, RoomConnectionEvents, RoomConnectionState, Screenshare, ScreenshareState, SignalClientEvent, SignalStatusEvent, StickyReaction, StickyReactionEvent, StreamState, WaitingParticipant, WaitingParticipantState, WherebyClientOptions };
|
|
1345
|
+
export { ACCEPTED_FILE_TYPES, ApiClient, BREAKOUT_CONFIG_CHANGED, CAMERA_DEVICES_CHANGED, CAMERA_DEVICE_ERROR_CHANGED, CAMERA_STATE_CHANGED, CHAT_NEW_MESSAGE, CLIENT_VIEW_CHANGED, CLIENT_VIEW_SPOTLIGHTS_CHANGED, CLOUD_RECORDING_STATUS_CHANGED, CONNECTION_ERROR_CHANGED, CONNECTION_STATUS_CHANGED, CURRENT_CAMERA_CHANGED, CURRENT_MICROPHONE_CHANGED, CURRENT_SPEAKER_CHANGED, Credentials, CredentialsService, GridClient, IS_SETTING_CAMERA_DEVICE, IS_SETTING_MICROPHONE_DEVICE, LIVE_CAPTIONS_STATUS_CHANGED, LIVE_TRANSCRIPTION_STATUS_CHANGED, LOCAL_MEDIA_STARTING, LOCAL_MEDIA_START_ERROR_CHANGED, LOCAL_PARTICIPANT_CHANGED, LOCAL_SCREENSHARE_STATUS_CHANGED, LOCAL_STREAM_CHANGED, LiveCaption, LocalMediaClient, LocalParticipant, MAX_FILES_PER_UPLOAD, MAX_FILE_SIZE, MICROPHONE_DEVICES_CHANGED, MICROPHONE_DEVICE_ERROR_CHANGED, MICROPHONE_STATE_CHANGED, NUMBER_OF_CLIENT_VIEWS_CHANGED, Organization, OrganizationApiClient, OrganizationService, OrganizationServiceCache, REMOTE_PARTICIPANTS_CHANGED, ROOM_JOINED, ROOM_JOINED_ERROR, RoomConnectionClient, RoomService, SCREENSHARE_STARTED, SCREENSHARE_STOPPED, SPEAKER_DEVICES_CHANGED, SPOTLIGHT_PARTICIPANT_ADDED, SPOTLIGHT_PARTICIPANT_REMOVED, STREAMING_STARTED, STREAMING_STOPPED, WAITING_PARTICIPANT_JOINED, WAITING_PARTICIPANT_LEFT, WherebyClient, createServices, debounce, getAudioTrack, getFakeMediaStream, getUsableCameraEffectPresets, getVideoTrack, hasValue, isAudioDenoiserSupported, parseUnverifiedRoomKeyData };
|
|
1346
|
+
export type { AppConfig, BreakoutState, ChatMessage, ChatMessageEvent, ChatMessageState, ClientView, CloudRecordingState, ConnectionStatus, FileShareError, FileUpload, FullOrganizationPermissions, GridEvents, GridState, LiveCaptionsState, LiveStreamState, LiveTranscriptionState, LocalMediaEvents, LocalMediaOptions, LocalMediaState, LocalParticipantState, LocalScreenshareStatus, NotificationEvents, NotificationsEventEmitter, OrganizationLimits, OrganizationOnboardingSurvey, OrganizationPermissionAction, OrganizationPermissions, OrganizationPreferences, RemoteParticipant, RemoteParticipantData, RemoteParticipantState, RequestAudioEvent, RequestVideoEvent, RoomConnectionEvents, RoomConnectionState, Screenshare, ScreenshareState, SignalClientEvent, SignalStatusEvent, StickyReaction, StickyReactionEvent, StreamState, WaitingParticipant, WaitingParticipantState, WherebyClientOptions };
|
package/dist/index.mjs
CHANGED
|
@@ -970,6 +970,15 @@ class RoomService {
|
|
|
970
970
|
}
|
|
971
971
|
}
|
|
972
972
|
|
|
973
|
+
class LiveCaption {
|
|
974
|
+
constructor({ resultId, senderId, text }) {
|
|
975
|
+
this.resultId = resultId;
|
|
976
|
+
this.participantId = senderId;
|
|
977
|
+
this.text = text;
|
|
978
|
+
this.timestamp = Date.now();
|
|
979
|
+
}
|
|
980
|
+
}
|
|
981
|
+
|
|
973
982
|
/******************************************************************************
|
|
974
983
|
Copyright (c) Microsoft Corporation.
|
|
975
984
|
|
|
@@ -1215,7 +1224,7 @@ const createReactor = (selectors, callback) => {
|
|
|
1215
1224
|
});
|
|
1216
1225
|
};
|
|
1217
1226
|
|
|
1218
|
-
const coreVersion = "1.
|
|
1227
|
+
const coreVersion = "1.15.0";
|
|
1219
1228
|
|
|
1220
1229
|
const initialState$2 = {
|
|
1221
1230
|
displayName: null,
|
|
@@ -1295,6 +1304,7 @@ const signalEvents = {
|
|
|
1295
1304
|
liveTranscriptionStopped: createSignalEventAction("liveTranscriptionStopped"),
|
|
1296
1305
|
liveCaptionsStarted: createSignalEventAction("liveCaptionsStarted"),
|
|
1297
1306
|
liveCaptionsStopped: createSignalEventAction("liveCaptionsStopped"),
|
|
1307
|
+
liveCaption: createSignalEventAction("liveCaption"),
|
|
1298
1308
|
};
|
|
1299
1309
|
|
|
1300
1310
|
const ROOM_ACTION_PERMISSIONS_BY_ROLE = {
|
|
@@ -1473,8 +1483,9 @@ function forwardSocketEvents(socket, dispatch) {
|
|
|
1473
1483
|
socket.on("spotlight_removed", (payload) => dispatch(signalEvents.spotlightRemoved(payload)));
|
|
1474
1484
|
socket.on("live_transcription_started", (payload) => dispatch(signalEvents.liveTranscriptionStarted(payload)));
|
|
1475
1485
|
socket.on("live_transcription_stopped", (payload) => dispatch(signalEvents.liveTranscriptionStopped(payload)));
|
|
1476
|
-
socket.on("live_captions_started", () => dispatch(signalEvents.liveCaptionsStarted()));
|
|
1477
|
-
socket.on("live_captions_stopped", () => dispatch(signalEvents.liveCaptionsStopped()));
|
|
1486
|
+
socket.on("live_captions_started", (payload) => dispatch(signalEvents.liveCaptionsStarted(payload)));
|
|
1487
|
+
socket.on("live_captions_stopped", (payload) => dispatch(signalEvents.liveCaptionsStopped(payload)));
|
|
1488
|
+
socket.on("live_caption", (payload) => dispatch(signalEvents.liveCaption(payload)));
|
|
1478
1489
|
socket.on("video_enable_requested", (payload) => dispatch(signalEvents.videoEnableRequested(payload)));
|
|
1479
1490
|
socket.on("breakout_group_joined", (payload) => dispatch(signalEvents.breakoutGroupJoined(payload)));
|
|
1480
1491
|
socket.on("breakout_session_updated", (payload) => dispatch(signalEvents.breakoutSessionUpdated(payload)));
|
|
@@ -3554,6 +3565,78 @@ const doDownloadFile = createAppAsyncThunk("fileShare/downloadFile", (payload) =
|
|
|
3554
3565
|
}));
|
|
3555
3566
|
const selectFileUploads = (state) => state.fileShare.uploads;
|
|
3556
3567
|
|
|
3568
|
+
const initialLiveCaptionsState = {
|
|
3569
|
+
isCaptioning: false,
|
|
3570
|
+
captionLog: [],
|
|
3571
|
+
};
|
|
3572
|
+
const captionTimerIds = {};
|
|
3573
|
+
const LIVE_CAPTIONS_STALE_CAPTION_TIMEOUT = 5000;
|
|
3574
|
+
const liveCaptionsSlice = createSlice({
|
|
3575
|
+
name: "liveCaptions",
|
|
3576
|
+
initialState: initialLiveCaptionsState,
|
|
3577
|
+
reducers: {
|
|
3578
|
+
captioningRequestStarted: (state) => {
|
|
3579
|
+
return Object.assign(Object.assign({}, state), { status: "requested" });
|
|
3580
|
+
},
|
|
3581
|
+
clearCaption: (state, action) => {
|
|
3582
|
+
return Object.assign(Object.assign({}, state), { captionLog: state.captionLog.filter(({ resultId }) => resultId !== action.payload.resultId) });
|
|
3583
|
+
},
|
|
3584
|
+
},
|
|
3585
|
+
extraReducers: (builder) => {
|
|
3586
|
+
builder.addCase(signalEvents.liveCaptionsStopped, (state) => {
|
|
3587
|
+
return Object.assign(Object.assign({}, state), { isCaptioning: false, startedAt: undefined, status: undefined, error: undefined, captionLog: [] });
|
|
3588
|
+
});
|
|
3589
|
+
builder.addCase(signalEvents.liveCaptionsStarted, (state, action) => {
|
|
3590
|
+
const { payload } = action;
|
|
3591
|
+
if (payload.error) {
|
|
3592
|
+
return Object.assign(Object.assign({}, state), { isCaptioning: false, startedAt: undefined, status: "error", error: payload.error, captionLog: [] });
|
|
3593
|
+
}
|
|
3594
|
+
return Object.assign(Object.assign({}, state), { isCaptioning: true, startedAt: Date.now(), status: "captioning", error: undefined, captionLog: [] });
|
|
3595
|
+
});
|
|
3596
|
+
builder.addCase(signalEvents.liveCaption, (state, action) => {
|
|
3597
|
+
const { payload } = action;
|
|
3598
|
+
const captionLog = [...state.captionLog];
|
|
3599
|
+
const lastCaption = captionLog.length ? captionLog[captionLog.length - 1] : undefined;
|
|
3600
|
+
if (!lastCaption || lastCaption.resultId !== payload.resultId) {
|
|
3601
|
+
return Object.assign(Object.assign({}, state), { captionLog: [...state.captionLog, new LiveCaption(payload)] });
|
|
3602
|
+
}
|
|
3603
|
+
return Object.assign(Object.assign({}, state), { captionLog: [
|
|
3604
|
+
...state.captionLog.slice(0, state.captionLog.length - 1),
|
|
3605
|
+
Object.assign(Object.assign({}, lastCaption), { text: payload.text }),
|
|
3606
|
+
] });
|
|
3607
|
+
});
|
|
3608
|
+
},
|
|
3609
|
+
});
|
|
3610
|
+
const { captioningRequestStarted, clearCaption } = liveCaptionsSlice.actions;
|
|
3611
|
+
const doStartLiveCaptions = createRoomConnectedThunk(() => (dispatch, getState) => {
|
|
3612
|
+
const state = getState();
|
|
3613
|
+
const socket = selectSignalConnectionRaw(state).socket;
|
|
3614
|
+
const status = selectLiveCaptionsStatus(state);
|
|
3615
|
+
if (status && ["captioning", "requested"].includes(status)) {
|
|
3616
|
+
return;
|
|
3617
|
+
}
|
|
3618
|
+
socket === null || socket === void 0 ? void 0 : socket.emit("live_captions_enabled");
|
|
3619
|
+
dispatch(captioningRequestStarted());
|
|
3620
|
+
});
|
|
3621
|
+
const doStopLiveCaptions = createRoomConnectedThunk(() => (_, getState) => {
|
|
3622
|
+
const state = getState();
|
|
3623
|
+
const socket = selectSignalConnectionRaw(state).socket;
|
|
3624
|
+
socket === null || socket === void 0 ? void 0 : socket.emit("live_captions_disabled");
|
|
3625
|
+
});
|
|
3626
|
+
const selectLiveCaptionsRaw = (state) => state.liveCaptions;
|
|
3627
|
+
const selectLiveCaptionsStatus = (state) => state.liveCaptions.status;
|
|
3628
|
+
startAppListening({
|
|
3629
|
+
actionCreator: signalEvents.liveCaption,
|
|
3630
|
+
effect: (action, { dispatch }) => {
|
|
3631
|
+
const resultId = action.payload.resultId;
|
|
3632
|
+
clearTimeout(captionTimerIds[resultId]);
|
|
3633
|
+
captionTimerIds[resultId] = setTimeout(() => {
|
|
3634
|
+
delete captionTimerIds[resultId];
|
|
3635
|
+
dispatch(clearCaption({ resultId }));
|
|
3636
|
+
}, LIVE_CAPTIONS_STALE_CAPTION_TIMEOUT);
|
|
3637
|
+
},
|
|
3638
|
+
});
|
|
3639
|
+
|
|
3557
3640
|
const initialLiveTranscriptionState = {
|
|
3558
3641
|
isInitiator: false,
|
|
3559
3642
|
isTranscribing: false,
|
|
@@ -3573,20 +3656,17 @@ const liveTranscriptionSlice = createSlice({
|
|
|
3573
3656
|
});
|
|
3574
3657
|
builder.addCase(signalEvents.liveTranscriptionStarted, (state, action) => {
|
|
3575
3658
|
const { payload } = action;
|
|
3576
|
-
if (
|
|
3577
|
-
return state;
|
|
3659
|
+
if (payload.error) {
|
|
3660
|
+
return Object.assign(Object.assign({}, state), { isInitiator: false, isTranscribing: false, status: "error", error: payload.error });
|
|
3578
3661
|
}
|
|
3579
|
-
return Object.assign(Object.assign({}, state), {
|
|
3662
|
+
return Object.assign(Object.assign({}, state), { isTranscribing: true, status: "transcribing", startedAt: new Date().getTime() });
|
|
3580
3663
|
});
|
|
3581
|
-
builder.addCase(signalEvents.
|
|
3582
|
-
|
|
3583
|
-
|
|
3584
|
-
if (((_a = client.role) === null || _a === void 0 ? void 0 : _a.roleName) === "captioner") {
|
|
3585
|
-
return Object.assign(Object.assign({}, state), { isTranscribing: true, status: "transcribing", startedAt: client.startedLiveTranscriptionAt
|
|
3586
|
-
? new Date(client.startedLiveTranscriptionAt).getTime()
|
|
3587
|
-
: new Date().getTime() });
|
|
3664
|
+
builder.addCase(signalEvents.roomJoined, (state, action) => {
|
|
3665
|
+
if ("error" in action.payload) {
|
|
3666
|
+
return state;
|
|
3588
3667
|
}
|
|
3589
|
-
|
|
3668
|
+
const { room } = action.payload || {};
|
|
3669
|
+
return Object.assign(Object.assign({}, state), { isTranscribing: Boolean(room === null || room === void 0 ? void 0 : room.liveTranscriptionId), status: (room === null || room === void 0 ? void 0 : room.liveTranscriptionId) ? "transcribing" : state.status, startedAt: (room === null || room === void 0 ? void 0 : room.liveTranscriptionId) ? new Date().getTime() : state.startedAt });
|
|
3590
3670
|
});
|
|
3591
3671
|
},
|
|
3592
3672
|
});
|
|
@@ -4673,6 +4753,7 @@ const appReducer = combineReducers({
|
|
|
4673
4753
|
connectionMonitor: connectionMonitorSlice.reducer,
|
|
4674
4754
|
deviceCredentials: deviceCredentialsSlice.reducer,
|
|
4675
4755
|
fileShare: fileShareSlice.reducer,
|
|
4756
|
+
liveCaptions: liveCaptionsSlice.reducer,
|
|
4676
4757
|
liveTranscription: liveTranscriptionSlice.reducer,
|
|
4677
4758
|
localMedia: localMediaSlice.reducer,
|
|
4678
4759
|
localParticipant: localParticipantSlice.reducer,
|
|
@@ -5023,6 +5104,7 @@ const BREAKOUT_CONFIG_CHANGED = "breakout:config-changed";
|
|
|
5023
5104
|
const CHAT_NEW_MESSAGE = "chat:new-message";
|
|
5024
5105
|
const CLOUD_RECORDING_STATUS_CHANGED = "cloud-recording:status-changed";
|
|
5025
5106
|
const CONNECTION_STATUS_CHANGED = "connection:status-changed";
|
|
5107
|
+
const LIVE_CAPTIONS_STATUS_CHANGED = "live-captions:status-changed";
|
|
5026
5108
|
const LIVE_TRANSCRIPTION_STATUS_CHANGED = "live-transcription:status-changed";
|
|
5027
5109
|
const CONNECTION_ERROR_CHANGED = "connection:error-changed";
|
|
5028
5110
|
const LOCAL_PARTICIPANT_CHANGED = "local-participant:changed";
|
|
@@ -5041,7 +5123,7 @@ const SPOTLIGHT_PARTICIPANT_REMOVED = "spotlight:participant-removed";
|
|
|
5041
5123
|
const ROOM_JOINED = "room:joined";
|
|
5042
5124
|
const ROOM_JOINED_ERROR = "room:joined:error";
|
|
5043
5125
|
|
|
5044
|
-
const selectRoomConnectionState = createSelector(selectChatMessages, selectFileUploads, selectCloudRecordingRaw, selectBreakoutCurrentGroup, selectBreakoutActive, selectBreakoutGroupedParticipants, selectAllClientViewsInCurrentGroup, selectLiveTranscriptionRaw, selectLocalParticipantRaw, selectLocalMediaStream, selectRemoteParticipants, selectScreenshares, selectRoomConnectionStatus, selectRoomConnectionError, selectStreamingRaw, selectWaitingParticipants, selectNotificationsEmitter, selectSpotlightedClientViews, selectIsCameraEnabled, selectIsMicrophoneEnabled, (chatMessages, fileUploads, cloudRecording, breakoutCurrentGroup, breakoutActive, breakoutGroupedParticipants, clientViewsInCurrentGroup, liveTranscription, localParticipant, localMediaStream, remoteParticipants, screenshares, connectionStatus, connectionError, streaming, waitingParticipants, notificationsEmitter, spotlightedClientViews, isCameraEnabled, isMicrophoneEnabled) => {
|
|
5126
|
+
const selectRoomConnectionState = createSelector(selectChatMessages, selectFileUploads, selectCloudRecordingRaw, selectBreakoutCurrentGroup, selectBreakoutActive, selectBreakoutGroupedParticipants, selectAllClientViewsInCurrentGroup, selectLiveCaptionsRaw, selectLiveTranscriptionRaw, selectLocalParticipantRaw, selectLocalMediaStream, selectRemoteParticipants, selectScreenshares, selectRoomConnectionStatus, selectRoomConnectionError, selectStreamingRaw, selectWaitingParticipants, selectNotificationsEmitter, selectSpotlightedClientViews, selectIsCameraEnabled, selectIsMicrophoneEnabled, (chatMessages, fileUploads, cloudRecording, breakoutCurrentGroup, breakoutActive, breakoutGroupedParticipants, clientViewsInCurrentGroup, liveCaptions, liveTranscription, localParticipant, localMediaStream, remoteParticipants, screenshares, connectionStatus, connectionError, streaming, waitingParticipants, notificationsEmitter, spotlightedClientViews, isCameraEnabled, isMicrophoneEnabled) => {
|
|
5045
5127
|
const state = {
|
|
5046
5128
|
chatMessages,
|
|
5047
5129
|
fileUploads,
|
|
@@ -5069,6 +5151,14 @@ const selectRoomConnectionState = createSelector(selectChatMessages, selectFileU
|
|
|
5069
5151
|
startedAt: streaming.startedAt,
|
|
5070
5152
|
}
|
|
5071
5153
|
: undefined,
|
|
5154
|
+
liveCaptions: liveCaptions.status
|
|
5155
|
+
? {
|
|
5156
|
+
error: liveCaptions.error,
|
|
5157
|
+
startedAt: liveCaptions.startedAt,
|
|
5158
|
+
status: liveCaptions.status,
|
|
5159
|
+
captionLog: liveCaptions.captionLog,
|
|
5160
|
+
}
|
|
5161
|
+
: undefined,
|
|
5072
5162
|
liveTranscription: liveTranscription.status
|
|
5073
5163
|
? {
|
|
5074
5164
|
error: liveTranscription.error,
|
|
@@ -5098,6 +5188,7 @@ class RoomConnectionClient extends BaseClient {
|
|
|
5098
5188
|
this.connectionErrorSubscribers = new Set();
|
|
5099
5189
|
this.connectionStatusSubscribers = new Set();
|
|
5100
5190
|
this.liveStreamSubscribers = new Set();
|
|
5191
|
+
this.liveCaptionsSubscribers = new Set();
|
|
5101
5192
|
this.liveTranscriptionSubscribers = new Set();
|
|
5102
5193
|
this.localParticipantSubscribers = new Set();
|
|
5103
5194
|
this.localScreenshareStatusSubscribers = new Set();
|
|
@@ -5121,6 +5212,10 @@ class RoomConnectionClient extends BaseClient {
|
|
|
5121
5212
|
this.cloudRecordingSubscribers.forEach((cb) => cb(state.cloudRecording));
|
|
5122
5213
|
this.emit(CLOUD_RECORDING_STATUS_CHANGED, state.cloudRecording);
|
|
5123
5214
|
}
|
|
5215
|
+
if (state.liveCaptions !== previousState.liveCaptions) {
|
|
5216
|
+
this.liveCaptionsSubscribers.forEach((cb) => cb(state.liveCaptions));
|
|
5217
|
+
this.emit(LIVE_CAPTIONS_STATUS_CHANGED, state.liveCaptions);
|
|
5218
|
+
}
|
|
5124
5219
|
if (state.liveTranscription !== previousState.liveTranscription) {
|
|
5125
5220
|
this.liveTranscriptionSubscribers.forEach((cb) => cb(state.liveTranscription));
|
|
5126
5221
|
this.emit(LIVE_TRANSCRIPTION_STATUS_CHANGED, state.liveTranscription);
|
|
@@ -5235,6 +5330,10 @@ class RoomConnectionClient extends BaseClient {
|
|
|
5235
5330
|
this.cloudRecordingSubscribers.add(callback);
|
|
5236
5331
|
return () => this.cloudRecordingSubscribers.delete(callback);
|
|
5237
5332
|
}
|
|
5333
|
+
subscribeToLiveCaptions(callback) {
|
|
5334
|
+
this.liveCaptionsSubscribers.add(callback);
|
|
5335
|
+
return () => this.liveCaptionsSubscribers.delete(callback);
|
|
5336
|
+
}
|
|
5238
5337
|
subscribeToLiveTranscription(callback) {
|
|
5239
5338
|
this.liveTranscriptionSubscribers.add(callback);
|
|
5240
5339
|
return () => this.liveTranscriptionSubscribers.delete(callback);
|
|
@@ -5402,6 +5501,12 @@ class RoomConnectionClient extends BaseClient {
|
|
|
5402
5501
|
stopLiveTranscription() {
|
|
5403
5502
|
this.store.dispatch(doStopLiveTranscription());
|
|
5404
5503
|
}
|
|
5504
|
+
startLiveCaptions() {
|
|
5505
|
+
this.store.dispatch(doStartLiveCaptions());
|
|
5506
|
+
}
|
|
5507
|
+
stopLiveCaptions() {
|
|
5508
|
+
this.store.dispatch(doStopLiveCaptions());
|
|
5509
|
+
}
|
|
5405
5510
|
startScreenshare() {
|
|
5406
5511
|
this.store.dispatch(doStartScreenshare());
|
|
5407
5512
|
}
|
|
@@ -5546,4 +5651,4 @@ class WherebyClient {
|
|
|
5546
5651
|
}
|
|
5547
5652
|
}
|
|
5548
5653
|
|
|
5549
|
-
export { ACCEPTED_FILE_TYPES, ApiClient, BREAKOUT_CONFIG_CHANGED, CAMERA_DEVICES_CHANGED, CAMERA_DEVICE_ERROR_CHANGED, CAMERA_STATE_CHANGED, CHAT_NEW_MESSAGE, CLIENT_VIEW_CHANGED, CLIENT_VIEW_SPOTLIGHTS_CHANGED, CLOUD_RECORDING_STATUS_CHANGED, CONNECTION_ERROR_CHANGED, CONNECTION_STATUS_CHANGED, CURRENT_CAMERA_CHANGED, CURRENT_MICROPHONE_CHANGED, CURRENT_SPEAKER_CHANGED, Credentials, CredentialsService, GridClient, IS_SETTING_CAMERA_DEVICE, IS_SETTING_MICROPHONE_DEVICE, LIVE_TRANSCRIPTION_STATUS_CHANGED, LOCAL_MEDIA_STARTING, LOCAL_MEDIA_START_ERROR_CHANGED, LOCAL_PARTICIPANT_CHANGED, LOCAL_SCREENSHARE_STATUS_CHANGED, LOCAL_STREAM_CHANGED, LocalMediaClient, LocalParticipant, MAX_FILES_PER_UPLOAD, MAX_FILE_SIZE, MICROPHONE_DEVICES_CHANGED, MICROPHONE_DEVICE_ERROR_CHANGED, MICROPHONE_STATE_CHANGED, NUMBER_OF_CLIENT_VIEWS_CHANGED, OrganizationApiClient, OrganizationService, OrganizationServiceCache, REMOTE_PARTICIPANTS_CHANGED, ROOM_JOINED, ROOM_JOINED_ERROR, RoomConnectionClient, RoomService, SCREENSHARE_STARTED, SCREENSHARE_STOPPED, SPEAKER_DEVICES_CHANGED, SPOTLIGHT_PARTICIPANT_ADDED, SPOTLIGHT_PARTICIPANT_REMOVED, STREAMING_STARTED, STREAMING_STOPPED, WAITING_PARTICIPANT_JOINED, WAITING_PARTICIPANT_LEFT, WherebyClient, createServices, debounce, getAudioTrack, getFakeMediaStream, getUsableCameraEffectPresets, getVideoTrack, hasValue, isAudioDenoiserSupported, parseUnverifiedRoomKeyData };
|
|
5654
|
+
export { ACCEPTED_FILE_TYPES, ApiClient, BREAKOUT_CONFIG_CHANGED, CAMERA_DEVICES_CHANGED, CAMERA_DEVICE_ERROR_CHANGED, CAMERA_STATE_CHANGED, CHAT_NEW_MESSAGE, CLIENT_VIEW_CHANGED, CLIENT_VIEW_SPOTLIGHTS_CHANGED, CLOUD_RECORDING_STATUS_CHANGED, CONNECTION_ERROR_CHANGED, CONNECTION_STATUS_CHANGED, CURRENT_CAMERA_CHANGED, CURRENT_MICROPHONE_CHANGED, CURRENT_SPEAKER_CHANGED, Credentials, CredentialsService, GridClient, IS_SETTING_CAMERA_DEVICE, IS_SETTING_MICROPHONE_DEVICE, LIVE_CAPTIONS_STATUS_CHANGED, LIVE_TRANSCRIPTION_STATUS_CHANGED, LOCAL_MEDIA_STARTING, LOCAL_MEDIA_START_ERROR_CHANGED, LOCAL_PARTICIPANT_CHANGED, LOCAL_SCREENSHARE_STATUS_CHANGED, LOCAL_STREAM_CHANGED, LiveCaption, LocalMediaClient, LocalParticipant, MAX_FILES_PER_UPLOAD, MAX_FILE_SIZE, MICROPHONE_DEVICES_CHANGED, MICROPHONE_DEVICE_ERROR_CHANGED, MICROPHONE_STATE_CHANGED, NUMBER_OF_CLIENT_VIEWS_CHANGED, Organization, OrganizationApiClient, OrganizationService, OrganizationServiceCache, REMOTE_PARTICIPANTS_CHANGED, ROOM_JOINED, ROOM_JOINED_ERROR, RoomConnectionClient, RoomService, SCREENSHARE_STARTED, SCREENSHARE_STOPPED, SPEAKER_DEVICES_CHANGED, SPOTLIGHT_PARTICIPANT_ADDED, SPOTLIGHT_PARTICIPANT_REMOVED, STREAMING_STARTED, STREAMING_STOPPED, WAITING_PARTICIPANT_JOINED, WAITING_PARTICIPANT_LEFT, WherebyClient, createServices, debounce, getAudioTrack, getFakeMediaStream, getUsableCameraEffectPresets, getVideoTrack, hasValue, isAudioDenoiserSupported, parseUnverifiedRoomKeyData };
|
package/dist/legacy-esm.js
CHANGED
|
@@ -970,6 +970,15 @@ class RoomService {
|
|
|
970
970
|
}
|
|
971
971
|
}
|
|
972
972
|
|
|
973
|
+
class LiveCaption {
|
|
974
|
+
constructor({ resultId, senderId, text }) {
|
|
975
|
+
this.resultId = resultId;
|
|
976
|
+
this.participantId = senderId;
|
|
977
|
+
this.text = text;
|
|
978
|
+
this.timestamp = Date.now();
|
|
979
|
+
}
|
|
980
|
+
}
|
|
981
|
+
|
|
973
982
|
/******************************************************************************
|
|
974
983
|
Copyright (c) Microsoft Corporation.
|
|
975
984
|
|
|
@@ -1215,7 +1224,7 @@ const createReactor = (selectors, callback) => {
|
|
|
1215
1224
|
});
|
|
1216
1225
|
};
|
|
1217
1226
|
|
|
1218
|
-
const coreVersion = "1.
|
|
1227
|
+
const coreVersion = "1.15.0";
|
|
1219
1228
|
|
|
1220
1229
|
const initialState$2 = {
|
|
1221
1230
|
displayName: null,
|
|
@@ -1295,6 +1304,7 @@ const signalEvents = {
|
|
|
1295
1304
|
liveTranscriptionStopped: createSignalEventAction("liveTranscriptionStopped"),
|
|
1296
1305
|
liveCaptionsStarted: createSignalEventAction("liveCaptionsStarted"),
|
|
1297
1306
|
liveCaptionsStopped: createSignalEventAction("liveCaptionsStopped"),
|
|
1307
|
+
liveCaption: createSignalEventAction("liveCaption"),
|
|
1298
1308
|
};
|
|
1299
1309
|
|
|
1300
1310
|
const ROOM_ACTION_PERMISSIONS_BY_ROLE = {
|
|
@@ -1473,8 +1483,9 @@ function forwardSocketEvents(socket, dispatch) {
|
|
|
1473
1483
|
socket.on("spotlight_removed", (payload) => dispatch(signalEvents.spotlightRemoved(payload)));
|
|
1474
1484
|
socket.on("live_transcription_started", (payload) => dispatch(signalEvents.liveTranscriptionStarted(payload)));
|
|
1475
1485
|
socket.on("live_transcription_stopped", (payload) => dispatch(signalEvents.liveTranscriptionStopped(payload)));
|
|
1476
|
-
socket.on("live_captions_started", () => dispatch(signalEvents.liveCaptionsStarted()));
|
|
1477
|
-
socket.on("live_captions_stopped", () => dispatch(signalEvents.liveCaptionsStopped()));
|
|
1486
|
+
socket.on("live_captions_started", (payload) => dispatch(signalEvents.liveCaptionsStarted(payload)));
|
|
1487
|
+
socket.on("live_captions_stopped", (payload) => dispatch(signalEvents.liveCaptionsStopped(payload)));
|
|
1488
|
+
socket.on("live_caption", (payload) => dispatch(signalEvents.liveCaption(payload)));
|
|
1478
1489
|
socket.on("video_enable_requested", (payload) => dispatch(signalEvents.videoEnableRequested(payload)));
|
|
1479
1490
|
socket.on("breakout_group_joined", (payload) => dispatch(signalEvents.breakoutGroupJoined(payload)));
|
|
1480
1491
|
socket.on("breakout_session_updated", (payload) => dispatch(signalEvents.breakoutSessionUpdated(payload)));
|
|
@@ -3554,6 +3565,78 @@ const doDownloadFile = createAppAsyncThunk("fileShare/downloadFile", (payload) =
|
|
|
3554
3565
|
}));
|
|
3555
3566
|
const selectFileUploads = (state) => state.fileShare.uploads;
|
|
3556
3567
|
|
|
3568
|
+
const initialLiveCaptionsState = {
|
|
3569
|
+
isCaptioning: false,
|
|
3570
|
+
captionLog: [],
|
|
3571
|
+
};
|
|
3572
|
+
const captionTimerIds = {};
|
|
3573
|
+
const LIVE_CAPTIONS_STALE_CAPTION_TIMEOUT = 5000;
|
|
3574
|
+
const liveCaptionsSlice = createSlice({
|
|
3575
|
+
name: "liveCaptions",
|
|
3576
|
+
initialState: initialLiveCaptionsState,
|
|
3577
|
+
reducers: {
|
|
3578
|
+
captioningRequestStarted: (state) => {
|
|
3579
|
+
return Object.assign(Object.assign({}, state), { status: "requested" });
|
|
3580
|
+
},
|
|
3581
|
+
clearCaption: (state, action) => {
|
|
3582
|
+
return Object.assign(Object.assign({}, state), { captionLog: state.captionLog.filter(({ resultId }) => resultId !== action.payload.resultId) });
|
|
3583
|
+
},
|
|
3584
|
+
},
|
|
3585
|
+
extraReducers: (builder) => {
|
|
3586
|
+
builder.addCase(signalEvents.liveCaptionsStopped, (state) => {
|
|
3587
|
+
return Object.assign(Object.assign({}, state), { isCaptioning: false, startedAt: undefined, status: undefined, error: undefined, captionLog: [] });
|
|
3588
|
+
});
|
|
3589
|
+
builder.addCase(signalEvents.liveCaptionsStarted, (state, action) => {
|
|
3590
|
+
const { payload } = action;
|
|
3591
|
+
if (payload.error) {
|
|
3592
|
+
return Object.assign(Object.assign({}, state), { isCaptioning: false, startedAt: undefined, status: "error", error: payload.error, captionLog: [] });
|
|
3593
|
+
}
|
|
3594
|
+
return Object.assign(Object.assign({}, state), { isCaptioning: true, startedAt: Date.now(), status: "captioning", error: undefined, captionLog: [] });
|
|
3595
|
+
});
|
|
3596
|
+
builder.addCase(signalEvents.liveCaption, (state, action) => {
|
|
3597
|
+
const { payload } = action;
|
|
3598
|
+
const captionLog = [...state.captionLog];
|
|
3599
|
+
const lastCaption = captionLog.length ? captionLog[captionLog.length - 1] : undefined;
|
|
3600
|
+
if (!lastCaption || lastCaption.resultId !== payload.resultId) {
|
|
3601
|
+
return Object.assign(Object.assign({}, state), { captionLog: [...state.captionLog, new LiveCaption(payload)] });
|
|
3602
|
+
}
|
|
3603
|
+
return Object.assign(Object.assign({}, state), { captionLog: [
|
|
3604
|
+
...state.captionLog.slice(0, state.captionLog.length - 1),
|
|
3605
|
+
Object.assign(Object.assign({}, lastCaption), { text: payload.text }),
|
|
3606
|
+
] });
|
|
3607
|
+
});
|
|
3608
|
+
},
|
|
3609
|
+
});
|
|
3610
|
+
const { captioningRequestStarted, clearCaption } = liveCaptionsSlice.actions;
|
|
3611
|
+
const doStartLiveCaptions = createRoomConnectedThunk(() => (dispatch, getState) => {
|
|
3612
|
+
const state = getState();
|
|
3613
|
+
const socket = selectSignalConnectionRaw(state).socket;
|
|
3614
|
+
const status = selectLiveCaptionsStatus(state);
|
|
3615
|
+
if (status && ["captioning", "requested"].includes(status)) {
|
|
3616
|
+
return;
|
|
3617
|
+
}
|
|
3618
|
+
socket === null || socket === void 0 ? void 0 : socket.emit("live_captions_enabled");
|
|
3619
|
+
dispatch(captioningRequestStarted());
|
|
3620
|
+
});
|
|
3621
|
+
const doStopLiveCaptions = createRoomConnectedThunk(() => (_, getState) => {
|
|
3622
|
+
const state = getState();
|
|
3623
|
+
const socket = selectSignalConnectionRaw(state).socket;
|
|
3624
|
+
socket === null || socket === void 0 ? void 0 : socket.emit("live_captions_disabled");
|
|
3625
|
+
});
|
|
3626
|
+
const selectLiveCaptionsRaw = (state) => state.liveCaptions;
|
|
3627
|
+
const selectLiveCaptionsStatus = (state) => state.liveCaptions.status;
|
|
3628
|
+
startAppListening({
|
|
3629
|
+
actionCreator: signalEvents.liveCaption,
|
|
3630
|
+
effect: (action, { dispatch }) => {
|
|
3631
|
+
const resultId = action.payload.resultId;
|
|
3632
|
+
clearTimeout(captionTimerIds[resultId]);
|
|
3633
|
+
captionTimerIds[resultId] = setTimeout(() => {
|
|
3634
|
+
delete captionTimerIds[resultId];
|
|
3635
|
+
dispatch(clearCaption({ resultId }));
|
|
3636
|
+
}, LIVE_CAPTIONS_STALE_CAPTION_TIMEOUT);
|
|
3637
|
+
},
|
|
3638
|
+
});
|
|
3639
|
+
|
|
3557
3640
|
const initialLiveTranscriptionState = {
|
|
3558
3641
|
isInitiator: false,
|
|
3559
3642
|
isTranscribing: false,
|
|
@@ -3573,20 +3656,17 @@ const liveTranscriptionSlice = createSlice({
|
|
|
3573
3656
|
});
|
|
3574
3657
|
builder.addCase(signalEvents.liveTranscriptionStarted, (state, action) => {
|
|
3575
3658
|
const { payload } = action;
|
|
3576
|
-
if (
|
|
3577
|
-
return state;
|
|
3659
|
+
if (payload.error) {
|
|
3660
|
+
return Object.assign(Object.assign({}, state), { isInitiator: false, isTranscribing: false, status: "error", error: payload.error });
|
|
3578
3661
|
}
|
|
3579
|
-
return Object.assign(Object.assign({}, state), {
|
|
3662
|
+
return Object.assign(Object.assign({}, state), { isTranscribing: true, status: "transcribing", startedAt: new Date().getTime() });
|
|
3580
3663
|
});
|
|
3581
|
-
builder.addCase(signalEvents.
|
|
3582
|
-
|
|
3583
|
-
|
|
3584
|
-
if (((_a = client.role) === null || _a === void 0 ? void 0 : _a.roleName) === "captioner") {
|
|
3585
|
-
return Object.assign(Object.assign({}, state), { isTranscribing: true, status: "transcribing", startedAt: client.startedLiveTranscriptionAt
|
|
3586
|
-
? new Date(client.startedLiveTranscriptionAt).getTime()
|
|
3587
|
-
: new Date().getTime() });
|
|
3664
|
+
builder.addCase(signalEvents.roomJoined, (state, action) => {
|
|
3665
|
+
if ("error" in action.payload) {
|
|
3666
|
+
return state;
|
|
3588
3667
|
}
|
|
3589
|
-
|
|
3668
|
+
const { room } = action.payload || {};
|
|
3669
|
+
return Object.assign(Object.assign({}, state), { isTranscribing: Boolean(room === null || room === void 0 ? void 0 : room.liveTranscriptionId), status: (room === null || room === void 0 ? void 0 : room.liveTranscriptionId) ? "transcribing" : state.status, startedAt: (room === null || room === void 0 ? void 0 : room.liveTranscriptionId) ? new Date().getTime() : state.startedAt });
|
|
3590
3670
|
});
|
|
3591
3671
|
},
|
|
3592
3672
|
});
|
|
@@ -4673,6 +4753,7 @@ const appReducer = combineReducers({
|
|
|
4673
4753
|
connectionMonitor: connectionMonitorSlice.reducer,
|
|
4674
4754
|
deviceCredentials: deviceCredentialsSlice.reducer,
|
|
4675
4755
|
fileShare: fileShareSlice.reducer,
|
|
4756
|
+
liveCaptions: liveCaptionsSlice.reducer,
|
|
4676
4757
|
liveTranscription: liveTranscriptionSlice.reducer,
|
|
4677
4758
|
localMedia: localMediaSlice.reducer,
|
|
4678
4759
|
localParticipant: localParticipantSlice.reducer,
|
|
@@ -5023,6 +5104,7 @@ const BREAKOUT_CONFIG_CHANGED = "breakout:config-changed";
|
|
|
5023
5104
|
const CHAT_NEW_MESSAGE = "chat:new-message";
|
|
5024
5105
|
const CLOUD_RECORDING_STATUS_CHANGED = "cloud-recording:status-changed";
|
|
5025
5106
|
const CONNECTION_STATUS_CHANGED = "connection:status-changed";
|
|
5107
|
+
const LIVE_CAPTIONS_STATUS_CHANGED = "live-captions:status-changed";
|
|
5026
5108
|
const LIVE_TRANSCRIPTION_STATUS_CHANGED = "live-transcription:status-changed";
|
|
5027
5109
|
const CONNECTION_ERROR_CHANGED = "connection:error-changed";
|
|
5028
5110
|
const LOCAL_PARTICIPANT_CHANGED = "local-participant:changed";
|
|
@@ -5041,7 +5123,7 @@ const SPOTLIGHT_PARTICIPANT_REMOVED = "spotlight:participant-removed";
|
|
|
5041
5123
|
const ROOM_JOINED = "room:joined";
|
|
5042
5124
|
const ROOM_JOINED_ERROR = "room:joined:error";
|
|
5043
5125
|
|
|
5044
|
-
const selectRoomConnectionState = createSelector(selectChatMessages, selectFileUploads, selectCloudRecordingRaw, selectBreakoutCurrentGroup, selectBreakoutActive, selectBreakoutGroupedParticipants, selectAllClientViewsInCurrentGroup, selectLiveTranscriptionRaw, selectLocalParticipantRaw, selectLocalMediaStream, selectRemoteParticipants, selectScreenshares, selectRoomConnectionStatus, selectRoomConnectionError, selectStreamingRaw, selectWaitingParticipants, selectNotificationsEmitter, selectSpotlightedClientViews, selectIsCameraEnabled, selectIsMicrophoneEnabled, (chatMessages, fileUploads, cloudRecording, breakoutCurrentGroup, breakoutActive, breakoutGroupedParticipants, clientViewsInCurrentGroup, liveTranscription, localParticipant, localMediaStream, remoteParticipants, screenshares, connectionStatus, connectionError, streaming, waitingParticipants, notificationsEmitter, spotlightedClientViews, isCameraEnabled, isMicrophoneEnabled) => {
|
|
5126
|
+
const selectRoomConnectionState = createSelector(selectChatMessages, selectFileUploads, selectCloudRecordingRaw, selectBreakoutCurrentGroup, selectBreakoutActive, selectBreakoutGroupedParticipants, selectAllClientViewsInCurrentGroup, selectLiveCaptionsRaw, selectLiveTranscriptionRaw, selectLocalParticipantRaw, selectLocalMediaStream, selectRemoteParticipants, selectScreenshares, selectRoomConnectionStatus, selectRoomConnectionError, selectStreamingRaw, selectWaitingParticipants, selectNotificationsEmitter, selectSpotlightedClientViews, selectIsCameraEnabled, selectIsMicrophoneEnabled, (chatMessages, fileUploads, cloudRecording, breakoutCurrentGroup, breakoutActive, breakoutGroupedParticipants, clientViewsInCurrentGroup, liveCaptions, liveTranscription, localParticipant, localMediaStream, remoteParticipants, screenshares, connectionStatus, connectionError, streaming, waitingParticipants, notificationsEmitter, spotlightedClientViews, isCameraEnabled, isMicrophoneEnabled) => {
|
|
5045
5127
|
const state = {
|
|
5046
5128
|
chatMessages,
|
|
5047
5129
|
fileUploads,
|
|
@@ -5069,6 +5151,14 @@ const selectRoomConnectionState = createSelector(selectChatMessages, selectFileU
|
|
|
5069
5151
|
startedAt: streaming.startedAt,
|
|
5070
5152
|
}
|
|
5071
5153
|
: undefined,
|
|
5154
|
+
liveCaptions: liveCaptions.status
|
|
5155
|
+
? {
|
|
5156
|
+
error: liveCaptions.error,
|
|
5157
|
+
startedAt: liveCaptions.startedAt,
|
|
5158
|
+
status: liveCaptions.status,
|
|
5159
|
+
captionLog: liveCaptions.captionLog,
|
|
5160
|
+
}
|
|
5161
|
+
: undefined,
|
|
5072
5162
|
liveTranscription: liveTranscription.status
|
|
5073
5163
|
? {
|
|
5074
5164
|
error: liveTranscription.error,
|
|
@@ -5098,6 +5188,7 @@ class RoomConnectionClient extends BaseClient {
|
|
|
5098
5188
|
this.connectionErrorSubscribers = new Set();
|
|
5099
5189
|
this.connectionStatusSubscribers = new Set();
|
|
5100
5190
|
this.liveStreamSubscribers = new Set();
|
|
5191
|
+
this.liveCaptionsSubscribers = new Set();
|
|
5101
5192
|
this.liveTranscriptionSubscribers = new Set();
|
|
5102
5193
|
this.localParticipantSubscribers = new Set();
|
|
5103
5194
|
this.localScreenshareStatusSubscribers = new Set();
|
|
@@ -5121,6 +5212,10 @@ class RoomConnectionClient extends BaseClient {
|
|
|
5121
5212
|
this.cloudRecordingSubscribers.forEach((cb) => cb(state.cloudRecording));
|
|
5122
5213
|
this.emit(CLOUD_RECORDING_STATUS_CHANGED, state.cloudRecording);
|
|
5123
5214
|
}
|
|
5215
|
+
if (state.liveCaptions !== previousState.liveCaptions) {
|
|
5216
|
+
this.liveCaptionsSubscribers.forEach((cb) => cb(state.liveCaptions));
|
|
5217
|
+
this.emit(LIVE_CAPTIONS_STATUS_CHANGED, state.liveCaptions);
|
|
5218
|
+
}
|
|
5124
5219
|
if (state.liveTranscription !== previousState.liveTranscription) {
|
|
5125
5220
|
this.liveTranscriptionSubscribers.forEach((cb) => cb(state.liveTranscription));
|
|
5126
5221
|
this.emit(LIVE_TRANSCRIPTION_STATUS_CHANGED, state.liveTranscription);
|
|
@@ -5235,6 +5330,10 @@ class RoomConnectionClient extends BaseClient {
|
|
|
5235
5330
|
this.cloudRecordingSubscribers.add(callback);
|
|
5236
5331
|
return () => this.cloudRecordingSubscribers.delete(callback);
|
|
5237
5332
|
}
|
|
5333
|
+
subscribeToLiveCaptions(callback) {
|
|
5334
|
+
this.liveCaptionsSubscribers.add(callback);
|
|
5335
|
+
return () => this.liveCaptionsSubscribers.delete(callback);
|
|
5336
|
+
}
|
|
5238
5337
|
subscribeToLiveTranscription(callback) {
|
|
5239
5338
|
this.liveTranscriptionSubscribers.add(callback);
|
|
5240
5339
|
return () => this.liveTranscriptionSubscribers.delete(callback);
|
|
@@ -5402,6 +5501,12 @@ class RoomConnectionClient extends BaseClient {
|
|
|
5402
5501
|
stopLiveTranscription() {
|
|
5403
5502
|
this.store.dispatch(doStopLiveTranscription());
|
|
5404
5503
|
}
|
|
5504
|
+
startLiveCaptions() {
|
|
5505
|
+
this.store.dispatch(doStartLiveCaptions());
|
|
5506
|
+
}
|
|
5507
|
+
stopLiveCaptions() {
|
|
5508
|
+
this.store.dispatch(doStopLiveCaptions());
|
|
5509
|
+
}
|
|
5405
5510
|
startScreenshare() {
|
|
5406
5511
|
this.store.dispatch(doStartScreenshare());
|
|
5407
5512
|
}
|
|
@@ -5546,4 +5651,4 @@ class WherebyClient {
|
|
|
5546
5651
|
}
|
|
5547
5652
|
}
|
|
5548
5653
|
|
|
5549
|
-
export { ACCEPTED_FILE_TYPES, ApiClient, BREAKOUT_CONFIG_CHANGED, CAMERA_DEVICES_CHANGED, CAMERA_DEVICE_ERROR_CHANGED, CAMERA_STATE_CHANGED, CHAT_NEW_MESSAGE, CLIENT_VIEW_CHANGED, CLIENT_VIEW_SPOTLIGHTS_CHANGED, CLOUD_RECORDING_STATUS_CHANGED, CONNECTION_ERROR_CHANGED, CONNECTION_STATUS_CHANGED, CURRENT_CAMERA_CHANGED, CURRENT_MICROPHONE_CHANGED, CURRENT_SPEAKER_CHANGED, Credentials, CredentialsService, GridClient, IS_SETTING_CAMERA_DEVICE, IS_SETTING_MICROPHONE_DEVICE, LIVE_TRANSCRIPTION_STATUS_CHANGED, LOCAL_MEDIA_STARTING, LOCAL_MEDIA_START_ERROR_CHANGED, LOCAL_PARTICIPANT_CHANGED, LOCAL_SCREENSHARE_STATUS_CHANGED, LOCAL_STREAM_CHANGED, LocalMediaClient, LocalParticipant, MAX_FILES_PER_UPLOAD, MAX_FILE_SIZE, MICROPHONE_DEVICES_CHANGED, MICROPHONE_DEVICE_ERROR_CHANGED, MICROPHONE_STATE_CHANGED, NUMBER_OF_CLIENT_VIEWS_CHANGED, OrganizationApiClient, OrganizationService, OrganizationServiceCache, REMOTE_PARTICIPANTS_CHANGED, ROOM_JOINED, ROOM_JOINED_ERROR, RoomConnectionClient, RoomService, SCREENSHARE_STARTED, SCREENSHARE_STOPPED, SPEAKER_DEVICES_CHANGED, SPOTLIGHT_PARTICIPANT_ADDED, SPOTLIGHT_PARTICIPANT_REMOVED, STREAMING_STARTED, STREAMING_STOPPED, WAITING_PARTICIPANT_JOINED, WAITING_PARTICIPANT_LEFT, WherebyClient, createServices, debounce, getAudioTrack, getFakeMediaStream, getUsableCameraEffectPresets, getVideoTrack, hasValue, isAudioDenoiserSupported, parseUnverifiedRoomKeyData };
|
|
5654
|
+
export { ACCEPTED_FILE_TYPES, ApiClient, BREAKOUT_CONFIG_CHANGED, CAMERA_DEVICES_CHANGED, CAMERA_DEVICE_ERROR_CHANGED, CAMERA_STATE_CHANGED, CHAT_NEW_MESSAGE, CLIENT_VIEW_CHANGED, CLIENT_VIEW_SPOTLIGHTS_CHANGED, CLOUD_RECORDING_STATUS_CHANGED, CONNECTION_ERROR_CHANGED, CONNECTION_STATUS_CHANGED, CURRENT_CAMERA_CHANGED, CURRENT_MICROPHONE_CHANGED, CURRENT_SPEAKER_CHANGED, Credentials, CredentialsService, GridClient, IS_SETTING_CAMERA_DEVICE, IS_SETTING_MICROPHONE_DEVICE, LIVE_CAPTIONS_STATUS_CHANGED, LIVE_TRANSCRIPTION_STATUS_CHANGED, LOCAL_MEDIA_STARTING, LOCAL_MEDIA_START_ERROR_CHANGED, LOCAL_PARTICIPANT_CHANGED, LOCAL_SCREENSHARE_STATUS_CHANGED, LOCAL_STREAM_CHANGED, LiveCaption, LocalMediaClient, LocalParticipant, MAX_FILES_PER_UPLOAD, MAX_FILE_SIZE, MICROPHONE_DEVICES_CHANGED, MICROPHONE_DEVICE_ERROR_CHANGED, MICROPHONE_STATE_CHANGED, NUMBER_OF_CLIENT_VIEWS_CHANGED, Organization, OrganizationApiClient, OrganizationService, OrganizationServiceCache, REMOTE_PARTICIPANTS_CHANGED, ROOM_JOINED, ROOM_JOINED_ERROR, RoomConnectionClient, RoomService, SCREENSHARE_STARTED, SCREENSHARE_STOPPED, SPEAKER_DEVICES_CHANGED, SPOTLIGHT_PARTICIPANT_ADDED, SPOTLIGHT_PARTICIPANT_REMOVED, STREAMING_STARTED, STREAMING_STOPPED, WAITING_PARTICIPANT_JOINED, WAITING_PARTICIPANT_LEFT, WherebyClient, createServices, debounce, getAudioTrack, getFakeMediaStream, getUsableCameraEffectPresets, getVideoTrack, hasValue, isAudioDenoiserSupported, parseUnverifiedRoomKeyData };
|