Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.
TypeScript debiandeep-videojitsijitsi-meetscalable-video-conferencessfuvideovideo-communicationvideo-conferencingwebrtc
fix(recording): show advanced options in several corner cases
mishraditie9848f643842
diff --git a/lang/main.json b/lang/main.jsonindex a068c37981..33f4ecfdc0 100644--- a/lang/main.json+++ b/lang/main.json@@ -1145,7 +1145,6 @@"localRecordingWarning": "Make sure you select the current tab in order to use the right video and audio.","loggedIn": "Logged in as {{userName}}","noMicPermission": "Microphone track could not be created. Please grant permission to use the microphone.",- "noStreams": "No audio or video stream detected.","off": "Recording stopped","offBy": "{{name}} stopped the recording","on": "Recording started",diff --git a/react/features/recording/components/Recording/AbstractStartRecordingDialog.ts b/react/features/recording/components/Recording/AbstractStartRecordingDialog.tsindex cc20b924f7..b66cd69e93 100644--- a/react/features/recording/components/Recording/AbstractStartRecordingDialog.ts+++ b/react/features/recording/components/Recording/AbstractStartRecordingDialog.ts@@ -5,6 +5,8 @@ import { createRecordingDialogEvent } from '../../../analytics/AnalyticsEvents';import { sendAnalytics } from '../../../analytics/functions';import { IReduxState, IStore } from '../../../app/types';import { IJitsiConference } from '../../../base/conference/reducer';+import { MEET_FEATURES } from '../../../base/jwt/constants';+import { isJwtFeatureEnabled } from '../../../base/jwt/functions';import { JitsiRecordingConstants } from '../../../base/lib-jitsi-meet';import { updateDropboxToken } from '../../../dropbox/actions';import { getDropboxData, getNewAccessToken, isEnabled as isDropboxEnabled } from '../../../dropbox/functions.any';@@ -173,10 +175,8 @@ class AbstractStartRecordingDialog extends Component<IProps, IState> {let selectedRecordingService = '';- // TODO: Potentially check if we need to handle changes of- // _fileRecordingsServiceEnabled and _areIntegrationsEnabled()- if (this.props._fileRecordingsServiceEnabled- || !this._areIntegrationsEnabled()) {+ // Select the default recording service based on what's actually available.+ if (this.props._fileRecordingsServiceEnabled) {selectedRecordingService = RECORDING_TYPES.JITSI_REC_SERVICE;} else if (this._areIntegrationsEnabled()) {if (props._localRecordingEnabled && supportsLocalRecording()) {@@ -184,7 +184,12 @@ class AbstractStartRecordingDialog extends Component<IProps, IState> {} else {selectedRecordingService = RECORDING_TYPES.DROPBOX;}+ } else if (props._localRecordingEnabled && supportsLocalRecording()) {+ selectedRecordingService = RECORDING_TYPES.LOCAL;}+ // If no service is available, selectedRecordingService stays '' and+ // the Start Recording button will be disabled.+this.state = {isTokenValid: false,@@ -397,6 +402,9 @@ class AbstractStartRecordingDialog extends Component<IProps, IState> {}case RECORDING_TYPES.LOCAL: {dispatch(startLocalVideoRecording(this.state.localRecordingOnlySelf));+ _conference?.getMetadataHandler().setMetadata(RECORDING_METADATA_ID, {+ isTranscribingEnabled: this.state.shouldRecordTranscription+ });return true;}@@ -474,7 +482,9 @@ export function mapStateToProps(state: IReduxState, _ownProps: any) {_isDropboxEnabled: isDropboxEnabled(state),_localRecordingEnabled: !localRecording?.disable,_rToken: state['features/dropbox'].rToken ?? '',- recordAudioAndVideo: _ownProps.recordAudioAndVideo ?? recordings?.recordAudioAndVideo ?? true,+ recordAudioAndVideo:+ isJwtFeatureEnabled(state, MEET_FEATURES.RECORDING, false)+ ? _ownProps.recordAudioAndVideo ?? recordings?.recordAudioAndVideo ?? true : false,_subtitlesLanguage,_tokenExpireDate: state['features/dropbox'].expireDate,_token: state['features/dropbox'].token ?? ''diff --git a/react/features/recording/components/Recording/web/StartRecordingDialog.tsx b/react/features/recording/components/Recording/web/StartRecordingDialog.tsxindex 9f9f8244a2..0c9f7cdeac 100644--- a/react/features/recording/components/Recording/web/StartRecordingDialog.tsx+++ b/react/features/recording/components/Recording/web/StartRecordingDialog.tsx@@ -51,6 +51,11 @@ class StartRecordingDialog extends AbstractStartRecordingDialog {return false;}+ // Allow transcription-only start even without a recording service selected.+ if (!selectedRecordingService && shouldRecordTranscription) {+ return false;+ }+return true;}diff --git a/react/features/recording/components/Recording/web/StartRecordingDialogContent.tsx b/react/features/recording/components/Recording/web/StartRecordingDialogContent.tsxindex 21cf98589a..77ff1a8108 100644--- a/react/features/recording/components/Recording/web/StartRecordingDialogContent.tsx+++ b/react/features/recording/components/Recording/web/StartRecordingDialogContent.tsx@@ -37,7 +37,14 @@ class StartRecordingDialogContent extends AbstractStartRecordingDialogContent {* @returns {React$Component}*/override render() {- const _renderRecording = this.props._renderRecording;+ const {+ _canStartTranscribing,+ _localRecordingAvailable,+ _renderRecording,+ integrationsEnabled+ } = this.props;+ const hasRecordingService = _renderRecording || _localRecordingAvailable || integrationsEnabled;+ const transcriptionOnly = !hasRecordingService && _canStartTranscribing;return (<Container className = 'recording-dialog'>@@ -50,25 +57,57 @@ class StartRecordingDialogContent extends AbstractStartRecordingDialogContent {</>)}{ this._renderLocalRecordingContent() }- { _renderRecording && <> { this._renderAdvancedOptions() } </> }+ { transcriptionOnly && this._renderTranscriptionOnly() }+ { hasRecordingService && <> { this._renderAdvancedOptions() } </> }</Container>);}+ /**+ * Renders the transcription toggle directly when no recording service+ * is available but transcription is.+ *+ * @returns {React$Component}+ */+ _renderTranscriptionOnly() {+ const { shouldRecordTranscription, t } = this.props;++ return (+ <div className = 'recording-header'>+ <label+ className = 'recording-title-no-space'+ htmlFor = 'recording-switch-transcription'>+ { t('recording.recordTranscription') }+ </label>+ <Switch+ checked = { shouldRecordTranscription }+ className = 'recording-switch'+ id = 'recording-switch-transcription'+ onChange = { this._onTranscriptionSwitchChange } />+ </div>+ );+ }+/*** Renders the switch for saving the transcription.** @returns {React$Component}*/_renderAdvancedOptions() {+ if (!this._canStartTranscribing()) {+ return null;+ }const { selectedRecordingService } = this.props;+ const validService = selectedRecordingService === RECORDING_TYPES.JITSI_REC_SERVICE+ || selectedRecordingService === RECORDING_TYPES.LOCAL+ || !selectedRecordingService;- if (selectedRecordingService !== RECORDING_TYPES.JITSI_REC_SERVICE || !this._canStartTranscribing()) {+ if (!validService) {return null;}const { showAdvancedOptions } = this.state;- const { shouldRecordAudioAndVideo, shouldRecordTranscription, t } = this.props;+ const { _renderRecording, shouldRecordAudioAndVideo, shouldRecordTranscription, t } = this.props;return (<>@@ -100,18 +139,20 @@ class StartRecordingDialogContent extends AbstractStartRecordingDialogContent {id = 'recording-switch-transcription'onChange = { this._onTranscriptionSwitchChange } /></div>- <div className = 'recording-header space-top'>- <label- className = 'recording-title'- htmlFor = 'recording-switch-audio-video'>- { t('recording.recordAudioAndVideo') }- </label>- <Switch- checked = { shouldRecordAudioAndVideo }- className = 'recording-switch'- id = 'recording-switch-audio-video'- onChange = { this._onRecordAudioAndVideoSwitchChange } />- </div>+ {_renderRecording && (+ <div className = 'recording-header space-top'>+ <label+ className = 'recording-title'+ htmlFor = 'recording-switch-audio-video'>+ { t('recording.recordAudioAndVideo') }+ </label>+ <Switch+ checked = { shouldRecordAudioAndVideo }+ className = 'recording-switch'+ id = 'recording-switch-audio-video'+ onChange = { this._onRecordAudioAndVideoSwitchChange } />+ </div>+ )}</>)}</>diff --git a/react/features/recording/functions.ts b/react/features/recording/functions.tsindex e23f94d6da..59d392cb30 100644--- a/react/features/recording/functions.ts+++ b/react/features/recording/functions.ts@@ -201,7 +201,8 @@ export function canStopRecording(state: IReduxState) {}if (isCloudRecordingRunning(state) || isRecorderTranscriptionsRunning(state)) {- return isJwtFeatureEnabled(state, MEET_FEATURES.RECORDING, false);+ return isJwtFeatureEnabled(state, MEET_FEATURES.RECORDING, false)+ || isJwtFeatureEnabled(state, MEET_FEATURES.TRANSCRIPTION, false);}return false;@@ -255,17 +256,21 @@ export function getRecordButtonProps(state: IReduxState) {// its own to be visible or not.const {recordingService,- localRecording+ localRecording,+ transcription} = state['features/base/config'];const localRecordingEnabled = !localRecording?.disable && supportsLocalRecording();const dropboxEnabled = isDropboxEnabled(state);const recordingEnabled = recordingService?.enabled || dropboxEnabled;+ const transcriptionEnabled = transcription?.enabled;if (localRecordingEnabled) {visible = true;} else if (isJwtFeatureEnabled(state, MEET_FEATURES.RECORDING, false)) {visible = recordingEnabled;+ } else if (isJwtFeatureEnabled(state, MEET_FEATURES.TRANSCRIPTION, false)) {+ visible = transcriptionEnabled;}// disable the button if the livestreaming is running.diff --git a/resources/prosody-plugins/mod_filter_iq_rayo.lua b/resources/prosody-plugins/mod_filter_iq_rayo.luaindex 07af447fd7..47318314d8 100644--- a/resources/prosody-plugins/mod_filter_iq_rayo.lua+++ b/resources/prosody-plugins/mod_filter_iq_rayo.lua@@ -257,8 +257,7 @@ module:hook('jitsi-metadata-allow-moderation', function (event)-- if it is recording we want to allow setting in metadata if not moderator but features-- are presentif session.jitsi_meet_context_features- and is_feature_allowed('transcription', session.jitsi_meet_context_features)- and is_feature_allowed('recording', session.jitsi_meet_context_features) then+ and is_feature_allowed('transcription', session.jitsi_meet_context_features) thenlocal res = {};res.isTranscribingEnabled = data.isTranscribingEnabled;return res;