Просмотр исходного кода

fix(recording-label) Make REC label visible at all times (#9578)

master
robertpin 4 лет назад
Родитель
Сommit
76f8302aeb
Аккаунт пользователя с таким Email не найден

+ 3
- 0
config.js Просмотреть файл

735
     // Hides the conference subject
735
     // Hides the conference subject
736
     // hideConferenceSubject: true,
736
     // hideConferenceSubject: true,
737
 
737
 
738
+    // Hides the recording label
739
+    // hideRecordingLabel: false,
740
+
738
     // Hides the conference timer.
741
     // Hides the conference timer.
739
     // hideConferenceTimer: true,
742
     // hideConferenceTimer: true,
740
 
743
 

+ 24
- 1
css/_subject.scss Просмотреть файл

9
     z-index: $zindex3;
9
     z-index: $zindex3;
10
 
10
 
11
     &.visible {
11
     &.visible {
12
-        top: 0px;
12
+        top: 0;
13
     }
13
     }
14
+
15
+    &.recording {
16
+        top: 0;
17
+
18
+        .subject-details-container {
19
+            opacity: 0;
20
+            transition: opacity .3s ease-in;
21
+        }
22
+
23
+        .subject-info-container .show-always {
24
+            transition: margin-left .3s ease-in;
25
+        }
26
+
27
+        &.visible {
28
+            .subject-details-container {
29
+                opacity: 1;
30
+            }
31
+        }
32
+    }
33
+}
34
+
35
+.subject-details-container {
36
+    display: flex;
14
 }
37
 }
15
 
38
 
16
 .subject-info-container {
39
 .subject-info-container {

+ 1
- 0
react/features/base/config/configWhitelist.js Просмотреть файл

131
     'gatherStats',
131
     'gatherStats',
132
     'googleApiApplicationClientID',
132
     'googleApiApplicationClientID',
133
     'hideConferenceSubject',
133
     'hideConferenceSubject',
134
+    'hideRecordingLabel',
134
     'hideParticipantsStats',
135
     'hideParticipantsStats',
135
     'hideConferenceTimer',
136
     'hideConferenceTimer',
136
     'hiddenDomain',
137
     'hiddenDomain',

+ 70
- 21
react/features/conference/components/web/ConferenceInfo.js Просмотреть файл

8
 import { connect } from '../../../base/redux';
8
 import { connect } from '../../../base/redux';
9
 import { E2EELabel } from '../../../e2ee';
9
 import { E2EELabel } from '../../../e2ee';
10
 import { LocalRecordingLabel } from '../../../local-recording';
10
 import { LocalRecordingLabel } from '../../../local-recording';
11
-import { RecordingLabel } from '../../../recording';
11
+import { getSessionStatusToShow, RecordingLabel } from '../../../recording';
12
 import { isToolboxVisible } from '../../../toolbox/functions.web';
12
 import { isToolboxVisible } from '../../../toolbox/functions.web';
13
 import { TranscribingLabel } from '../../../transcribing';
13
 import { TranscribingLabel } from '../../../transcribing';
14
 import { VideoQualityLabel } from '../../../video-quality';
14
 import { VideoQualityLabel } from '../../../video-quality';
38
      */
38
      */
39
     _hideConferenceTimer: boolean,
39
     _hideConferenceTimer: boolean,
40
 
40
 
41
+    /**
42
+     * Whether the recording label should be shown or not.
43
+     */
44
+    _hideRecordingLabel: boolean,
45
+
41
     /**
46
     /**
42
      * Whether the participant count should be shown or not.
47
      * Whether the participant count should be shown or not.
43
      */
48
      */
52
     /**
57
     /**
53
      * Indicates whether the component should be visible or not.
58
      * Indicates whether the component should be visible or not.
54
      */
59
      */
55
-    _visible: boolean
60
+    _visible: boolean,
61
+
62
+    /**
63
+     * Whether or not the recording label is visible.
64
+     */
65
+    _recordingLabel: boolean
66
+};
67
+
68
+const getLeftMargin = () => {
69
+    const subjectContainerWidth = document.getElementById('subject-container')?.clientWidth ?? 0;
70
+    const recContainerWidth = document.getElementById('rec-container')?.clientWidth ?? 0;
71
+    const subjectDetailsContainer = document.getElementById('subject-details-container')?.clientWidth ?? 0;
72
+
73
+    return (subjectContainerWidth - recContainerWidth - subjectDetailsContainer) / 2;
56
 };
74
 };
57
 
75
 
