From 730d42cba1671cab2149350a3aef59621e43406e Mon Sep 17 00:00:00 2001 From: Robert Pintilii Date: Wed, 29 Jun 2022 08:05:55 +0100 Subject: [PATCH] fix(local-recording) Improvements (#11754) Show Start rec button if local rec is enabled but fileRecordings is disabled Add warning for users to stop the recording --- lang/main.json | 2 ++ .../Recording/AbstractStartRecordingDialog.js | 2 ++ .../Recording/StartRecordingDialogContent.js | 19 ++++++++++++++++--- .../Recording/web/StartRecordingDialog.js | 2 ++ react/features/recording/functions.js | 10 ++++++++-- react/features/recording/middleware.js | 4 ++++ 6 files changed, 34 insertions(+), 5 deletions(-) diff --git a/lang/main.json b/lang/main.json index 7ca77d6ca..7b80c7248 100644 --- a/lang/main.json +++ b/lang/main.json @@ -896,6 +896,8 @@ "live": "LIVE", "localRecordingNoNotificationWarning": "The recording will not be announced to other participants. You will need to let them know that the meeting is recorded.", "localRecordingNoVideo": "Video is not being recorded", + "localRecordingStartWarning": "Please make sure you stop the recording before exiting the meeting in order to save it.", + "localRecordingStartWarningTitle": "Stop the recording to save it", "localRecordingVideoStop": "Stopping your video will also stop the local recording. Are you sure you want to continue?", "localRecordingVideoWarning": "To record your video you must have it on when starting the recording", "localRecordingWarning": "Make sure you select the current tab in order to use the right video and audio. The recording is currently limited to 1GB, which is around 100 minutes.", diff --git a/react/features/recording/components/Recording/AbstractStartRecordingDialog.js b/react/features/recording/components/Recording/AbstractStartRecordingDialog.js index 58e62d071..8006e9d32 100644 --- a/react/features/recording/components/Recording/AbstractStartRecordingDialog.js +++ b/react/features/recording/components/Recording/AbstractStartRecordingDialog.js @@ -405,6 +405,7 @@ class AbstractStartRecordingDialog extends Component { export function mapStateToProps(state: Object) { const { transcription, + fileRecordingsEnabled = false, fileRecordingsServiceEnabled = false, fileRecordingsServiceSharingEnabled = false, dropbox = {} @@ -414,6 +415,7 @@ export function mapStateToProps(state: Object) { _appKey: dropbox.appKey, _autoCaptionOnRecord: transcription?.autoCaptionOnRecord ?? false, _conference: state['features/base/conference'].conference, + _fileRecordingsEnabled: fileRecordingsEnabled, _fileRecordingsServiceEnabled: fileRecordingsServiceEnabled, _fileRecordingsServiceSharingEnabled: fileRecordingsServiceSharingEnabled, _isDropboxEnabled: isDropboxEnabled(state), diff --git a/react/features/recording/components/Recording/StartRecordingDialogContent.js b/react/features/recording/components/Recording/StartRecordingDialogContent.js index 71cb542e2..929f676a1 100644 --- a/react/features/recording/components/Recording/StartRecordingDialogContent.js +++ b/react/features/recording/components/Recording/StartRecordingDialogContent.js @@ -64,6 +64,11 @@ type Props = { */ dispatch: Function, + /** + * Whether the file recording is enabled. + */ + fileRecordingsEnabled: boolean, + /** * Whether to show file recordings service, even if integrations * are enabled. @@ -211,9 +216,14 @@ class StartRecordingDialogContent extends Component { * @returns {boolean} */ _shouldRenderFileSharingContent() { - const { fileRecordingsServiceSharingEnabled, isVpaas, selectedRecordingService } = this.props; + const { + fileRecordingsServiceSharingEnabled, + isVpaas, + selectedRecordingService, + fileRecordingsEnabled + } = this.props; - if (!fileRecordingsServiceSharingEnabled + if (!(fileRecordingsServiceSharingEnabled && fileRecordingsEnabled) || isVpaas || selectedRecordingService !== RECORDING_TYPES.JITSI_REC_SERVICE) { return false; @@ -319,6 +329,9 @@ class StartRecordingDialogContent extends Component { _shouldRenderNoIntegrationsContent() { // show the non integrations part only if fileRecordingsServiceEnabled // is enabled or when there are no integrations enabled + if (!this.props.fileRecordingsEnabled) { + return false; + } if (!(this.props.fileRecordingsServiceEnabled || !this.props.integrationsEnabled)) { return false; @@ -441,7 +454,7 @@ class StartRecordingDialogContent extends Component { ); } - if (this.props.fileRecordingsServiceEnabled) { + if (this.props.fileRecordingsServiceEnabled && this.props.fileRecordingsEnabled) { switchContent = ( next => async action => dispatch(playSound(RECORDING_ON_SOUND_ID)); } dispatch(showNotification(props, NOTIFICATION_TIMEOUT_TYPE.MEDIUM)); + dispatch(showNotification({ + titleKey: 'recording.localRecordingStartWarningTitle', + descriptionKey: 'recording.localRecordingStartWarning' + }, NOTIFICATION_TIMEOUT_TYPE.STICKY)); dispatch(updateLocalRecordingStatus(true, onlySelf)); sendAnalytics(createRecordingEvent('started', `local${onlySelf ? '.self' : ''}`)); } catch (err) {