Skip to content

Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.

fix: Fixes setting backend recording when async transcriptions are not on.

damencho1102f4205abf
diff --git a/modules/API/API.js b/modules/API/API.js
index 6e90414191..d6f1e8bb02 100755
--- a/modules/API/API.js
+++ b/modules/API/API.js
@@ -790,7 +790,7 @@ function initCommands() {
}
if (transcription) {
- APP.store.dispatch(setRequestingSubtitles(true, false, null));
+ APP.store.dispatch(setRequestingSubtitles(true, false, null, true));
}
},
diff --git a/react/features/mobile/external-api/middleware.ts b/react/features/mobile/external-api/middleware.ts
index 7387b1b766..a8f6bfa2af 100644
--- a/react/features/mobile/external-api/middleware.ts
+++ b/react/features/mobile/external-api/middleware.ts
@@ -588,7 +588,7 @@ function _registerForNativeEvents(store: IStore) {
}
if (transcription) {
- store.dispatch(setRequestingSubtitles(true, false, null));
+ store.dispatch(setRequestingSubtitles(true, false, null, true));
}
});
diff --git a/react/features/recording/components/Recording/AbstractStartRecordingDialog.ts b/react/features/recording/components/Recording/AbstractStartRecordingDialog.ts
index 302a8208f7..cc20b924f7 100644
--- a/react/features/recording/components/Recording/AbstractStartRecordingDialog.ts
+++ b/react/features/recording/components/Recording/AbstractStartRecordingDialog.ts
@@ -415,7 +415,7 @@ class AbstractStartRecordingDialog extends Component<IProps, IState> {
if (this.state.selectedRecordingService === RECORDING_TYPES.JITSI_REC_SERVICE
&& this.state.shouldRecordTranscription) {
- dispatch(setRequestingSubtitles(true, _displaySubtitles, _subtitlesLanguage));
+ dispatch(setRequestingSubtitles(true, _displaySubtitles, _subtitlesLanguage, true));
} else {
_conference?.getMetadataHandler().setMetadata(RECORDING_METADATA_ID, {
isTranscribingEnabled: this.state.shouldRecordTranscription
diff --git a/react/features/subtitles/actions.any.ts b/react/features/subtitles/actions.any.ts
index 03eff51dde..4f14d921e7 100644
--- a/react/features/subtitles/actions.any.ts
+++ b/react/features/subtitles/actions.any.ts
@@ -83,7 +83,7 @@ export function toggleRequestingSubtitles() {
* @param {boolean} enabled - The new state of the subtitles.
* @param {boolean} displaySubtitles - Whether to display subtitles or not.
* @param {string} language - The language of the subtitles.
- * @param {boolean} backendRecordingOn - Whether backend recording is on.
+ * @param {boolean} forceBackendRecordingOn - Whether to force that backend recording is on.
* @returns {{
* type: SET_REQUESTING_SUBTITLES,
* backendRecordingOn: boolean,
@@ -95,11 +95,13 @@ export function toggleRequestingSubtitles() {
export function setRequestingSubtitles(
enabled: boolean,
displaySubtitles = true,
- language: string | null = `translation-languages:${DEFAULT_LANGUAGE}`) {
+ language: string | null = `translation-languages:${DEFAULT_LANGUAGE}`,
+ forceBackendRecordingOn: boolean = false) {
return {
type: SET_REQUESTING_SUBTITLES,
displaySubtitles,
enabled,
+ forceBackendRecordingOn,
language
};
}
diff --git a/react/features/subtitles/middleware.ts b/react/features/subtitles/middleware.ts
index 50373bd813..2f3430469d 100644
--- a/react/features/subtitles/middleware.ts
+++ b/react/features/subtitles/middleware.ts
@@ -98,7 +98,7 @@ MiddlewareRegistry.register(store => next => action => {
break;
}
case SET_REQUESTING_SUBTITLES:
- _requestingSubtitlesChange(store, action.enabled, action.language);
+ _requestingSubtitlesChange(store, action.enabled, action.language, action.forceBackendRecordingOn);
break;
}
@@ -344,13 +344,16 @@ function _getPrimaryLanguageCode(language: string) {
* @param {Store} store - The redux store.
* @param {boolean} enabled - Whether subtitles should be enabled or not.
* @param {string} language - The language to use for translation.
+ * @param {boolean} forceBackendRecordingOn - Whether to force backend recording is on or not. This is used only when
+ * we start recording, stopping is based on whether isTranscribingEnabled is already set.
* @private
* @returns {void}
*/
function _requestingSubtitlesChange(
{ dispatch, getState }: IStore,
enabled: boolean,
- language?: string | null) {
+ language?: string | null,
+ forceBackendRecordingOn: boolean = false) {
const state = getState();
const { conference } = state['features/base/conference'];
const backendRecordingOn = conference?.getMetadataHandler()?.getMetadata()?.asyncTranscription;
@@ -375,7 +378,9 @@ function _requestingSubtitlesChange(
}));
dispatch(setSubtitlesError(true));
});
- } else {
+ }
+
+ if (backendRecordingOn || forceBackendRecordingOn) {
conference?.getMetadataHandler()?.setMetadata(RECORDING_METADATA_ID, {
isTranscribingEnabled: true
});