From 84f303dd3c729abab319c97e0c2814b2cef507fb Mon Sep 17 00:00:00 2001 From: virtuacoplenny Date: Tue, 5 Jun 2018 22:19:28 -0700 Subject: [PATCH] ref(toolbar): show recording features based on explicit configs (#3080) * ref(toolbar): show recording features based on explicit configs * squash: bring back button configs, use final config names * squash: update interfaceConfig comment, remove unused config whitelist * squash: change order of button enabled checks to reduce diff * squash: fileRecording -> fileRecordings --- conference.js | 7 ----- config.js | 8 ++--- interface_config.js | 11 ++++--- modules/UI/UI.js | 2 +- react/features/base/config/functions.js | 4 +-- .../toolbox/components/web/Toolbox.js | 30 ++++++++++++------- 6 files changed, 31 insertions(+), 31 deletions(-) diff --git a/conference.js b/conference.js index 86576b1ba..fd8726cb0 100644 --- a/conference.js +++ b/conference.js @@ -1255,13 +1255,6 @@ export default { _getConferenceOptions() { const options = config; - if (config.enableRecording && !config.recordingType) { - options.recordingType - = config.hosts && (typeof config.hosts.jirecon !== 'undefined') - ? 'jirecon' - : 'colibri'; - } - const nick = APP.store.getState()['features/base/settings'].displayName; if (nick) { diff --git a/config.js b/config.js index 45be4437f..5f4323d94 100644 --- a/config.js +++ b/config.js @@ -167,11 +167,11 @@ var config = { // Recording - // Whether to enable recording or not. - // enableRecording: false, + // Whether to enable file recording or not. + // fileRecordingsEnabled: false, - // Type for recording: one of jibri or jirecon. - // recordingType: 'jibri', + // Whether to enable live streaming or not. + // liveStreamingEnabled: false, // Misc diff --git a/interface_config.js b/interface_config.js index 2fd8c6c96..5cc877285 100644 --- a/interface_config.js +++ b/interface_config.js @@ -38,15 +38,14 @@ var interfaceConfig = { AUTHENTICATION_ENABLE: true, /** - * the toolbar buttons line is intentionally left in one line, to be able - * to easily override values or remove them using regex + * The name of the toolbar buttons to display in the toolbar. If present, + * the button will display. Exceptions are "livestreaming" and "recording" + * which also require being a moderator and some values in config.js to be + * enabled. Also, the "profile" button will not display for user's with a + * jwt. */ TOOLBAR_BUTTONS: [ - - // main toolbar 'microphone', 'camera', 'desktop', 'fullscreen', 'fodeviceselection', 'hangup', - - // extended toolbar 'profile', 'info', 'chat', 'recording', 'livestreaming', 'etherpad', 'sharedvideo', 'settings', 'raisehand', 'videoquality', 'filmstrip', 'invite', 'feedback', 'stats', 'shortcuts' diff --git a/modules/UI/UI.js b/modules/UI/UI.js index 97642c9f6..13bdad918 100644 --- a/modules/UI/UI.js +++ b/modules/UI/UI.js @@ -351,7 +351,7 @@ UI.start = function() { APP.store.dispatch(setNotificationsEnabled(false)); } else { // Initialize recording mode UI. - if (config.enableRecording && config.iAmRecorder) { + if (config.iAmRecorder) { VideoLayout.enableDeviceAvailabilityIcons( APP.conference.getMyUserId(), false); diff --git a/react/features/base/config/functions.js b/react/features/base/config/functions.js index 6f101082c..f6baf26d8 100644 --- a/react/features/base/config/functions.js +++ b/react/features/base/config/functions.js @@ -87,7 +87,6 @@ const WHITELISTED_KEYS = [ 'enableDisplayNameInStats', 'enableLipSync', 'enableLocalVideoFlip', - 'enableRecording', 'enableRemb', 'enableStatsID', 'enableTalkWhileMuted', @@ -95,6 +94,7 @@ const WHITELISTED_KEYS = [ 'enableUserRolesBasedOnToken', 'etherpad_base', 'failICE', + 'fileRecordingsEnabled', 'firefox_fake_device', 'forceJVB121Ratio', 'gatherStats', @@ -105,12 +105,12 @@ const WHITELISTED_KEYS = [ 'iAmSipGateway', 'iceTransportPolicy', 'ignoreStartMuted', + 'liveStreamingEnabled', 'minParticipants', 'nick', 'openBridgeChannel', 'p2p', 'preferH264', - 'recordingType', 'requireDisplayName', 'resolution', 'startAudioMuted', diff --git a/react/features/toolbox/components/web/Toolbox.js b/react/features/toolbox/components/web/Toolbox.js index d04cbe749..b97823c7f 100644 --- a/react/features/toolbox/components/web/Toolbox.js +++ b/react/features/toolbox/components/web/Toolbox.js @@ -103,6 +103,11 @@ type Props = { */ _feedbackConfigured: boolean, + /** + * Whether or not the file recording feature is enabled for use. + */ + _fileRecordingsEnabled: boolean, + /** * The current file recording session, if any. */ @@ -124,6 +129,11 @@ type Props = { */ _isGuest: boolean, + /** + * Whether or not the live streaming feature is enabled for use. + */ + _liveStreamingEnabled: boolean, + /** * The current live streaming session, if any. */ @@ -144,11 +154,6 @@ type Props = { */ _raisedHand: boolean, - /** - * Whether or not the recording feature is enabled for use. - */ - _recordingEnabled: boolean, - /** * Whether or not the local participant is screensharing. */ @@ -959,10 +964,11 @@ class Toolbox extends Component { _editingDocument, _etherpadInitialized, _feedbackConfigured, + _fileRecordingsEnabled, _fullScreen, _isGuest, + _liveStreamingEnabled, _liveStreamingSession, - _recordingEnabled, _sharingVideo, t } = this.props; @@ -988,13 +994,13 @@ class Toolbox extends Component { text = { _fullScreen ? t('toolbar.exitFullScreen') : t('toolbar.enterFullScreen') } />, - _recordingEnabled + _liveStreamingEnabled && this._shouldShowButton('livestreaming') && , - _recordingEnabled + _fileRecordingsEnabled && this._shouldShowButton('recording') && this._renderRecordingButton(), this._shouldShowButton('sharedvideo') @@ -1100,8 +1106,9 @@ function _mapStateToProps(state) { const { callStatsID, disableDesktopSharing, - enableRecording, - iAmRecorder + fileRecordingsEnabled, + iAmRecorder, + liveStreamingEnabled } = state['features/base/config']; const sharedVideoStatus = state['features/shared-video'].status; const { current } = state['features/side-panel']; @@ -1130,15 +1137,16 @@ function _mapStateToProps(state) { _hideInviteButton: iAmRecorder || (!addPeopleEnabled && !dialOutEnabled), _isGuest: state['features/base/jwt'].isGuest, + _fileRecordingsEnabled: isModerator && fileRecordingsEnabled, _fileRecordingSession: getActiveSession(state, JitsiRecordingConstants.mode.FILE), _fullScreen: fullScreen, + _liveStreamingEnabled: isModerator && liveStreamingEnabled, _liveStreamingSession: getActiveSession(state, JitsiRecordingConstants.mode.STREAM), _localParticipantID: localParticipant.id, _overflowMenuVisible: overflowMenuVisible, _raisedHand: localParticipant.raisedHand, - _recordingEnabled: isModerator && enableRecording, _screensharing: localVideo && localVideo.videoType === 'desktop', _sharingVideo: sharedVideoStatus === 'playing' || sharedVideoStatus === 'start'