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(recording): show transcription toggle when feature available (#17602)

Mihaela Dumitru2e4db472a488
diff --git a/react/features/recording/components/Recording/AbstractStartRecordingDialog.ts b/react/features/recording/components/Recording/AbstractStartRecordingDialog.ts
index bd13999b7b..6a346dab51 100644
--- a/react/features/recording/components/Recording/AbstractStartRecordingDialog.ts
+++ b/react/features/recording/components/Recording/AbstractStartRecordingDialog.ts
@@ -649,7 +649,7 @@ export function mapStateToProps(state: IReduxState, _ownProps: any) {
// Only treat cloud recordings as "running" for users who can actually control them.
// Non-mods without the recording/transcription JWT feature cannot stop cloud sessions,
// so from their perspective only their own local recording counts as "running".
- const canControlCloud = isLocalParticipantModerator(state)
+ const canManageRecordingOrTranscription = isLocalParticipantModerator(state)
|| hasRecordingOrTranscriptionFeature(state);
return {
@@ -665,11 +665,11 @@ export function mapStateToProps(state: IReduxState, _ownProps: any) {
_isDropboxEnabled: isDropboxEnabled(state),
_localRecording: Boolean(state['features/recording'].localRecordingRunning),
_localRecordingEnabled: !localRecording?.disable,
- _recordingRunning: canControlCloud
+ _recordingRunning: canManageRecordingOrTranscription
? isRecordingRunning(state)
: Boolean(state['features/recording'].localRecordingRunning),
_rToken: state['features/dropbox'].rToken ?? '',
- _transcriptionRunning: canControlCloud
+ _transcriptionRunning: canManageRecordingOrTranscription
? isRecorderTranscriptionsRunning(state)
: false,
recordAudioAndVideo:
diff --git a/react/features/recording/components/Recording/AbstractStartRecordingDialogContent.tsx b/react/features/recording/components/Recording/AbstractStartRecordingDialogContent.tsx
index b2a45e9fff..310dd8cc5a 100644
--- a/react/features/recording/components/Recording/AbstractStartRecordingDialogContent.tsx
+++ b/react/features/recording/components/Recording/AbstractStartRecordingDialogContent.tsx
@@ -21,6 +21,12 @@ import { hasRecordingOrTranscriptionFeature, supportsLocalRecording } from '../.
*/
export interface IProps extends WithTranslation {
+ /**
+ * Whether the local participant can manage recording/transcription (moderator or holds the
+ * recording/transcription feature claim).
+ */
+ _canManageRecordingOrTranscription: boolean;
+
/**
* Whether the local participant can start transcribing.
*/
@@ -239,7 +245,29 @@ class AbstractStartRecordingDialogContent extends Component<IProps, IState> {
if (!this._shouldRenderNoIntegrationsContent()
&& !this._shouldRenderIntegrationsContent()
&& !this._shouldRenderFileSharingContent()) {
- this._onLocalRecordingSwitchChange();
+ const { _localRecordingAvailable, onChange, onRecordAudioAndVideoChange,
+ selectedRecordingService, servicesRunning, shouldRecordAudioAndVideo } = this.props;
+
+ // When a session is already active the initial toggle state is derived from what
+ // is currently running — don't override it with the "fresh open" defaults.
+ if (servicesRunning) {
+ return;
+ }
+
+ if (!_localRecordingAvailable) {
+ return;
+ }
+
+ // Pre-select local recording on open and ensure the audio/video flag is on
+ // so _isChanged() reflects the selection and the Start button is enabled.
+ // Done inline (not via _onLocalRecordingSwitchChange) to avoid the toggle-off
+ // path that the same handler uses when the user deliberately deselects.
+ if (!shouldRecordAudioAndVideo) {
+ onRecordAudioAndVideoChange(true);
+ }
+ if (selectedRecordingService !== RECORDING_TYPES.LOCAL) {
+ onChange(RECORDING_TYPES.LOCAL);
+ }
}
}
@@ -415,28 +443,22 @@ class AbstractStartRecordingDialogContent extends Component<IProps, IState> {
_localRecordingAvailable,
onChange,
onRecordAudioAndVideoChange,
- selectedRecordingService,
- shouldRecordAudioAndVideo
+ selectedRecordingService
} = this.props;
if (!_localRecordingAvailable) {
return;
}
- // Selecting local recording implies audio+video — ensure the flag is on
- // so _isChanged() reflects the selection and the Start button enables.
- // This must happen before the early return below: when LOCAL is
- // pre-selected by the dialog (no other service available) the flag
- // would otherwise never be set and the button would stay disabled.
- if (!shouldRecordAudioAndVideo) {
- onRecordAudioAndVideoChange(true);
- }
-
- // act like group, cannot toggle off
if (selectedRecordingService === RECORDING_TYPES.LOCAL) {
+ // Deselect — lets the participant start transcription without local recording.
+ onRecordAudioAndVideoChange(false);
+ onChange('');
+
return;
}
+ onRecordAudioAndVideoChange(true);
onChange(RECORDING_TYPES.LOCAL);
}
@@ -470,16 +492,18 @@ class AbstractStartRecordingDialogContent extends Component<IProps, IState> {
export function mapStateToProps(state: IReduxState) {
const { localRecording, recordingService } = state['features/base/config'];
const _localRecordingAvailable = !localRecording?.disable && supportsLocalRecording();
- const canControlCloud = isLocalParticipantModerator(state) || hasRecordingOrTranscriptionFeature(state);
+ const canManageRecordingOrTranscription
+ = isLocalParticipantModerator(state) || hasRecordingOrTranscriptionFeature(state);
return {
..._abstractMapStateToProps(state),
isVpaas: isVpaasMeeting(state),
+ _canManageRecordingOrTranscription: canManageRecordingOrTranscription,
_canStartTranscribing: canAddTranscriber(state),
_hideStorageWarning: Boolean(recordingService?.hideStorageWarning),
_isModerator: isLocalParticipantModerator(state),
_renderRecording: isJwtFeatureEnabled(state, MEET_FEATURES.RECORDING, false),
- _transcriptionRunning: canControlCloud ? isRecorderTranscriptionsRunning(state) : false,
+ _transcriptionRunning: canManageRecordingOrTranscription ? isRecorderTranscriptionsRunning(state) : false,
_localRecordingAvailable,
_localRecordingEnabled: !localRecording?.disable,
_localRecordingRunning: Boolean(state['features/recording'].localRecordingRunning),
diff --git a/react/features/recording/components/Recording/web/StartRecordingDialogContent.tsx b/react/features/recording/components/Recording/web/StartRecordingDialogContent.tsx
index 2f03c7d282..7f632c3a61 100644
--- a/react/features/recording/components/Recording/web/StartRecordingDialogContent.tsx
+++ b/react/features/recording/components/Recording/web/StartRecordingDialogContent.tsx
@@ -90,6 +90,8 @@ class StartRecordingDialogContent extends AbstractStartRecordingDialogContent {
_canStartTranscribing,
_renderRecording,
_transcriptionRunning,
+ fileRecordingsServiceEnabled,
+ integrationsEnabled,
recordingRunning
} = this.props;
@@ -115,13 +117,15 @@ class StartRecordingDialogContent extends AbstractStartRecordingDialogContent {
);
}
- // Offer the standalone transcription toggle to transcription-capable participants whenever
- // cloud recording is not available (when it is, transcription lives in the advanced options).
- const showTranscription = !_renderRecording && _canStartTranscribing;
+ // Cloud recording is only usable when a service (file recording or integration) is available;
+ // the JWT recording feature alone doesn't imply one. Transcription nests under the cloud
+ // options when it's supported, otherwise it shows standalone.
+ const supportsCloudRecording = _renderRecording && (fileRecordingsServiceEnabled || integrationsEnabled);
+ const showTranscription = _canStartTranscribing && !supportsCloudRecording;
return (
<Container className = 'recording-dialog'>
- { _renderRecording && (
+ { supportsCloudRecording && (
<>
{ this._renderNoIntegrationsContent() }
{ this._renderFileSharingContent() }
@@ -167,7 +171,8 @@ class StartRecordingDialogContent extends AbstractStartRecordingDialogContent {
* @returns {React$Component}
*/
_renderAdvancedOptions() {
- if (!this.props._isModerator) {
+ // Recording/transcription permissions needed.
+ if (!this.props._canManageRecordingOrTranscription) {
return null;
}
if (!this._canStartTranscribing() && !this.props.servicesRunning) {