From 02787b13948611ea34e630adf3cf08819e7c4afa Mon Sep 17 00:00:00 2001 From: damencho Date: Fri, 5 Dec 2025 11:22:13 -0600 Subject: [PATCH] feat: Use recording dialog on asyncTranscription. --- .../Recording/AbstractStartRecordingDialog.ts | 14 +++++----- react/features/subtitles/actions.any.ts | 27 ++++++++++++++----- 2 files changed, 28 insertions(+), 13 deletions(-) diff --git a/react/features/recording/components/Recording/AbstractStartRecordingDialog.ts b/react/features/recording/components/Recording/AbstractStartRecordingDialog.ts index 0fdf852bef..c99f873579 100644 --- a/react/features/recording/components/Recording/AbstractStartRecordingDialog.ts +++ b/react/features/recording/components/Recording/AbstractStartRecordingDialog.ts @@ -63,11 +63,6 @@ export interface IProps extends WithTranslation { */ _rToken: string; - /** - * Whether the record audio / video option is enabled by default. - */ - _recordAudioAndVideo: boolean; - /** * Whether or not the local participant is screensharing. */ @@ -99,6 +94,11 @@ export interface IProps extends WithTranslation { dispatch: IStore['dispatch']; navigation: any; + + /** + * Whether the record audio / video option is enabled by default. + */ + recordAudioAndVideo: boolean; } interface IState { @@ -191,7 +191,7 @@ class AbstractStartRecordingDialog extends Component { isValidating: false, userName: undefined, sharingEnabled: true, - shouldRecordAudioAndVideo: this.props._recordAudioAndVideo, + shouldRecordAudioAndVideo: this.props.recordAudioAndVideo, shouldRecordTranscription: this.props._autoTranscribeOnRecord, spaceLeft: undefined, selectedRecordingService, @@ -474,7 +474,7 @@ export function mapStateToProps(state: IReduxState, _ownProps: any) { _isDropboxEnabled: isDropboxEnabled(state), _localRecordingEnabled: !localRecording?.disable, _rToken: state['features/dropbox'].rToken ?? '', - _recordAudioAndVideo: recordings?.recordAudioAndVideo ?? true, + recordAudioAndVideo: _ownProps.recordAudioAndVideo ?? recordings?.recordAudioAndVideo ?? true, _subtitlesLanguage, _tokenExpireDate: state['features/dropbox'].expireDate, _token: state['features/dropbox'].token ?? '' diff --git a/react/features/subtitles/actions.any.ts b/react/features/subtitles/actions.any.ts index c145a3b5db..27fd08397c 100644 --- a/react/features/subtitles/actions.any.ts +++ b/react/features/subtitles/actions.any.ts @@ -1,4 +1,7 @@ +import { IStore } from '../app/types'; +import { openDialog } from '../base/dialog/actions'; import { DEFAULT_LANGUAGE } from '../base/i18n/i18next'; +import { StartRecordingDialog } from '../recording/components/Recording'; import { REMOVE_CACHED_TRANSCRIPT_MESSAGE, @@ -97,12 +100,24 @@ export function setRequestingSubtitles( displaySubtitles = true, language: string | null = `translation-languages:${DEFAULT_LANGUAGE}`, backendRecordingOn = false) { - return { - type: SET_REQUESTING_SUBTITLES, - backendRecordingOn, - displaySubtitles, - enabled, - language + return function(dispatch: IStore['dispatch'], getState: IStore['getState']) { + const { conference } = getState()['features/base/conference']; + + if (conference?.getMetadataHandler()?.getMetadata()?.asyncTranscription) { + dispatch(openDialog('StartRecordingDialog', StartRecordingDialog, { + recordAudioAndVideo: false + })); + + return; + } + + dispatch({ + type: SET_REQUESTING_SUBTITLES, + backendRecordingOn, + displaySubtitles, + enabled, + language + }); }; }