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
This commit is contained in:
virtuacoplenny 2018-06-05 22:19:28 -07:00 committed by bbaldino
parent 3e79926ad4
commit 84f303dd3c
6 changed files with 31 additions and 31 deletions

View File

@ -1255,13 +1255,6 @@ export default {
_getConferenceOptions() { _getConferenceOptions() {
const options = config; 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; const nick = APP.store.getState()['features/base/settings'].displayName;
if (nick) { if (nick) {

View File

@ -167,11 +167,11 @@ var config = {
// Recording // Recording
// Whether to enable recording or not. // Whether to enable file recording or not.
// enableRecording: false, // fileRecordingsEnabled: false,
// Type for recording: one of jibri or jirecon. // Whether to enable live streaming or not.
// recordingType: 'jibri', // liveStreamingEnabled: false,
// Misc // Misc

View File

@ -38,15 +38,14 @@ var interfaceConfig = {
AUTHENTICATION_ENABLE: true, AUTHENTICATION_ENABLE: true,
/** /**
* the toolbar buttons line is intentionally left in one line, to be able * The name of the toolbar buttons to display in the toolbar. If present,
* to easily override values or remove them using regex * 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: [ TOOLBAR_BUTTONS: [
// main toolbar
'microphone', 'camera', 'desktop', 'fullscreen', 'fodeviceselection', 'hangup', 'microphone', 'camera', 'desktop', 'fullscreen', 'fodeviceselection', 'hangup',
// extended toolbar
'profile', 'info', 'chat', 'recording', 'livestreaming', 'etherpad', 'profile', 'info', 'chat', 'recording', 'livestreaming', 'etherpad',
'sharedvideo', 'settings', 'raisehand', 'videoquality', 'filmstrip', 'sharedvideo', 'settings', 'raisehand', 'videoquality', 'filmstrip',
'invite', 'feedback', 'stats', 'shortcuts' 'invite', 'feedback', 'stats', 'shortcuts'

View File

@ -351,7 +351,7 @@ UI.start = function() {
APP.store.dispatch(setNotificationsEnabled(false)); APP.store.dispatch(setNotificationsEnabled(false));
} else { } else {
// Initialize recording mode UI. // Initialize recording mode UI.
if (config.enableRecording && config.iAmRecorder) { if (config.iAmRecorder) {
VideoLayout.enableDeviceAvailabilityIcons( VideoLayout.enableDeviceAvailabilityIcons(
APP.conference.getMyUserId(), false); APP.conference.getMyUserId(), false);

View File

@ -87,7 +87,6 @@ const WHITELISTED_KEYS = [
'enableDisplayNameInStats', 'enableDisplayNameInStats',
'enableLipSync', 'enableLipSync',
'enableLocalVideoFlip', 'enableLocalVideoFlip',
'enableRecording',
'enableRemb', 'enableRemb',
'enableStatsID', 'enableStatsID',
'enableTalkWhileMuted', 'enableTalkWhileMuted',
@ -95,6 +94,7 @@ const WHITELISTED_KEYS = [
'enableUserRolesBasedOnToken', 'enableUserRolesBasedOnToken',
'etherpad_base', 'etherpad_base',
'failICE', 'failICE',
'fileRecordingsEnabled',
'firefox_fake_device', 'firefox_fake_device',
'forceJVB121Ratio', 'forceJVB121Ratio',
'gatherStats', 'gatherStats',
@ -105,12 +105,12 @@ const WHITELISTED_KEYS = [
'iAmSipGateway', 'iAmSipGateway',
'iceTransportPolicy', 'iceTransportPolicy',
'ignoreStartMuted', 'ignoreStartMuted',
'liveStreamingEnabled',
'minParticipants', 'minParticipants',
'nick', 'nick',
'openBridgeChannel', 'openBridgeChannel',
'p2p', 'p2p',
'preferH264', 'preferH264',
'recordingType',
'requireDisplayName', 'requireDisplayName',
'resolution', 'resolution',
'startAudioMuted', 'startAudioMuted',

View File

@ -103,6 +103,11 @@ type Props = {
*/ */
_feedbackConfigured: boolean, _feedbackConfigured: boolean,
/**
* Whether or not the file recording feature is enabled for use.
*/
_fileRecordingsEnabled: boolean,
/** /**
* The current file recording session, if any. * The current file recording session, if any.
*/ */
@ -124,6 +129,11 @@ type Props = {
*/ */
_isGuest: boolean, _isGuest: boolean,
/**
* Whether or not the live streaming feature is enabled for use.
*/
_liveStreamingEnabled: boolean,
/** /**
* The current live streaming session, if any. * The current live streaming session, if any.
*/ */
@ -144,11 +154,6 @@ type Props = {
*/ */
_raisedHand: boolean, _raisedHand: boolean,
/**
* Whether or not the recording feature is enabled for use.
*/
_recordingEnabled: boolean,
/** /**
* Whether or not the local participant is screensharing. * Whether or not the local participant is screensharing.
*/ */
@ -959,10 +964,11 @@ class Toolbox extends Component<Props> {
_editingDocument, _editingDocument,
_etherpadInitialized, _etherpadInitialized,
_feedbackConfigured, _feedbackConfigured,
_fileRecordingsEnabled,
_fullScreen, _fullScreen,
_isGuest, _isGuest,
_liveStreamingEnabled,
_liveStreamingSession, _liveStreamingSession,
_recordingEnabled,
_sharingVideo, _sharingVideo,
t t
} = this.props; } = this.props;
@ -988,13 +994,13 @@ class Toolbox extends Component<Props> {
text = { _fullScreen text = { _fullScreen
? t('toolbar.exitFullScreen') ? t('toolbar.exitFullScreen')
: t('toolbar.enterFullScreen') } />, : t('toolbar.enterFullScreen') } />,
_recordingEnabled _liveStreamingEnabled
&& this._shouldShowButton('livestreaming') && this._shouldShowButton('livestreaming')
&& <OverflowMenuLiveStreamingItem && <OverflowMenuLiveStreamingItem
key = 'livestreaming' key = 'livestreaming'
onClick = { this._onToolbarToggleLiveStreaming } onClick = { this._onToolbarToggleLiveStreaming }
session = { _liveStreamingSession } />, session = { _liveStreamingSession } />,
_recordingEnabled _fileRecordingsEnabled
&& this._shouldShowButton('recording') && this._shouldShowButton('recording')
&& this._renderRecordingButton(), && this._renderRecordingButton(),
this._shouldShowButton('sharedvideo') this._shouldShowButton('sharedvideo')
@ -1100,8 +1106,9 @@ function _mapStateToProps(state) {
const { const {
callStatsID, callStatsID,
disableDesktopSharing, disableDesktopSharing,
enableRecording, fileRecordingsEnabled,
iAmRecorder iAmRecorder,
liveStreamingEnabled
} = state['features/base/config']; } = state['features/base/config'];
const sharedVideoStatus = state['features/shared-video'].status; const sharedVideoStatus = state['features/shared-video'].status;
const { current } = state['features/side-panel']; const { current } = state['features/side-panel'];
@ -1130,15 +1137,16 @@ function _mapStateToProps(state) {
_hideInviteButton: _hideInviteButton:
iAmRecorder || (!addPeopleEnabled && !dialOutEnabled), iAmRecorder || (!addPeopleEnabled && !dialOutEnabled),
_isGuest: state['features/base/jwt'].isGuest, _isGuest: state['features/base/jwt'].isGuest,
_fileRecordingsEnabled: isModerator && fileRecordingsEnabled,
_fileRecordingSession: _fileRecordingSession:
getActiveSession(state, JitsiRecordingConstants.mode.FILE), getActiveSession(state, JitsiRecordingConstants.mode.FILE),
_fullScreen: fullScreen, _fullScreen: fullScreen,
_liveStreamingEnabled: isModerator && liveStreamingEnabled,
_liveStreamingSession: _liveStreamingSession:
getActiveSession(state, JitsiRecordingConstants.mode.STREAM), getActiveSession(state, JitsiRecordingConstants.mode.STREAM),
_localParticipantID: localParticipant.id, _localParticipantID: localParticipant.id,
_overflowMenuVisible: overflowMenuVisible, _overflowMenuVisible: overflowMenuVisible,
_raisedHand: localParticipant.raisedHand, _raisedHand: localParticipant.raisedHand,
_recordingEnabled: isModerator && enableRecording,
_screensharing: localVideo && localVideo.videoType === 'desktop', _screensharing: localVideo && localVideo.videoType === 'desktop',
_sharingVideo: sharedVideoStatus === 'playing' _sharingVideo: sharedVideoStatus === 'playing'
|| sharedVideoStatus === 'start' || sharedVideoStatus === 'start'