From 0c042b4078f3025b7b61e2f45ddfa90d89d15594 Mon Sep 17 00:00:00 2001 From: damencho Date: Fri, 30 Aug 2019 14:41:18 +0100 Subject: [PATCH] Adds config to auto turn on captions when recording is started. --- config.js | 3 +++ package-lock.json | 4 ++-- package.json | 2 +- .../Recording/AbstractStartRecordingDialog.js | 15 ++++++++++++++- 4 files changed, 20 insertions(+), 4 deletions(-) diff --git a/config.js b/config.js index 17f0ad545..1f7e4e8ff 100644 --- a/config.js +++ b/config.js @@ -201,6 +201,9 @@ var config = { // subtitles and buttons can be configured) // transcribingEnabled: false, + // Enables automatic turning on captions when recording is started + // autoCaptionOnRecord: false, + // Misc // Default value for the channel "last N" attribute. -1 for unlimited. diff --git a/package-lock.json b/package-lock.json index 9f0132360..b45cec387 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10554,8 +10554,8 @@ } }, "lib-jitsi-meet": { - "version": "github:jitsi/lib-jitsi-meet#4010d2a301fa847374f2744d6f826d3decebe76a", - "from": "github:jitsi/lib-jitsi-meet#4010d2a301fa847374f2744d6f826d3decebe76a", + "version": "github:jitsi/lib-jitsi-meet#1c3b3c18e1a3a8c5c9c11cc93e61a4b3c720cfd9", + "from": "github:jitsi/lib-jitsi-meet#1c3b3c18e1a3a8c5c9c11cc93e61a4b3c720cfd9", "requires": { "@jitsi/sdp-interop": "0.1.14", "@jitsi/sdp-simulcast": "0.2.1", diff --git a/package.json b/package.json index 9c8d2f1e9..22a40efa8 100644 --- a/package.json +++ b/package.json @@ -55,7 +55,7 @@ "js-utils": "github:jitsi/js-utils#192b1c996e8c05530eb1f19e82a31069c3021e31", "jsrsasign": "8.0.12", "jwt-decode": "2.2.0", - "lib-jitsi-meet": "github:jitsi/lib-jitsi-meet#4010d2a301fa847374f2744d6f826d3decebe76a", + "lib-jitsi-meet": "github:jitsi/lib-jitsi-meet#1c3b3c18e1a3a8c5c9c11cc93e61a4b3c720cfd9", "libflacjs": "github:mmig/libflac.js#93d37e7f811f01cf7d8b6a603e38bd3c3810907d", "lodash": "4.17.13", "moment": "2.19.4", diff --git a/react/features/recording/components/Recording/AbstractStartRecordingDialog.js b/react/features/recording/components/Recording/AbstractStartRecordingDialog.js index b7ffe21c1..dd921cfd7 100644 --- a/react/features/recording/components/Recording/AbstractStartRecordingDialog.js +++ b/react/features/recording/components/Recording/AbstractStartRecordingDialog.js @@ -12,9 +12,15 @@ import { isEnabled as isDropboxEnabled } from '../../../dropbox'; import { RECORDING_TYPES } from '../../constants'; +import { toggleRequestingSubtitles } from '../../../subtitles'; type Props = { + /** + * Requests subtitles when recording is turned on. + */ + _autoCaptionOnRecord: boolean, + /** * The {@code JitsiConference} for the current conference. */ @@ -241,7 +247,7 @@ class AbstractStartRecordingDialog extends Component { * @returns {boolean} - True (to note that the modal should be closed). */ _onSubmit() { - const { _conference, _isDropboxEnabled, _token } = this.props; + const { _autoCaptionOnRecord, _conference, _isDropboxEnabled, _token, dispatch } = this.props; let appData; const attributes = {}; @@ -276,6 +282,10 @@ class AbstractStartRecordingDialog extends Component { appData }); + if (_autoCaptionOnRecord) { + dispatch(toggleRequestingSubtitles()); + } + return true; } @@ -296,6 +306,7 @@ class AbstractStartRecordingDialog extends Component { * @private * @returns {{ * _appKey: string, + * _autoCaptionOnRecord: boolean, * _conference: JitsiConference, * _fileRecordingsServiceEnabled: boolean, * _fileRecordingsServiceSharingEnabled: boolean, @@ -305,6 +316,7 @@ class AbstractStartRecordingDialog extends Component { */ export function mapStateToProps(state: Object) { const { + autoCaptionOnRecord = false, fileRecordingsServiceEnabled = false, fileRecordingsServiceSharingEnabled = false, dropbox = {} @@ -312,6 +324,7 @@ export function mapStateToProps(state: Object) { return { _appKey: dropbox.appKey, + _autoCaptionOnRecord: autoCaptionOnRecord, _conference: state['features/base/conference'].conference, _fileRecordingsServiceEnabled: fileRecordingsServiceEnabled, _fileRecordingsServiceSharingEnabled: fileRecordingsServiceSharingEnabled,