@whereby.com/core 1.8.2 → 1.9.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.mjs CHANGED
@@ -1156,7 +1156,7 @@ const createReactor = (selectors, callback) => {
1156
1156
  });
1157
1157
  };
1158
1158
 
1159
- const coreVersion = "1.8.2";
1159
+ const coreVersion = "1.9.0";
1160
1160
 
1161
1161
  const initialState$1 = {
1162
1162
  displayName: null,
@@ -2109,7 +2109,7 @@ startAppListening({
2109
2109
  },
2110
2110
  });
2111
2111
 
2112
- const NON_PERSON_ROLES = ["recorder", "streamer"];
2112
+ const NON_PERSON_ROLES = ["recorder", "streamer", "captioner", "assistant"];
2113
2113
 
2114
2114
  const selectLocalParticipantRaw = (state) => state.localParticipant;
2115
2115
  const selectSelfId = (state) => state.localParticipant.id;
@@ -2259,7 +2259,6 @@ const selectChatMessages = (state) => state.chat.chatMessages;
2259
2259
  const initialCloudRecordingState = {
2260
2260
  isInitiator: false,
2261
2261
  isRecording: false,
2262
- error: null,
2263
2262
  startedAt: undefined,
2264
2263
  };
2265
2264
  const cloudRecordingSlice = createSlice({
@@ -3346,6 +3345,63 @@ createReactor([selectShouldStopConnectionMonitor], ({ dispatch }, shouldStartCon
3346
3345
  }
3347
3346
  });
3348
3347
 
3348
+ const initialLiveTranscriptionState = {
3349
+ isInitiator: false,
3350
+ isTranscribing: false,
3351
+ startedAt: undefined,
3352
+ };
3353
+ const liveTranscriptionSlice = createSlice({
3354
+ name: "liveTranscription",
3355
+ initialState: initialLiveTranscriptionState,
3356
+ reducers: {
3357
+ transcribingRequestStarted: (state) => {
3358
+ return Object.assign(Object.assign({}, state), { isInitiator: true, status: "requested" });
3359
+ },
3360
+ },
3361
+ extraReducers: (builder) => {
3362
+ builder.addCase(signalEvents.liveTranscriptionStopped, (state) => {
3363
+ return Object.assign(Object.assign({}, state), { isInitiator: false, isTranscribing: false, status: undefined });
3364
+ });
3365
+ builder.addCase(signalEvents.liveTranscriptionStarted, (state, action) => {
3366
+ const { payload } = action;
3367
+ if (!payload.error) {
3368
+ return state;
3369
+ }
3370
+ return Object.assign(Object.assign({}, state), { isInitiator: false, isTranscribing: false, status: "error", error: payload.error });
3371
+ });
3372
+ builder.addCase(signalEvents.newClient, (state, { payload }) => {
3373
+ var _a;
3374
+ const { client } = payload;
3375
+ if (((_a = client.role) === null || _a === void 0 ? void 0 : _a.roleName) === "captioner") {
3376
+ return Object.assign(Object.assign({}, state), { isTranscribing: true, status: "transcribing", startedAt: client.startedLiveTranscriptionAt
3377
+ ? new Date(client.startedLiveTranscriptionAt).getTime()
3378
+ : new Date().getTime() });
3379
+ }
3380
+ return state;
3381
+ });
3382
+ },
3383
+ });
3384
+ const { transcribingRequestStarted } = liveTranscriptionSlice.actions;
3385
+ const doStartLiveTranscription = createRoomConnectedThunk(() => (dispatch, getState) => {
3386
+ const state = getState();
3387
+ const socket = selectSignalConnectionRaw(state).socket;
3388
+ const status = selectLiveTranscriptionStatus(state);
3389
+ if (status && ["transcribing", "requested"].includes(status)) {
3390
+ return;
3391
+ }
3392
+ socket === null || socket === void 0 ? void 0 : socket.emit("start_live_transcription");
3393
+ dispatch(transcribingRequestStarted());
3394
+ });
3395
+ const doStopLiveTranscription = createRoomConnectedThunk(() => (dispatch, getState) => {
3396
+ const state = getState();
3397
+ const socket = selectSignalConnectionRaw(state).socket;
3398
+ socket === null || socket === void 0 ? void 0 : socket.emit("stop_live_transcription");
3399
+ });
3400
+ const selectLiveTranscriptionRaw = (state) => state.liveTranscription;
3401
+ const selectLiveTranscriptionStatus = (state) => state.liveTranscription.status;
3402
+ const selectIsLiveTranscription = (state) => state.liveTranscription.isTranscribing;
3403
+ const selectLiveTranscriptionIsInitiator = (state) => state.liveTranscription.isInitiator;
3404
+
3349
3405
  const localParticipantSliceInitialState = {
3350
3406
  breakoutGroup: null,
3351
3407
  breakoutGroupAssigned: "",
@@ -3977,6 +4033,15 @@ const rtcAnalyticsCustomEvents = {
3977
4033
  }),
3978
4034
  getOutput: (value) => value,
3979
4035
  }),
