|
|
@@ -1,22 +1,22 @@
|
|
1
|
1
|
/* @flow */
|
|
2
|
2
|
|
|
3
|
|
-import React from 'react';
|
|
|
3
|
+import React, { Component } from 'react';
|
|
4
|
4
|
|
|
5
|
|
-import { getConferenceName } from '../../../base/conference/functions';
|
|
6
|
5
|
import { JitsiRecordingConstants } from '../../../base/lib-jitsi-meet';
|
|
7
|
|
-import { getParticipantCount } from '../../../base/participants/functions';
|
|
8
|
6
|
import { connect } from '../../../base/redux';
|
|
9
|
7
|
import { E2EELabel } from '../../../e2ee';
|
|
10
|
8
|
import { LocalRecordingLabel } from '../../../local-recording';
|
|
11
|
|
-import { getSessionStatusToShow, RecordingLabel } from '../../../recording';
|
|
|
9
|
+import { RecordingLabel } from '../../../recording';
|
|
12
|
10
|
import { isToolboxVisible } from '../../../toolbox/functions.web';
|
|
13
|
11
|
import { TranscribingLabel } from '../../../transcribing';
|
|
14
|
12
|
import { VideoQualityLabel } from '../../../video-quality';
|
|
15
|
13
|
import ConferenceTimer from '../ConferenceTimer';
|
|
|
14
|
+import { getConferenceInfo } from '../functions';
|
|
16
|
15
|
|
|
|
16
|
+import ConferenceInfoContainer from './ConferenceInfoContainer';
|
|
|
17
|
+import InsecureRoomNameLabel from './InsecureRoomNameLabel';
|
|
17
|
18
|
import ParticipantsCount from './ParticipantsCount';
|
|
18
|
|
-
|
|
19
|
|
-import { InsecureRoomNameLabel } from '.';
|
|
|
19
|
+import SubjectText from './SubjectText';
|
|
20
|
20
|
|
|
21
|
21
|
/**
|
|
22
|
22
|
* The type of the React {@code Component} props of {@link Subject}.
|
|
|
@@ -24,116 +24,150 @@ import { InsecureRoomNameLabel } from '.';
|
|
24
|
24
|
type Props = {
|
|
25
|
25
|
|
|
26
|
26
|
/**
|
|
27
|
|
- * Whether the info should span across the full width.
|
|
|
27
|
+ * The conference info labels to be shown in the conference header.
|
|
28
|
28
|
*/
|
|
29
|
|
- _fullWidth: boolean,
|
|
|
29
|
+ _conferenceInfo: Object,
|
|
30
|
30
|
|
|
31
|
31
|
/**
|
|
32
|
|
- * Whether the conference name and timer should be displayed or not.
|
|
|
32
|
+ * Indicates whether the component should be visible or not.
|
|
33
|
33
|
*/
|
|
34
|
|
- _hideConferenceNameAndTimer: boolean,
|
|
|
34
|
+ _visible: boolean
|
|
|
35
|
+};
|
|
35
|
36
|
|
|
36
|
|
- /**
|
|
37
|
|
- * Whether the conference timer should be shown or not.
|
|
38
|
|
- */
|
|
39
|
|
- _hideConferenceTimer: boolean,
|
|
|
37
|
+const COMPONENTS = [
|
|
|
38
|
+ {
|
|
|
39
|
+ Component: SubjectText,
|
|
|
40
|
+ id: 'subject'
|
|
|
41
|
+ },
|
|
|
42
|
+ {
|
|
|
43
|
+ Component: ConferenceTimer,
|
|
|
44
|
+ id: 'conference-timer'
|
|
|
45
|
+ },
|
|
|
46
|
+ {
|
|
|
47
|
+ Component: ParticipantsCount,
|
|
|
48
|
+ id: 'participants-count'
|
|
|
49
|
+ },
|
|
|
50
|
+ {
|
|
|
51
|
+ Component: E2EELabel,
|
|
|
52
|
+ id: 'e2ee'
|
|
|
53
|
+ },
|
|
|
54
|
+ {
|
|
|
55
|
+ Component: () => (
|
|
|
56
|
+ <>
|
|
|
57
|
+ <RecordingLabel mode = { JitsiRecordingConstants.mode.FILE } />
|
|
|
58
|
+ <RecordingLabel mode = { JitsiRecordingConstants.mode.STREAM } />
|
|
|
59
|
+ </>
|
|
|
60
|
+ ),
|
|
|
61
|
+ id: 'recording'
|
|
|
62
|
+ },
|
|
|
63
|
+ {
|
|
|
64
|
+ Component: LocalRecordingLabel,
|
|
|
65
|
+ id: 'local-recording'
|
|
|
66
|
+ },
|
|
|
67
|
+ {
|
|
|
68
|
+ Component: TranscribingLabel,
|
|
|
69
|
+ id: 'transcribing'
|
|
|
70
|
+ },
|
|
|
71
|
+ {
|
|
|
72
|
+ Component: VideoQualityLabel,
|
|
|
73
|
+ id: 'video-quality'
|
|
|
74
|
+ },
|
|
|
75
|
+ {
|
|
|
76
|
+ Component: InsecureRoomNameLabel,
|
|
|
77
|
+ id: 'insecure-room'
|
|
|
78
|
+ }
|
|
|
79
|
+];
|
|
40
|
80
|
|
|
|
81
|
+/**
|
|
|
82
|
+ * The upper band of the meeing containing the conference name, timer and labels.
|
|
|
83
|
+ *
|
|
|
84
|
+ * @param {Object} props - The props of the component.
|
|
|
85
|
+ * @returns {React$None}
|
|
|
86
|
+ */
|
|
|
87
|
+class ConferenceInfo extends Component<Props> {
|
|
41
|
88
|
/**
|
|
42
|
|
- * Whether the recording label should be shown or not.
|
|
|
89
|
+ * Initializes a new {@code ConferenceInfo} instance.
|
|
|
90
|
+ *
|
|
|
91
|
+ * @param {Props} props - The read-only React {@code Component} props with
|
|
|
92
|
+ * which the new instance is to be initialized.
|
|
43
|
93
|
*/
|
|
44
|
|
- _hideRecordingLabel: boolean,
|
|
|
94
|
+ constructor(props: Props) {
|
|
|
95
|
+ super(props);
|
|
45
|
96
|
|
|
46
|
|
- /**
|
|
47
|
|
- * Whether the participant count should be shown or not.
|
|
48
|
|
- */
|
|
49
|
|
- _showParticipantCount: boolean,
|
|
|
97
|
+ this._renderAutoHide = this._renderAutoHide.bind(this);
|
|
|
98
|
+ this._renderAlwaysVisible = this._renderAlwaysVisible.bind(this);
|
|
|
99
|
+ }
|
|
|
100
|
+
|
|
|
101
|
+ _renderAutoHide: () => void;
|
|
50
|
102
|
|
|
51
|
103
|
/**
|
|
52
|
|
- * The subject or the of the conference.
|
|
53
|
|
- * Falls back to conference name.
|
|
|
104
|
+ * Renders auto-hidden info header labels.
|
|
|
105
|
+ *
|
|
|
106
|
+ * @returns {void}
|
|
54
|
107
|
*/
|
|
55
|
|
- _subject: string,
|
|
|
108
|
+ _renderAutoHide() {
|
|
|
109
|
+ const { autoHide } = this.props._conferenceInfo;
|
|
|
110
|
+
|
|
|
111
|
+ if (!autoHide || !autoHide.length) {
|
|
|
112
|
+ return null;
|
|
|
113
|
+ }
|
|
|
114
|
+
|
|
|
115
|
+ return (
|
|
|
116
|
+ <ConferenceInfoContainer visible = { this.props._visible } >
|
|
|
117
|
+ {
|
|
|
118
|
+ COMPONENTS
|
|
|
119
|
+ .filter(comp => autoHide.includes(comp.id))
|
|
|
120
|
+ .map(c =>
|
|
|
121
|
+ <c.Component key = { c.id } />
|
|
|
122
|
+ )
|
|
|
123
|
+ }
|
|
|
124
|
+ </ConferenceInfoContainer>
|
|
|
125
|
+ );
|
|
|
126
|
+ }
|
|
|
127
|
+
|
|
|
128
|
+ _renderAlwaysVisible: () => void;
|
|
56
|
129
|
|
|
57
|
130
|
/**
|
|
58
|
|
- * Indicates whether the component should be visible or not.
|
|
|
131
|
+ * Renders the always visible info header labels.
|
|
|
132
|
+ *
|
|
|
133
|
+ * @returns {void}
|
|
59
|
134
|
*/
|
|
60
|
|
- _visible: boolean,
|
|
|
135
|
+ _renderAlwaysVisible() {
|
|
|
136
|
+ const { alwaysVisible } = this.props._conferenceInfo;
|
|
|
137
|
+
|
|
|
138
|
+ if (!alwaysVisible || !alwaysVisible.length) {
|
|
|
139
|
+ return null;
|
|
|
140
|
+ }
|
|
|
141
|
+
|
|
|
142
|
+ return (
|
|
|
143
|
+ <ConferenceInfoContainer visible = { true } >
|
|
|
144
|
+ {
|
|
|
145
|
+ COMPONENTS
|
|
|
146
|
+ .filter(comp => alwaysVisible.includes(comp.id))
|
|
|
147
|
+ .map(c =>
|
|
|
148
|
+ <c.Component key = { c.id } />
|
|
|
149
|
+ )
|
|
|
150
|
+ }
|
|
|
151
|
+ </ConferenceInfoContainer>
|
|
|
152
|
+ );
|
|
|
153
|
+ }
|
|
61
|
154
|
|
|
62
|
155
|
/**
|
|
63
|
|
- * Whether or not the recording label is visible.
|
|
|
156
|
+ * Implements React's {@link Component#render()}.
|
|
|
157
|
+ *
|
|
|
158
|
+ * @inheritdoc
|
|
|
159
|
+ * @returns {ReactElement}
|
|
64
|
160
|
*/
|
|
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;
|
|
74
|
|
-};
|
|
75
|
|
-
|
|
76
|
|
-/**
|
|
77
|
|
- * The upper band of the meeing containing the conference name, timer and labels.
|
|
78
|
|
- *
|
|
79
|
|
- * @param {Object} props - The props of the component.
|
|
80
|
|
- * @returns {React$None}
|
|
81
|
|
- */
|
|
82
|
|
-function ConferenceInfo(props: Props) {
|
|
83
|
|
- const {
|
|
84
|
|
- _hideConferenceNameAndTimer,
|
|
85
|
|
- _hideConferenceTimer,
|
|
86
|
|
- _showParticipantCount,
|
|
87
|
|
- _hideRecordingLabel,
|
|
88
|
|
- _subject,
|
|
89
|
|
- _fullWidth,
|
|
90
|
|
- _visible,
|
|
91
|
|
- _recordingLabel
|
|
92
|
|
- } = props;
|
|
93
|
|
-
|
|
94
|
|
- return (
|
|
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>
|
|
110
|
|
- }
|
|
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
|
|
- {_hideRecordingLabel && (
|
|
124
|
|
- <>
|
|
125
|
|
- <RecordingLabel mode = { JitsiRecordingConstants.mode.FILE } />
|
|
126
|
|
- <RecordingLabel mode = { JitsiRecordingConstants.mode.STREAM } />
|
|
127
|
|
- <LocalRecordingLabel />
|
|
128
|
|
- </>
|
|
129
|
|
- )}
|
|
130
|
|
- <TranscribingLabel />
|
|
131
|
|
- <VideoQualityLabel />
|
|
132
|
|
- <InsecureRoomNameLabel />
|
|
133
|
|
- </div>
|
|
|
161
|
+ render() {
|
|
|
162
|
+ return (
|
|
|
163
|
+ <div className = 'details-container' >
|
|
|
164
|
+ { [
|
|
|
165
|
+ this._renderAlwaysVisible(),
|
|
|
166
|
+ this._renderAutoHide()
|
|
|
167
|
+ ] }
|
|
134
|
168
|
</div>
|
|
135
|
|
- </div>
|
|
136
|
|
- );
|
|
|
169
|
+ );
|
|
|
170
|
+ }
|
|
137
|
171
|
}
|
|
138
|
172
|
|
|
139
|
173
|
/**
|
|
|
@@ -143,40 +177,14 @@ function ConferenceInfo(props: Props) {
|
|
143
|
177
|
* @param {Object} state - The Redux state.
|
|
144
|
178
|
* @private
|
|
145
|
179
|
* @returns {{
|
|
146
|
|
- * _hideConferenceTimer: boolean,
|
|
147
|
|
- * _showParticipantCount: boolean,
|
|
148
|
|
- * _subject: string,
|
|
149
|
|
- * _visible: boolean
|
|
|
180
|
+ * _visible: boolean,
|
|
|
181
|
+ * _conferenceInfo: Object
|
|
150
|
182
|
* }}
|
|
151
|
183
|
*/
|
|
152
|
184
|
function _mapStateToProps(state) {
|
|
153
|
|
- const participantCount = getParticipantCount(state);
|
|
154
|
|
- const {
|
|
155
|
|
- hideConferenceTimer,
|
|
156
|
|
- hideConferenceSubject,
|
|
157
|
|
- hideParticipantsStats,
|
|
158
|
|
- hideRecordingLabel,
|
|
159
|
|
- iAmRecorder
|
|
160
|
|
- } = state['features/base/config'];
|
|
161
|
|
- const { clientWidth } = state['features/base/responsive-ui'];
|
|
162
|
|
-
|
|
163
|
|
- const shouldHideRecordingLabel = hideRecordingLabel || iAmRecorder;
|
|
164
|
|
- const fileRecordingStatus = getSessionStatusToShow(state, JitsiRecordingConstants.mode.FILE);
|
|
165
|
|
- const streamRecordingStatus = getSessionStatusToShow(state, JitsiRecordingConstants.mode.STREAM);
|
|
166
|
|
- const isFileRecording = fileRecordingStatus ? fileRecordingStatus !== JitsiRecordingConstants.status.OFF : false;
|
|
167
|
|
- const isStreamRecording = streamRecordingStatus
|
|
168
|
|
- ? streamRecordingStatus !== JitsiRecordingConstants.status.OFF : false;
|
|
169
|
|
- const { isEngaged } = state['features/local-recording'];
|
|
170
|
|
-
|
|
171
|
185
|
return {
|
|
172
|
|
- _hideConferenceNameAndTimer: clientWidth < 300,
|
|
173
|
|
- _hideConferenceTimer: Boolean(hideConferenceTimer),
|
|
174
|
|
- _hideRecordingLabel: shouldHideRecordingLabel,
|
|
175
|
|
- _fullWidth: state['features/video-layout'].tileViewEnabled,
|
|
176
|
|
- _showParticipantCount: participantCount > 2 && !hideParticipantsStats,
|
|
177
|
|
- _subject: hideConferenceSubject ? '' : getConferenceName(state),
|
|
178
|
186
|
_visible: isToolboxVisible(state),
|
|
179
|
|
- _recordingLabel: (isFileRecording || isStreamRecording || isEngaged) && !shouldHideRecordingLabel
|
|
|
187
|
+ _conferenceInfo: getConferenceInfo(state)
|
|
180
|
188
|
};
|
|
181
|
189
|
}
|
|
182
|
190
|
|