Skip to content

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

feat(transcribing): Adds config to skip inviting jigasi on transcribing. (#16095)

Дамян Минковfa9aab953d51
diff --git a/config.js b/config.js
index bd7bbd2390..500cae5036 100644
--- a/config.js
+++ b/config.js
@@ -509,7 +509,10 @@ var config = {
// // Disables everything related to closed captions - the tab in the chat area, the button in the menu,
// // subtitles on stage and the "Show subtitles on stage" checkbox in the settings.
// // Note: Starting transcriptions from the recording dialog will still work.
- // disableClosedCaptions: false
+ // disableClosedCaptions: false,
+
+ // // Whether to invite jigasi when backend transcriptions are enabled. By default, we invite it.
+ // inviteJigasiOnBackendTranscribing: true,
// },
// Misc
diff --git a/modules/API/API.js b/modules/API/API.js
index 9ab1d619ef..c015dd1de5 100755
--- a/modules/API/API.js
+++ b/modules/API/API.js
@@ -769,7 +769,7 @@ function initCommands() {
}
if (transcription) {
- APP.store.dispatch(setRequestingSubtitles(true, false, null));
+ APP.store.dispatch(setRequestingSubtitles(true, false, null, true));
conference.getMetadataHandler().setMetadata(RECORDING_METADATA_ID, {
isTranscribingEnabled: true
});
diff --git a/react/features/base/config/configType.ts b/react/features/base/config/configType.ts
index 445bd67613..f591601441 100644
--- a/react/features/base/config/configType.ts
+++ b/react/features/base/config/configType.ts
@@ -619,6 +619,7 @@ export interface IConfig {
autoTranscribeOnRecord?: boolean;
disableClosedCaptions?: boolean;
enabled?: boolean;
+ inviteJigasiOnBackendTranscribing?: boolean;
preferredLanguage?: string;
translationLanguages?: Array<string>;
translationLanguagesHead?: Array<string>;
diff --git a/react/features/mobile/external-api/middleware.ts b/react/features/mobile/external-api/middleware.ts
index 0e6c29d2be..31b8390016 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));
conference.getMetadataHandler().setMetadata(RECORDING_METADATA_ID, {
isTranscribingEnabled: true
});
diff --git a/react/features/recording/actions.any.ts b/react/features/recording/actions.any.ts
index d124b3d782..43010e12c4 100644
--- a/react/features/recording/actions.any.ts
+++ b/react/features/recording/actions.any.ts
@@ -465,7 +465,7 @@ export function showStartRecordingNotificationWithCallback(openRecordingDialog:
conference?.getMetadataHandler().setMetadata(RECORDING_METADATA_ID, {
isTranscribingEnabled: true
});
- dispatch(setRequestingSubtitles(true, false, null));
+ dispatch(setRequestingSubtitles(true, false, null, true));
}
} else {
openRecordingDialog();
diff --git a/react/features/recording/components/Recording/AbstractStartRecordingDialog.ts b/react/features/recording/components/Recording/AbstractStartRecordingDialog.ts
index a7a93ba97b..0fdf852bef 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));
}
_conference?.getMetadataHandler().setMetadata(RECORDING_METADATA_ID, {
diff --git a/react/features/subtitles/actions.any.ts b/react/features/subtitles/actions.any.ts
index 36c4094fc0..fc610e2e5a 100644
--- a/react/features/subtitles/actions.any.ts
+++ b/react/features/subtitles/actions.any.ts
@@ -83,8 +83,10 @@ 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.
* @returns {{
* type: SET_REQUESTING_SUBTITLES,
+ * backendRecordingOn: boolean,
* enabled: boolean,
* displaySubtitles: boolean,
* language: string
@@ -93,9 +95,11 @@ export function toggleRequestingSubtitles() {
export function setRequestingSubtitles(
enabled: boolean,
displaySubtitles = true,
- language: string | null = `translation-languages:${DEFAULT_LANGUAGE}`) {
+ language: string | null = `translation-languages:${DEFAULT_LANGUAGE}`,
+ backendRecordingOn = false) {
return {
type: SET_REQUESTING_SUBTITLES,
+ backendRecordingOn,
displaySubtitles,
enabled,
language
diff --git a/react/features/subtitles/middleware.ts b/react/features/subtitles/middleware.ts
index 28ae70c268..3004247602 100644
--- a/react/features/subtitles/middleware.ts
+++ b/react/features/subtitles/middleware.ts
@@ -95,7 +95,7 @@ MiddlewareRegistry.register(store => next => action => {
break;
}
case SET_REQUESTING_SUBTITLES:
- _requestingSubtitlesChange(store, action.enabled, action.language);
+ _requestingSubtitlesChange(store, action.enabled, action.language, action.backendRecordingOn);
break;
}
@@ -330,15 +330,18 @@ 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} backendRecordingOn - Whether backend recording is on or not.
* @private
* @returns {void}
*/
function _requestingSubtitlesChange(
{ dispatch, getState }: IStore,
enabled: boolean,
- language?: string | null) {
+ language?: string | null,
+ backendRecordingOn = false) {
const state = getState();
const { conference } = state['features/base/conference'];
+ const { transcription } = state['features/base/config'];
conference?.setLocalParticipantProperty(
P_NAME_REQUESTING_TRANSCRIPTION,
@@ -347,7 +350,8 @@ function _requestingSubtitlesChange(
if (enabled && conference?.getTranscriptionStatus() === JitsiMeetJS.constants.transcriptionStatus.OFF) {
const featureAllowed = isJwtFeatureEnabled(getState(), MEET_FEATURES.TRANSCRIPTION, false);
- if (featureAllowed) {
+ // the default value for inviteJigasiOnBackendTranscribing is true (when undefined)
+ if (featureAllowed && (!backendRecordingOn || transcription?.inviteJigasiOnBackendTranscribing === false)) {
conference?.dial(TRANSCRIBER_DIAL_NUMBER)
.catch((e: any) => {
logger.error('Error dialing', e);