4036
+ transcribing: createRtcAnalyticsCustomEvent({
4037
+ actions: [signalEvents.newClient],
4038
+ rtcEventName: "transcribing",
4039
+ getValue: (state) => ({
4040
+ local: false,
4041
+ cloud: !!(selectIsLiveTranscription(state) && selectLiveTranscriptionIsInitiator(state)),
4042
+ }),
4043
+ getOutput: (value) => value,
4044
+ }),
3980
4045
  roomSessionId: createRtcAnalyticsCustomEvent({
3981
4046
  actions: [
3982
4047
  signalEvents.newClient,
@@ -4260,6 +4325,7 @@ const appReducer = combineReducers({
4260
4325
  cloudRecording: cloudRecordingSlice.reducer,
4261
4326
  connectionMonitor: connectionMonitorSlice.reducer,
4262
4327
  deviceCredentials: deviceCredentialsSlice.reducer,
4328
+ liveTranscription: liveTranscriptionSlice.reducer,
4263
4329
  localMedia: localMediaSlice.reducer,
4264
4330
  localParticipant: localParticipantSlice.reducer,
4265
4331
  localScreenshare: localScreenshareSlice.reducer,
@@ -4601,6 +4667,7 @@ const BREAKOUT_CONFIG_CHANGED = "breakout:config-changed";
4601
4667
  const CHAT_NEW_MESSAGE = "chat:new-message";
4602
4668
  const CLOUD_RECORDING_STATUS_CHANGED = "cloud-recording:status-changed";
4603
4669
  const CONNECTION_STATUS_CHANGED = "connection:status-changed";
4670
+ const LIVE_TRANSCRIPTION_STATUS_CHANGED = "live-transcription:status-changed";
4604
4671
  const LOCAL_PARTICIPANT_CHANGED = "local-participant:changed";
4605
4672
  const LOCAL_SCREENSHARE_STATUS_CHANGED = "local-screenshare:status-changed";
4606
4673
  const REMOTE_PARTICIPANTS_CHANGED = "remote-participants:changed";
@@ -4615,10 +4682,16 @@ const SPOTLIGHT_PARTICIPANT_REMOVED = "spotlight:participant-removed";
4615
4682
  const ROOM_JOINED = "room:joined";
4616
4683
  const ROOM_JOINED_ERROR = "room:joined:error";
4617
4684
 
4618
- const selectRoomConnectionState = createSelector(selectChatMessages, selectCloudRecordingRaw, selectBreakoutCurrentGroup, selectBreakoutActive, selectBreakoutGroupedParticipants, selectAllClientViewsInCurrentGroup, selectLocalParticipantRaw, selectLocalMediaStream, selectRemoteParticipants, selectScreenshares, selectRoomConnectionStatus, selectStreamingRaw, selectWaitingParticipants, selectNotificationsEmitter, selectSpotlightedClientViews, (chatMessages, cloudRecording, breakoutCurrentGroup, breakoutActive, breakoutGroupedParticipants, clientViewsInCurrentGroup, localParticipant, localMediaStream, remoteParticipants, screenshares, connectionStatus, streaming, waitingParticipants, notificationsEmitter, spotlightedClientViews) => {
4685
+ const selectRoomConnectionState = createSelector(selectChatMessages, selectCloudRecordingRaw, selectBreakoutCurrentGroup, selectBreakoutActive, selectBreakoutGroupedParticipants, selectAllClientViewsInCurrentGroup, selectLiveTranscriptionRaw, selectLocalParticipantRaw, selectLocalMediaStream, selectRemoteParticipants, selectScreenshares, selectRoomConnectionStatus, selectStreamingRaw, selectWaitingParticipants, selectNotificationsEmitter, selectSpotlightedClientViews, (chatMessages, cloudRecording, breakoutCurrentGroup, breakoutActive, breakoutGroupedParticipants, clientViewsInCurrentGroup, liveTranscription, localParticipant, localMediaStream, remoteParticipants, screenshares, connectionStatus, streaming, waitingParticipants, notificationsEmitter, spotlightedClientViews) => {
4619
4686
  const state = {
4620
4687
  chatMessages,
4621
- cloudRecording: cloudRecording.isRecording ? { status: "recording" } : undefined,
4688
+ cloudRecording: cloudRecording.status
4689
+ ? {
4690
+ error: cloudRecording.error,
4691
+ startedAt: cloudRecording.startedAt,
4692
+ status: cloudRecording.status,
4693
+ }
4694
+ : undefined,
4622
4695
  breakout: {
4623
4696
  isActive: breakoutActive,
4624
4697
  currentGroup: breakoutCurrentGroup,
@@ -4633,6 +4706,13 @@ const selectRoomConnectionState = createSelector(selectChatMessages, selectCloud
4633
4706
  startedAt: streaming.startedAt,
4634
4707
  }
4635
4708
  : undefined,
4709
+ liveTranscription: liveTranscription.status
4710
+ ? {
4711
+ error: liveTranscription.error,
4712
+ startedAt: liveTranscription.startedAt,
4713
+ status: liveTranscription.status,
4714
+ }
4715
+ : undefined,
4636
4716
  localScreenshareStatus: localParticipant.isScreenSharing ? "active" : undefined,
4637
4717
  localParticipant: Object.assign(Object.assign({}, localParticipant), { stream: localMediaStream }),
4638
4718
  remoteParticipants,
@@ -4649,6 +4729,7 @@ class RoomConnectionClient extends BaseClient {
4649
4729
  this.selfId = null;
4650
4730
  this.chatMessageSubscribers = new Set();
4651
4731
  this.cloudRecordingSubscribers = new Set();
4732
+ this.liveTranscriptionSubscribers = new Set();
4652
4733
  this.breakoutSubscribers = new Set();
4653
4734
  this.connectionStatusSubscribers = new Set();
4654
4735
  this.liveStreamSubscribers = new Set();
@@ -4667,8 +4748,12 @@ class RoomConnectionClient extends BaseClient {
4667
4748
  this.chatMessageSubscribers.forEach((cb) => cb(state.chatMessages));
4668
4749
  }
4669
4750
  if (state.cloudRecording !== previousState.cloudRecording) {
4670
- this.cloudRecordingSubscribers.forEach((cb) => cb(state.cloudRecording ? { status: "recording" } : undefined));
4671
- this.emit(CLOUD_RECORDING_STATUS_CHANGED, state.cloudRecording ? { status: "recording" } : undefined);
4751
+ this.cloudRecordingSubscribers.forEach((cb) => cb(state.cloudRecording));
4752
+ this.emit(CLOUD_RECORDING_STATUS_CHANGED, state.cloudRecording);
4753
+ }
4754
+ if (state.liveTranscription !== previousState.liveTranscription) {
4755
+ this.liveTranscriptionSubscribers.forEach((cb) => cb(state.liveTranscription));
4756
+ this.emit(LIVE_TRANSCRIPTION_STATUS_CHANGED, state.liveTranscription);
4672
4757
  }
4673
4758
  if (state.breakout !== previousState.breakout) {
4674
4759
  this.breakoutSubscribers.forEach((cb) => cb(state.breakout));
@@ -4764,6 +4849,10 @@ class RoomConnectionClient extends BaseClient {
4764
4849
  this.cloudRecordingSubscribers.add(callback);
4765
4850
  return () => this.cloudRecordingSubscribers.delete(callback);
4766
4851
  }
4852
+ subscribeToLiveTranscription(callback) {
4853
+ this.liveTranscriptionSubscribers.add(callback);
4854
+ return () => this.liveTranscriptionSubscribers.delete(callback);
4855
+ }
4767
4856
  subscribeToBreakoutConfig(callback) {
4768
4857
  this.breakoutSubscribers.add(callback);
4769
4858
  return () => this.breakoutSubscribers.delete(callback);
@@ -4894,6 +4983,12 @@ class RoomConnectionClient extends BaseClient {
4894
4983
  stopCloudRecording() {
4895
4984
  this.store.dispatch(doStopCloudRecording());
4896
4985
  }
4986
+ startLiveTranscription() {
4987
+ this.store.dispatch(doStartLiveTranscription());
4988
+ }
4989
+ stopLiveTranscription() {
4990
+ this.store.dispatch(doStopLiveTranscription());
4991
+ }
4897
4992
  startScreenshare() {
4898
4993
  this.store.dispatch(doStartScreenshare());
4899
4994
  }
@@ -5012,4 +5107,4 @@ class WherebyClient {
5012
5107
  }
5013
5108
  }
5014
5109
 
5015
- export { ApiClient, BREAKOUT_CONFIG_CHANGED, CAMERA_DEVICES_CHANGED, CAMERA_DEVICE_ERROR_CHANGED, CHAT_NEW_MESSAGE, CLIENT_VIEW_CHANGED, CLIENT_VIEW_SPOTLIGHTS_CHANGED, CLOUD_RECORDING_STATUS_CHANGED, CONNECTION_STATUS_CHANGED, CURRENT_CAMERA_CHANGED, CURRENT_MICROPHONE_CHANGED, CURRENT_SPEAKER_CHANGED, Credentials, CredentialsService, GridClient, IS_SETTING_CAMERA_DEVICE, IS_SETTING_MICROPHONE_DEVICE, LOCAL_MEDIA_STARTING, LOCAL_MEDIA_START_ERROR_CHANGED, LOCAL_PARTICIPANT_CHANGED, LOCAL_SCREENSHARE_STATUS_CHANGED, LOCAL_STREAM_CHANGED, LocalMediaClient, LocalParticipant, MICROPHONE_DEVICES_CHANGED, MICROPHONE_DEVICE_ERROR_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, getVideoTrack, hasValue, parseUnverifiedRoomKeyData };
5110
+ export { ApiClient, BREAKOUT_CONFIG_CHANGED, CAMERA_DEVICES_CHANGED, CAMERA_DEVICE_ERROR_CHANGED, CHAT_NEW_MESSAGE, CLIENT_VIEW_CHANGED, CLIENT_VIEW_SPOTLIGHTS_CHANGED, CLOUD_RECORDING_STATUS_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, MICROPHONE_DEVICES_CHANGED, MICROPHONE_DEVICE_ERROR_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, getVideoTrack, hasValue, parseUnverifiedRoomKeyData };
@@ -1156,7 +1156,7 @@ const createReactor = (selectors, callback) => {
1156
1156
  });
1157
1157
  };
1158
1158
 
1159
- const coreVersion = "1.8.2";
1159
+ const coreVersion = "1.9.0";
1160
1160
 
1161
1161
  const initialState$1 = {
1162
1162
  displayName: null,
@@ -2109,7 +2109,7 @@ startAppListening({
2109
2109
  },
2110
2110
  });
2111
2111
 
2112
- const NON_PERSON_ROLES = ["recorder", "streamer"];
2112
+ const NON_PERSON_ROLES = ["recorder", "streamer", "captioner", "assistant"];
2113
2113
 
2114
2114
  const selectLocalParticipantRaw = (state) => state.localParticipant;
2115
2115
  const selectSelfId = (state) => state.localParticipant.id;
@@ -2259,7 +2259,6 @@ const selectChatMessages = (state) => state.chat.chatMessages;
2259
2259
  const initialCloudRecordingState = {
2260
2260
  isInitiator: false,
2261
2261
  isRecording: false,
2262
- error: null,
2263
2262
  startedAt: undefined,
2264
2263
  };
2265
2264
  const cloudRecordingSlice = createSlice({
@@ -3346,6 +3345,63 @@ createReactor([selectShouldStopConnectionMonitor], ({ dispatch }, shouldStartCon
3346
3345
  }
3347
3346
  });
3348
3347
 
3348
+ const initialLiveTranscriptionState = {
3349
+ isInitiator: false,
3350
+ isTranscribing: false,
3351
+ startedAt: undefined,
3352
+ };
3353
+ const liveTranscriptionSlice = createSlice({
3354
+ name: "liveTranscription",
3355
+ initialState: initialLiveTranscriptionState,
3356
+ reducers: {
3357
+ transcribingRequestStarted: (state) => {
3358
+ return Object.assign(Object.assign({}, state), { isInitiator: true, status: "requested" });
3359
+ },
3360
+ },
3361
+ extraReducers: (builder) => {
3362
+ builder.addCase(signalEvents.liveTranscriptionStopped, (state) => {
3363
+ return Object.assign(Object.assign({}, state), { isInitiator: false, isTranscribing: false, status: undefined });
3364
+ });
3365
+ builder.addCase(signalEvents.liveTranscriptionStarted, (state, action) => {
3366
+ const { payload } = action;
3367
+ if (!payload.error) {
3368
+ return state;
3369
+ }
3370
+ return Object.assign(Object.assign({}, state), { isInitiator: false, isTranscribing: false, status: "error", error: payload.error });
3371
+ });
3372
+ builder.addCase(signalEvents.newClient, (state, { payload }) => {
3373
+ var _a;
3374
+ const { client } = payload;
3375
+ if (((_a = client.role) === null || _a === void 0 ? void 0 : _a.roleName) === "captioner") {
3376
+ return Object.assign(Object.assign({}, state), { isTranscribing: true, status: "transcribing", startedAt: client.startedLiveTranscriptionAt
3377
+ ? new Date(client.startedLiveTranscriptionAt).getTime()
3378
+ : new Date().getTime() });
3379
+ }
3380
+ return state;
3381
+ });
3382
+ },
3383
+ });
3384
+ const { transcribingRequestStarted } = liveTranscriptionSlice.actions;
3385
+ const doStartLiveTranscription = createRoomConnectedThunk(() => (dispatch, getState) => {
3386
+ const state = getState();
3387
+ const socket = selectSignalConnectionRaw(state).socket;
3388
+ const status = selectLiveTranscriptionStatus(state);
3389
+ if (status && ["transcribing", "requested"].includes(status)) {
3390
+ return;
3391
+ }
3392
+ socket === null || socket === void 0 ? void 0 : socket.emit("start_live_transcription");
3393
+ dispatch(transcribingRequestStarted());
3394
+ });
3395
+ const doStopLiveTranscription = createRoomConnectedThunk(() => (dispatch, getState) => {
3396
+ const state = getState();
3397
+ const socket = selectSignalConnectionRaw(state).socket;
3398
+ socket === null || socket === void 0 ? void 0 : socket.emit("stop_live_transcription");
3399
+ });
3400
+ const selectLiveTranscriptionRaw = (state) => state.liveTranscription;
3401
+ const selectLiveTranscriptionStatus = (state) => state.liveTranscription.status;
3402
+ const selectIsLiveTranscription = (state) => state.liveTranscription.isTranscribing;
3403
+ const selectLiveTranscriptionIsInitiator = (state) => state.liveTranscription.isInitiator;
3404
+
3349
3405
  const localParticipantSliceInitialState = {
3350
3406
  breakoutGroup: null,
3351
3407
  breakoutGroupAssigned: "",
@@ -3977,6 +4033,15 @@ const rtcAnalyticsCustomEvents = {
3977
4033
  }),
3978
4034
  getOutput: (value) => value,
3979
4035
  }),
4036
+ transcribing: createRtcAnalyticsCustomEvent({
4037
+ actions: [signalEvents.newClient],
4038
+ rtcEventName: "transcribing",
4039
+ getValue: (state) => ({
4040
+ local: false,
4041
+ cloud: !!(selectIsLiveTranscription(state) && selectLiveTranscriptionIsInitiator(state)),
4042
+ }),
4043
+ getOutput: (value) => value,
4044
+ }),
3980
4045
  roomSessionId: createRtcAnalyticsCustomEvent({
3981
4046
  actions: [
3982
4047
  signalEvents.newClient,
@@ -4260,6 +4325,7 @@ const appReducer = combineReducers({
4260
4325
  cloudRecording: cloudRecordingSlice.reducer,
4261
4326
  connectionMonitor: connectionMonitorSlice.reducer,
4262
4327
  deviceCredentials: deviceCredentialsSlice.reducer,
4328
+ liveTranscription: liveTranscriptionSlice.reducer,
4263
4329
  localMedia: localMediaSlice.reducer,
4264
4330
  localParticipant: localParticipantSlice.reducer,
4265
4331
  localScreenshare: localScreenshareSlice.reducer,
@@ -4601,6 +4667,7 @@ const BREAKOUT_CONFIG_CHANGED = "breakout:config-changed";
4601
4667
  const CHAT_NEW_MESSAGE = "chat:new-message";
4602
4668
  const CLOUD_RECORDING_STATUS_CHANGED = "cloud-recording:status-changed";
4603
4669
  const CONNECTION_STATUS_CHANGED = "connection:status-changed";
4670
+ const LIVE_TRANSCRIPTION_STATUS_CHANGED = "live-transcription:status-changed";
4604
4671
  const LOCAL_PARTICIPANT_CHANGED = "local-participant:changed";
4605
4672
  const LOCAL_SCREENSHARE_STATUS_CHANGED = "local-screenshare:status-changed";
4606
4673
  const REMOTE_PARTICIPANTS_CHANGED = "remote-participants:changed";
@@ -4615,10 +4682,16 @@ const SPOTLIGHT_PARTICIPANT_REMOVED = "spotlight:participant-removed";
4615
4682
  const ROOM_JOINED = "room:joined";
4616
4683
  const ROOM_JOINED_ERROR = "room:joined:error";
4617
4684
 
4618
- const selectRoomConnectionState = createSelector(selectChatMessages, selectCloudRecordingRaw, selectBreakoutCurrentGroup, selectBreakoutActive, selectBreakoutGroupedParticipants, selectAllClientViewsInCurrentGroup, selectLocalParticipantRaw, selectLocalMediaStream, selectRemoteParticipants, selectScreenshares, selectRoomConnectionStatus, selectStreamingRaw, selectWaitingParticipants, selectNotificationsEmitter, selectSpotlightedClientViews, (chatMessages, cloudRecording, breakoutCurrentGroup, breakoutActive, breakoutGroupedParticipants, clientViewsInCurrentGroup, localParticipant, localMediaStream, remoteParticipants, screenshares, connectionStatus, streaming, waitingParticipants, notificationsEmitter, spotlightedClientViews) => {
4685
+ const selectRoomConnectionState = createSelector(selectChatMessages, selectCloudRecordingRaw, selectBreakoutCurrentGroup, selectBreakoutActive, selectBreakoutGroupedParticipants, selectAllClientViewsInCurrentGroup, selectLiveTranscriptionRaw, selectLocalParticipantRaw, selectLocalMediaStream, selectRemoteParticipants, selectScreenshares, selectRoomConnectionStatus, selectStreamingRaw, selectWaitingParticipants, selectNotificationsEmitter, selectSpotlightedClientViews, (chatMessages, cloudRecording, breakoutCurrentGroup, breakoutActive, breakoutGroupedParticipants, clientViewsInCurrentGroup, liveTranscription, localParticipant, localMediaStream, remoteParticipants, screenshares, connectionStatus, streaming, waitingParticipants, notificationsEmitter, spotlightedClientViews) => {
4619
4686
  const state = {
4620
4687
  chatMessages,
4621
- cloudRecording: cloudRecording.isRecording ? { status: "recording" } : undefined,
4688
+ cloudRecording: cloudRecording.status
4689
+ ? {
4690
+ error: cloudRecording.error,
4691
+ startedAt: cloudRecording.startedAt,
4692
+ status: cloudRecording.status,
4693
+ }
4694
+ : undefined,
4622
4695
  breakout: {
4623
4696
  isActive: breakoutActive,
4624
4697
  currentGroup: breakoutCurrentGroup,
@@ -4633,6 +4706,13 @@ const selectRoomConnectionState = createSelector(selectChatMessages, selectCloud
4633
4706
  startedAt: streaming.startedAt,
4634
4707
  }
4635
4708
  : undefined,
4709
+ liveTranscription: liveTranscription.status
4710
+ ? {
4711
+ error: liveTranscription.error,
4712
+ startedAt: liveTranscription.startedAt,
4713
+ status: liveTranscription.status,
4714
+ }
4715
+ : undefined,
4636
4716
  localScreenshareStatus: localParticipant.isScreenSharing ? "active" : undefined,
4637
4717
  localParticipant: Object.assign(Object.assign({}, localParticipant), { stream: localMediaStream }),
4638
4718
  remoteParticipants,
@@ -4649,6 +4729,7 @@ class RoomConnectionClient extends BaseClient {
4649
4729
  this.selfId = null;
4650
4730
  this.chatMessageSubscribers = new Set();
4651
4731
  this.cloudRecordingSubscribers = new Set();
4732
+ this.liveTranscriptionSubscribers = new Set();
4652
4733
  this.breakoutSubscribers = new Set();
4653
4734
  this.connectionStatusSubscribers = new Set();
4654
4735
  this.liveStreamSubscribers = new Set();
@@ -4667,8 +4748,12 @@ class RoomConnectionClient extends BaseClient {
4667
4748
  this.chatMessageSubscribers.forEach((cb) => cb(state.chatMessages));
4668
4749
  }
4669
4750
  if (state.cloudRecording !== previousState.cloudRecording) {
4670
- this.cloudRecordingSubscribers.forEach((cb) => cb(state.cloudRecording ? { status: "recording" } : undefined));
4671
- this.emit(CLOUD_RECORDING_STATUS_CHANGED, state.cloudRecording ? { status: "recording" } : undefined);
4751
+ this.cloudRecordingSubscribers.forEach((cb) => cb(state.cloudRecording));
4752
+ this.emit(CLOUD_RECORDING_STATUS_CHANGED, state.cloudRecording);
4753
+ }
4754
+ if (state.liveTranscription !== previousState.liveTranscription) {
4755
+ this.liveTranscriptionSubscribers.forEach((cb) => cb(state.liveTranscription));
4756
+ this.emit(LIVE_TRANSCRIPTION_STATUS_CHANGED, state.liveTranscription);
4672
4757
  }
4673
4758
  if (state.breakout !== previousState.breakout) {
4674
4759
  this.breakoutSubscribers.forEach((cb) => cb(state.breakout));
@@ -4764,6 +4849,10 @@ class RoomConnectionClient extends BaseClient {
4764
4849
  this.cloudRecordingSubscribers.add(callback);
4765
4850
  return () => this.cloudRecordingSubscribers.delete(callback);
4766
4851
  }
4852
+ subscribeToLiveTranscription(callback) {
4853
+ this.liveTranscriptionSubscribers.add(callback);
4854
+ return () => this.liveTranscriptionSubscribers.delete(callback);
4855
+ }
4767
4856
  subscribeToBreakoutConfig(callback) {
4768
4857
  this.breakoutSubscribers.add(callback);
4769
4858
  return () => this.breakoutSubscribers.delete(callback);
@@ -4894,6 +4983,12 @@ class RoomConnectionClient extends BaseClient {
4894
4983
  stopCloudRecording() {
4895
4984
  this.store.dispatch(doStopCloudRecording());
4896
4985
  }
4986
+ startLiveTranscription() {
4987
+ this.store.dispatch(doStartLiveTranscription());
4988
+ }
4989
+ stopLiveTranscription() {
4990
+ this.store.dispatch(doStopLiveTranscription());
4991
+ }
4897
4992
  startScreenshare() {
4898
4993
  this.store.dispatch(doStartScreenshare());
4899
4994
  }
@@ -5012,4 +5107,4 @@ class WherebyClient {
5012
5107
  }
5013
5108
  }
5014
5109
 
5015
- export { ApiClient, BREAKOUT_CONFIG_CHANGED, CAMERA_DEVICES_CHANGED, CAMERA_DEVICE_ERROR_CHANGED, CHAT_NEW_MESSAGE, CLIENT_VIEW_CHANGED, CLIENT_VIEW_SPOTLIGHTS_CHANGED, CLOUD_RECORDING_STATUS_CHANGED, CONNECTION_STATUS_CHANGED, CURRENT_CAMERA_CHANGED, CURRENT_MICROPHONE_CHANGED, CURRENT_SPEAKER_CHANGED, Credentials, CredentialsService, GridClient, IS_SETTING_CAMERA_DEVICE, IS_SETTING_MICROPHONE_DEVICE, LOCAL_MEDIA_STARTING, LOCAL_MEDIA_START_ERROR_CHANGED, LOCAL_PARTICIPANT_CHANGED, LOCAL_SCREENSHARE_STATUS_CHANGED, LOCAL_STREAM_CHANGED, LocalMediaClient, LocalParticipant, MICROPHONE_DEVICES_CHANGED, MICROPHONE_DEVICE_ERROR_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, getVideoTrack, hasValue, parseUnverifiedRoomKeyData };
5110
+ export { ApiClient, BREAKOUT_CONFIG_CHANGED, CAMERA_DEVICES_CHANGED, CAMERA_DEVICE_ERROR_CHANGED, CHAT_NEW_MESSAGE, CLIENT_VIEW_CHANGED, CLIENT_VIEW_SPOTLIGHTS_CHANGED, CLOUD_RECORDING_STATUS_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, MICROPHONE_DEVICES_CHANGED, MICROPHONE_DEVICE_ERROR_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, getVideoTrack, hasValue, parseUnverifiedRoomKeyData };
@@ -75,7 +75,7 @@ const createReactor = (selectors, callback) => {
75
75
  });
76
76
  };
77
77
 
78
- const coreVersion = "1.8.2";
78
+ const coreVersion = "1.9.0";
79
79
 
80
80
  const initialState$1 = {
81
81
  displayName: null,
@@ -1002,7 +1002,7 @@ startAppListening({
1002
1002
  },
1003
1003
  });
1004
1004
 
1005
- const NON_PERSON_ROLES = ["recorder", "streamer"];
1005
+ const NON_PERSON_ROLES = ["recorder", "streamer", "captioner", "assistant"];
1006
1006
 
1007
1007
  const selectLocalParticipantRaw = (state) => state.localParticipant;
1008
1008
  const selectSelfId = (state) => state.localParticipant.id;
@@ -1156,7 +1156,6 @@ const selectChatMessages = (state) => state.chat.chatMessages;
1156
1156
  const initialCloudRecordingState = {
1157
1157
  isInitiator: false,
1158
1158
  isRecording: false,
1159
- error: null,
1160
1159
  startedAt: undefined,
1161
1160
  };
1162
1161
  const cloudRecordingSlice = toolkit.createSlice({
@@ -2252,6 +2251,65 @@ createReactor([selectShouldStopConnectionMonitor], ({ dispatch }, shouldStartCon
2252
2251
  }
2253
2252
  });
2254
2253
 
2254
+ const initialLiveTranscriptionState = {
2255
+ isInitiator: false,
2256
+ isTranscribing: false,
2257
+ startedAt: undefined,
2258
+ };
2259
+ const liveTranscriptionSlice = toolkit.createSlice({
2260
+ name: "liveTranscription",
2261
+ initialState: initialLiveTranscriptionState,
2262
+ reducers: {
2263
+ transcribingRequestStarted: (state) => {
2264
+ return Object.assign(Object.assign({}, state), { isInitiator: true, status: "requested" });
2265
+ },
2266
+ },
2267
+ extraReducers: (builder) => {
2268
+ builder.addCase(signalEvents.liveTranscriptionStopped, (state) => {
2269
+ return Object.assign(Object.assign({}, state), { isInitiator: false, isTranscribing: false, status: undefined });
2270
+ });
2271
+ builder.addCase(signalEvents.liveTranscriptionStarted, (state, action) => {
2272
+ const { payload } = action;
2273
+ if (!payload.error) {
2274
+ return state;
2275
+ }
2276
+ return Object.assign(Object.assign({}, state), { isInitiator: false, isTranscribing: false, status: "error", error: payload.error });
2277
+ });
2278
+ builder.addCase(signalEvents.newClient, (state, { payload }) => {
2279
+ var _a;
2280
+ const { client } = payload;
2281
+ if (((_a = client.role) === null || _a === void 0 ? void 0 : _a.roleName) === "captioner") {
2282
+ return Object.assign(Object.assign({}, state), { isTranscribing: true, status: "transcribing", startedAt: client.startedLiveTranscriptionAt
2283
+ ? new Date(client.startedLiveTranscriptionAt).getTime()
2284
+ : new Date().getTime() });
2285
+ }
2286
+ return state;
2287
+ });
2288
+ },
2289
+ });
2290
+ const { transcribingRequestStarted } = liveTranscriptionSlice.actions;
2291
+ const doStartLiveTranscription = createRoomConnectedThunk(() => (dispatch, getState) => {
2292
+ const state = getState();
2293
+ const socket = selectSignalConnectionRaw(state).socket;
2294
+ const status = selectLiveTranscriptionStatus(state);
2295
+ if (status && ["transcribing", "requested"].includes(status)) {
2296
+ return;
2297
+ }
2298
+ socket === null || socket === void 0 ? void 0 : socket.emit("start_live_transcription");
2299
+ dispatch(transcribingRequestStarted());
2300
+ });
2301
+ const doStopLiveTranscription = createRoomConnectedThunk(() => (dispatch, getState) => {
2302
+ const state = getState();
2303
+ const socket = selectSignalConnectionRaw(state).socket;
2304
+ socket === null || socket === void 0 ? void 0 : socket.emit("stop_live_transcription");
2305
+ });
2306
+ const selectLiveTranscriptionRaw = (state) => state.liveTranscription;
2307
+ const selectLiveTranscriptionStatus = (state) => state.liveTranscription.status;
2308
+ const selectLiveTranscriptionStartedAt = (state) => state.liveTranscription.startedAt;
2309
+ const selectLiveTranscriptionError = (state) => state.liveTranscription.error;
2310
+ const selectIsLiveTranscription = (state) => state.liveTranscription.isTranscribing;
2311
+ const selectLiveTranscriptionIsInitiator = (state) => state.liveTranscription.isInitiator;
2312
+
2255
2313
  const localParticipantSliceInitialState = {
2256
2314
  breakoutGroup: null,
2257
2315
  breakoutGroupAssigned: "",
@@ -2894,6 +2952,15 @@ const rtcAnalyticsCustomEvents = {
2894
2952
  }),
2895
2953
  getOutput: (value) => value,
2896
2954
  }),
2955
+ transcribing: createRtcAnalyticsCustomEvent({
2956
+ actions: [signalEvents.newClient],
2957
+ rtcEventName: "transcribing",
2958
+ getValue: (state) => ({
2959
+ local: false,
2960
+ cloud: !!(selectIsLiveTranscription(state) && selectLiveTranscriptionIsInitiator(state)),
2961
+ }),
2962
+ getOutput: (value) => value,
2963
+ }),
2897
2964
  roomSessionId: createRtcAnalyticsCustomEvent({
2898
2965
  actions: [
2899
2966
  signalEvents.newClient,
@@ -3178,6 +3245,7 @@ const appReducer = toolkit.combineReducers({
3178
3245
  cloudRecording: cloudRecordingSlice.reducer,
3179
3246
  connectionMonitor: connectionMonitorSlice.reducer,
3180
3247
  deviceCredentials: deviceCredentialsSlice.reducer,
3248
+ liveTranscription: liveTranscriptionSlice.reducer,
3181
3249
  localMedia: localMediaSlice.reducer,
3182
3250
  localParticipant: localParticipantSlice.reducer,
3183
3251
  localScreenshare: localScreenshareSlice.reducer,
@@ -4022,10 +4090,12 @@ exports.doSignalIdentifyDevice = doSignalIdentifyDevice;
4022
4090
  exports.doSpotlightParticipant = doSpotlightParticipant;
4023
4091
  exports.doStartCloudRecording = doStartCloudRecording;
4024
4092
  exports.doStartConnectionMonitor = doStartConnectionMonitor;
4093
+ exports.doStartLiveTranscription = doStartLiveTranscription;
4025
4094
  exports.doStartLocalMedia = doStartLocalMedia;
4026
4095
  exports.doStartScreenshare = doStartScreenshare;
4027
4096
  exports.doStopCloudRecording = doStopCloudRecording;
4028
4097
  exports.doStopConnectionMonitor = doStopConnectionMonitor;
4098
+ exports.doStopLiveTranscription = doStopLiveTranscription;
4029
4099
  exports.doStopLocalMedia = doStopLocalMedia;
4030
4100
  exports.doStopScreenshare = doStopScreenshare;
4031
4101
  exports.doSwitchLocalStream = doSwitchLocalStream;
@@ -4033,12 +4103,14 @@ exports.doToggleCamera = doToggleCamera;
4033
4103
  exports.doToggleLowDataMode = doToggleLowDataMode;
4034
4104
  exports.doUpdateDeviceList = doUpdateDeviceList;
4035
4105
  exports.initialCloudRecordingState = initialCloudRecordingState;
4106
+ exports.initialLiveTranscriptionState = initialLiveTranscriptionState;
4036
4107
  exports.initialLocalMediaState = initialLocalMediaState;
4037
4108
  exports.initialNotificationsState = initialNotificationsState;
4038
4109
  exports.initialState = initialState$1;
4039
4110
  exports.isAcceptingStreams = isAcceptingStreams;
4040
4111
  exports.isClientSpotlighted = isClientSpotlighted;
4041
4112
  exports.listenerMiddleware = listenerMiddleware;
4113
+ exports.liveTranscriptionSlice = liveTranscriptionSlice;
4042
4114
  exports.localMediaSlice = localMediaSlice;
4043
4115
  exports.localMediaStopped = localMediaStopped;
4044
4116
  exports.localParticipantSlice = localParticipantSlice;
@@ -4126,6 +4198,7 @@ exports.selectIsAuthorizedToRequestVideoEnable = selectIsAuthorizedToRequestVide
4126
4198
  exports.selectIsAuthorizedToSpotlight = selectIsAuthorizedToSpotlight;
4127
4199
  exports.selectIsCameraEnabled = selectIsCameraEnabled;
4128
4200
  exports.selectIsCloudRecording = selectIsCloudRecording;
4201
+ exports.selectIsLiveTranscription = selectIsLiveTranscription;
4129
4202
  exports.selectIsLocalMediaStarting = selectIsLocalMediaStarting;
4130
4203
  exports.selectIsLocalParticipantSpotlighted = selectIsLocalParticipantSpotlighted;
4131
4204
  exports.selectIsLowDataModeEnabled = selectIsLowDataModeEnabled;
@@ -4133,6 +4206,11 @@ exports.selectIsMicrophoneEnabled = selectIsMicrophoneEnabled;
4133
4206
  exports.selectIsSettingCameraDevice = selectIsSettingCameraDevice;
4134
4207
  exports.selectIsSettingMicrophoneDevice = selectIsSettingMicrophoneDevice;
4135
4208
  exports.selectIsToggleCamera = selectIsToggleCamera;
4209
+ exports.selectLiveTranscriptionError = selectLiveTranscriptionError;
4210
+ exports.selectLiveTranscriptionIsInitiator = selectLiveTranscriptionIsInitiator;
4211
+ exports.selectLiveTranscriptionRaw = selectLiveTranscriptionRaw;
4212
+ exports.selectLiveTranscriptionStartedAt = selectLiveTranscriptionStartedAt;
4213
+ exports.selectLiveTranscriptionStatus = selectLiveTranscriptionStatus;
4136
4214
  exports.selectLocalMediaBeforeEffectTracks = selectLocalMediaBeforeEffectTracks;
4137
4215
  exports.selectLocalMediaConstraintsOptions = selectLocalMediaConstraintsOptions;
4138
4216
  exports.selectLocalMediaDevices = selectLocalMediaDevices;
@@ -4235,6 +4313,7 @@ exports.streamingSliceInitialState = streamingSliceInitialState;
4235
4313
  exports.toggleCameraEnabled = toggleCameraEnabled;
4236
4314
  exports.toggleLowDataModeEnabled = toggleLowDataModeEnabled;
4237
4315
  exports.toggleMicrophoneEnabled = toggleMicrophoneEnabled;
4316
+ exports.transcribingRequestStarted = transcribingRequestStarted;
4238
4317
  exports.updateReportedValues = updateReportedValues;
4239
4318
  exports.waitingParticipantsSlice = waitingParticipantsSlice;
4240
4319
  exports.waitingParticipantsSliceInitialState = waitingParticipantsSliceInitialState;