58
 /**
76
 /**
66
         _hideConferenceNameAndTimer,
84
         _hideConferenceNameAndTimer,
67
         _hideConferenceTimer,
85
         _hideConferenceTimer,
68
         _showParticipantCount,
86
         _showParticipantCount,
87
+        _hideRecordingLabel,
69
         _subject,
88
         _subject,
70
         _fullWidth,
89
         _fullWidth,
71
-        _visible
90
+        _visible,
91
+        _recordingLabel
72
     } = props;
92
     } = props;
73
 
93
 
74
     return (
94
     return (
75
-        <div className = { `subject ${_visible ? 'visible' : ''}` }>
76
-            <div className = { `subject-info-container${_fullWidth ? ' subject-info-container--full-width' : ''}` }>
77
-                {
78
-                    !_hideConferenceNameAndTimer
79
-                        && <div className = 'subject-info'>
80
-                            { _subject && <span className = 'subject-text'>{ _subject }</span>}
81
-                            { !_hideConferenceTimer && <ConferenceTimer /> }
82
-                        </div>
95
+        <div className = { `subject ${_recordingLabel ? 'recording' : ''} ${_visible ? 'visible' : ''}` }>
96
+            <div
97
+                className = { `subject-info-container${_fullWidth ? ' subject-info-container--full-width' : ''}` }
98
+                id = 'subject-container'>
99
+                {!_hideRecordingLabel && <div
100
+                    className = 'show-always'
101
+                    id = 'rec-container'
102
+                    // eslint-disable-next-line react-native/no-inline-styles
103
+                    style = {{
104
+                        marginLeft: !_recordingLabel || _visible ? 0 : getLeftMargin()
105
+                    }}>
106
+                    <RecordingLabel mode = { JitsiRecordingConstants.mode.FILE } />
107
+                    <RecordingLabel mode = { JitsiRecordingConstants.mode.STREAM } />
108
+                    <LocalRecordingLabel />
109
+                </div>
83
                 }
110
                 }
84
-                { _showParticipantCount && <ParticipantsCount /> }
85
-                <E2EELabel />
86
-                <RecordingLabel mode = { JitsiRecordingConstants.mode.FILE } />
87
-                <RecordingLabel mode = { JitsiRecordingConstants.mode.STREAM } />
88
-                <LocalRecordingLabel />
89
-                <TranscribingLabel />
90
-                <VideoQualityLabel />
91
-                <InsecureRoomNameLabel />
111
+                <div
112
+                    className = 'subject-details-container'
113
+                    id = 'subject-details-container'>
114
+                    {
115
+                        !_hideConferenceNameAndTimer
116
+                            && <div className = 'subject-info'>
117
+                                { _subject && <span className = 'subject-text'>{ _subject }</span>}
118
+                                { !_hideConferenceTimer && <ConferenceTimer /> }
119
+                            </div>
120
+                    }
121
+                    { _showParticipantCount && <ParticipantsCount /> }
122
+                    <E2EELabel />
123
+                    <TranscribingLabel />
124
+                    <VideoQualityLabel />
125
+                    <InsecureRoomNameLabel />
126
+                </div>
92
             </div>
127
             </div>
93
         </div>
128
         </div>
94
     );
129
     );
109
  */
144
  */
110
 function _mapStateToProps(state) {
145
 function _mapStateToProps(state) {
111
     const participantCount = getParticipantCount(state);
146
     const participantCount = getParticipantCount(state);
112
-    const { hideConferenceTimer, hideConferenceSubject, hideParticipantsStats } = state['features/base/config'];
147
+    const {
148
+        hideConferenceTimer,
149
+        hideConferenceSubject,
150
+        hideParticipantsStats,
151
+        hideRecordingLabel
152
+    } = state['features/base/config'];
113
     const { clientWidth } = state['features/base/responsive-ui'];
153
     const { clientWidth } = state['features/base/responsive-ui'];
114
 
154
 
155
+    const fileRecordingStatus = getSessionStatusToShow(state, JitsiRecordingConstants.mode.FILE);
156
+    const streamRecordingStatus = getSessionStatusToShow(state, JitsiRecordingConstants.mode.STREAM);
157
+    const isFileRecording = fileRecordingStatus ? fileRecordingStatus !== JitsiRecordingConstants.status.OFF : false;
158
+    const isStreamRecording = streamRecordingStatus
159
+        ? streamRecordingStatus !== JitsiRecordingConstants.status.OFF : false;
160
+    const { isEngaged } = state['features/local-recording'];
161
+
115
     return {
162
     return {
116
         _hideConferenceNameAndTimer: clientWidth < 300,
163
         _hideConferenceNameAndTimer: clientWidth < 300,
117
         _hideConferenceTimer: Boolean(hideConferenceTimer),
164
         _hideConferenceTimer: Boolean(hideConferenceTimer),
165
+        _hideRecordingLabel: hideRecordingLabel,
118
         _fullWidth: state['features/video-layout'].tileViewEnabled,
166
         _fullWidth: state['features/video-layout'].tileViewEnabled,
119
         _showParticipantCount: participantCount > 2 && !hideParticipantsStats,
167
         _showParticipantCount: participantCount > 2 && !hideParticipantsStats,
120
         _subject: hideConferenceSubject ? '' : getConferenceName(state),
168
         _subject: hideConferenceSubject ? '' : getConferenceName(state),
121
-        _visible: isToolboxVisible(state)
169
+        _visible: isToolboxVisible(state),
170
+        _recordingLabel: (isFileRecording || isStreamRecording || isEngaged) && !hideRecordingLabel
122
     };
171
     };
123
 }
172
 }
124
 
173
 

Загрузка…
Отмена
Сохранить