From 76f8302aeb66cf90064da367503d8b4706e6000e Mon Sep 17 00:00:00 2001 From: robertpin Date: Wed, 21 Jul 2021 11:46:49 +0300 Subject: [PATCH] fix(recording-label) Make REC label visible at all times (#9578) --- config.js | 3 + css/_subject.scss | 25 ++++- react/features/base/config/configWhitelist.js | 1 + .../components/web/ConferenceInfo.js | 91 ++++++++++++++----- 4 files changed, 98 insertions(+), 22 deletions(-) diff --git a/config.js b/config.js index 217f6a4806..223256f6e0 100644 --- a/config.js +++ b/config.js @@ -735,6 +735,9 @@ var config = { // Hides the conference subject // hideConferenceSubject: true, + // Hides the recording label + // hideRecordingLabel: false, + // Hides the conference timer. // hideConferenceTimer: true, diff --git a/css/_subject.scss b/css/_subject.scss index e39a08b7d9..22087dd44f 100644 --- a/css/_subject.scss +++ b/css/_subject.scss @@ -9,8 +9,31 @@ z-index: $zindex3; &.visible { - top: 0px; + top: 0; } + + &.recording { + top: 0; + + .subject-details-container { + opacity: 0; + transition: opacity .3s ease-in; + } + + .subject-info-container .show-always { + transition: margin-left .3s ease-in; + } + + &.visible { + .subject-details-container { + opacity: 1; + } + } + } +} + +.subject-details-container { + display: flex; } .subject-info-container { diff --git a/react/features/base/config/configWhitelist.js b/react/features/base/config/configWhitelist.js index af21305976..9ff4357c66 100644 --- a/react/features/base/config/configWhitelist.js +++ b/react/features/base/config/configWhitelist.js @@ -131,6 +131,7 @@ export default [ 'gatherStats', 'googleApiApplicationClientID', 'hideConferenceSubject', + 'hideRecordingLabel', 'hideParticipantsStats', 'hideConferenceTimer', 'hiddenDomain', diff --git a/react/features/conference/components/web/ConferenceInfo.js b/react/features/conference/components/web/ConferenceInfo.js index 78a6175595..16df141d1b 100644 --- a/react/features/conference/components/web/ConferenceInfo.js +++ b/react/features/conference/components/web/ConferenceInfo.js @@ -8,7 +8,7 @@ import { getParticipantCount } from '../../../base/participants/functions'; import { connect } from '../../../base/redux'; import { E2EELabel } from '../../../e2ee'; import { LocalRecordingLabel } from '../../../local-recording'; -import { RecordingLabel } from '../../../recording'; +import { getSessionStatusToShow, RecordingLabel } from '../../../recording'; import { isToolboxVisible } from '../../../toolbox/functions.web'; import { TranscribingLabel } from '../../../transcribing'; import { VideoQualityLabel } from '../../../video-quality'; @@ -38,6 +38,11 @@ type Props = { */ _hideConferenceTimer: boolean, + /** + * Whether the recording label should be shown or not. + */ + _hideRecordingLabel: boolean, + /** * Whether the participant count should be shown or not. */ @@ -52,7 +57,20 @@ type Props = { /** * Indicates whether the component should be visible or not. */ - _visible: boolean + _visible: boolean, + + /** + * Whether or not the recording label is visible. + */ + _recordingLabel: boolean +}; + +const getLeftMargin = () => { + const subjectContainerWidth = document.getElementById('subject-container')?.clientWidth ?? 0; + const recContainerWidth = document.getElementById('rec-container')?.clientWidth ?? 0; + const subjectDetailsContainer = document.getElementById('subject-details-container')?.clientWidth ?? 0; + + return (subjectContainerWidth - recContainerWidth - subjectDetailsContainer) / 2; }; /** @@ -66,29 +84,46 @@ function ConferenceInfo(props: Props) { _hideConferenceNameAndTimer, _hideConferenceTimer, _showParticipantCount, + _hideRecordingLabel, _subject, _fullWidth, - _visible + _visible, + _recordingLabel } = props; return ( -
-
- { - !_hideConferenceNameAndTimer - &&
- { _subject && { _subject }} - { !_hideConferenceTimer && } -
+
+
+ {!_hideRecordingLabel &&
+ + + +
} - { _showParticipantCount && } - - - - - - - +
+ { + !_hideConferenceNameAndTimer + &&
+ { _subject && { _subject }} + { !_hideConferenceTimer && } +
+ } + { _showParticipantCount && } + + + + +
); @@ -109,16 +144,30 @@ function ConferenceInfo(props: Props) { */ function _mapStateToProps(state) { const participantCount = getParticipantCount(state); - const { hideConferenceTimer, hideConferenceSubject, hideParticipantsStats } = state['features/base/config']; + const { + hideConferenceTimer, + hideConferenceSubject, + hideParticipantsStats, + hideRecordingLabel + } = state['features/base/config']; const { clientWidth } = state['features/base/responsive-ui']; + const fileRecordingStatus = getSessionStatusToShow(state, JitsiRecordingConstants.mode.FILE); + const streamRecordingStatus = getSessionStatusToShow(state, JitsiRecordingConstants.mode.STREAM); + const isFileRecording = fileRecordingStatus ? fileRecordingStatus !== JitsiRecordingConstants.status.OFF : false; + const isStreamRecording = streamRecordingStatus + ? streamRecordingStatus !== JitsiRecordingConstants.status.OFF : false; + const { isEngaged } = state['features/local-recording']; + return { _hideConferenceNameAndTimer: clientWidth < 300, _hideConferenceTimer: Boolean(hideConferenceTimer), + _hideRecordingLabel: hideRecordingLabel, _fullWidth: state['features/video-layout'].tileViewEnabled, _showParticipantCount: participantCount > 2 && !hideParticipantsStats, _subject: hideConferenceSubject ? '' : getConferenceName(state), - _visible: isToolboxVisible(state) + _visible: isToolboxVisible(state), + _recordingLabel: (isFileRecording || isStreamRecording || isEngaged) && !hideRecordingLabel }; }