feat(conference-info-header) Make conference info header configurable. (#9638)
This commit is contained in:
parent
6a6146727f
commit
5514be630d
23
config.js
23
config.js
|
@ -904,15 +904,32 @@ var config = {
|
||||||
// If true, tile view will not be enabled automatically when the participants count threshold is reached.
|
// If true, tile view will not be enabled automatically when the participants count threshold is reached.
|
||||||
// disableTileView: true,
|
// disableTileView: true,
|
||||||
|
|
||||||
|
// Controls the visibility and behavior of the top header conference info labels.
|
||||||
|
// If a label's id is not in any of the 2 arrays, it will not be visible at all on the header.
|
||||||
|
// conferenceInfo: {
|
||||||
|
// // those labels will not be hidden in tandem with the toolbox.
|
||||||
|
// alwaysVisible: ['recording', 'local-recording'],
|
||||||
|
// // those labels will be auto-hidden in tandem with the toolbox buttons.
|
||||||
|
// autoHide: [
|
||||||
|
// 'subject',
|
||||||
|
// 'conference-timer',
|
||||||
|
// 'participants-count',
|
||||||
|
// 'e2ee',
|
||||||
|
// 'transcribing',
|
||||||
|
// 'video-quality',
|
||||||
|
// 'insecure-room'
|
||||||
|
// ]
|
||||||
|
// },
|
||||||
|
|
||||||
// Hides the conference subject
|
// Hides the conference subject
|
||||||
// hideConferenceSubject: true,
|
// hideConferenceSubject: true,
|
||||||
|
|
||||||
// Hides the recording label
|
|
||||||
// hideRecordingLabel: false,
|
|
||||||
|
|
||||||
// Hides the conference timer.
|
// Hides the conference timer.
|
||||||
// hideConferenceTimer: true,
|
// hideConferenceTimer: true,
|
||||||
|
|
||||||
|
// Hides the recording label
|
||||||
|
// hideRecordingLabel: false,
|
||||||
|
|
||||||
// Hides the participants stats
|
// Hides the participants stats
|
||||||
// hideParticipantsStats: true,
|
// hideParticipantsStats: true,
|
||||||
|
|
||||||
|
|
|
@ -1,54 +1,22 @@
|
||||||
.subject {
|
.subject {
|
||||||
box-sizing: border-box;
|
|
||||||
color: #fff;
|
color: #fff;
|
||||||
margin-top: 20px;
|
margin-top: -120px;
|
||||||
position: absolute;
|
transition: margin-top .3s ease-in;
|
||||||
top: -120px;
|
|
||||||
transition: top .3s ease-in;
|
|
||||||
width: 100%;
|
|
||||||
z-index: $zindex3;
|
z-index: $zindex3;
|
||||||
|
|
||||||
&.visible {
|
&.visible {
|
||||||
top: 0;
|
margin-top: 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
&.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 {
|
.subject-info-container {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
max-width: calc(100% - 280px);
|
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
|
height: 28px;
|
||||||
&--full-width {
|
|
||||||
max-width: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
@media (max-width: 500px) {
|
@media (max-width: 500px) {
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
max-width: 100%;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -63,21 +31,47 @@
|
||||||
.subject-text {
|
.subject-text {
|
||||||
background: rgba(0, 0, 0, 0.6);
|
background: rgba(0, 0, 0, 0.6);
|
||||||
border-radius: 3px 0px 0px 3px;
|
border-radius: 3px 0px 0px 3px;
|
||||||
|
box-sizing: border-box;
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
line-height: 24px;
|
line-height: 28px;
|
||||||
padding: 2px 16px;
|
padding: 0 16px;
|
||||||
height: 24px;
|
height: 28px;
|
||||||
|
|
||||||
|
@media (max-width: 700px) {
|
||||||
|
max-width: 100px;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (max-width: 300px) {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
&--content {
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.subject-timer {
|
.subject-timer {
|
||||||
background: rgba(0, 0, 0, 0.8);
|
background: rgba(0, 0, 0, 0.8);
|
||||||
border-radius: 0px 3px 3px 0px;
|
border-radius: 0px 3px 3px 0px;
|
||||||
display: inline-block;
|
box-sizing: border-box;
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
line-height: 16px;
|
line-height: 28px;
|
||||||
min-width: 34px;
|
min-width: 34px;
|
||||||
padding: 6px 8px;
|
padding: 0 8px;
|
||||||
|
height: 28px;
|
||||||
|
|
||||||
|
@media (max-width: 300px) {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.details-container {
|
||||||
|
width: 100%;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
height: 48px;
|
||||||
}
|
}
|
||||||
|
|
|
@ -70,6 +70,7 @@ export default [
|
||||||
*/
|
*/
|
||||||
'callUUID',
|
'callUUID',
|
||||||
|
|
||||||
|
'conferenceInfo',
|
||||||
'channelLastN',
|
'channelLastN',
|
||||||
'connectionIndicators',
|
'connectionIndicators',
|
||||||
'constraints',
|
'constraints',
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
import _ from 'lodash';
|
import _ from 'lodash';
|
||||||
|
|
||||||
|
import { CONFERENCE_INFO } from '../../conference/components/constants';
|
||||||
import { equals, ReducerRegistry } from '../redux';
|
import { equals, ReducerRegistry } from '../redux';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
|
@ -56,6 +57,17 @@ const INITIAL_RN_STATE = {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Mapping between old configs controlling the conference info headers visibility and the
|
||||||
|
* new configs. Needed in order to keep backwards compatibility.
|
||||||
|
*/
|
||||||
|
const CONFERENCE_HEADER_MAPPING = {
|
||||||
|
hideConferenceTimer: [ 'conference-timer' ],
|
||||||
|
hideConferenceSubject: [ 'subject' ],
|
||||||
|
hideParticipantsStats: [ 'participants-count' ],
|
||||||
|
hideRecordingLabel: [ 'recording', 'local-recording' ]
|
||||||
|
};
|
||||||
|
|
||||||
ReducerRegistry.register('features/base/config', (state = _getInitialState(), action) => {
|
ReducerRegistry.register('features/base/config', (state = _getInitialState(), action) => {
|
||||||
switch (action.type) {
|
switch (action.type) {
|
||||||
case UPDATE_CONFIG:
|
case UPDATE_CONFIG:
|
||||||
|
@ -172,6 +184,27 @@ function _setConfig(state, { config }) {
|
||||||
return equals(state, newState) ? state : newState;
|
return equals(state, newState) ? state : newState;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Processes the conferenceInfo object against the defaults.
|
||||||
|
*
|
||||||
|
* @param {Object} config - The old config.
|
||||||
|
* @returns {Object} The processed conferenceInfo object.
|
||||||
|
*/
|
||||||
|
function _getConferenceInfo(config) {
|
||||||
|
const { conferenceInfo } = config;
|
||||||
|
|
||||||
|
if (conferenceInfo) {
|
||||||
|
return {
|
||||||
|
alwaysVisible: conferenceInfo.alwaysVisible ?? [ ...CONFERENCE_INFO.alwaysVisible ],
|
||||||
|
autoHide: conferenceInfo.autoHide ?? [ ...CONFERENCE_INFO.autoHide ]
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
...CONFERENCE_INFO
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructs a new config {@code Object}, if necessary, out of a specific
|
* Constructs a new config {@code Object}, if necessary, out of a specific
|
||||||
* config {@code Object} which is in the latest format supported by jitsi-meet.
|
* config {@code Object} which is in the latest format supported by jitsi-meet.
|
||||||
|
@ -194,6 +227,27 @@ function _translateLegacyConfig(oldValue: Object) {
|
||||||
newValue.toolbarButtons = interfaceConfig.TOOLBAR_BUTTONS;
|
newValue.toolbarButtons = interfaceConfig.TOOLBAR_BUTTONS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const filteredConferenceInfo = Object.keys(CONFERENCE_HEADER_MAPPING).filter(key => oldValue[key]);
|
||||||
|
|
||||||
|
if (filteredConferenceInfo.length) {
|
||||||
|
newValue.conferenceInfo = _getConferenceInfo(oldValue);
|
||||||
|
|
||||||
|
filteredConferenceInfo.forEach(key => {
|
||||||
|
// hideRecordingLabel does not mean not render it at all, but autoHide it
|
||||||
|
if (key === 'hideRecordingLabel') {
|
||||||
|
newValue.conferenceInfo.alwaysVisible
|
||||||
|
= newValue.conferenceInfo.alwaysVisible.filter(c => !CONFERENCE_HEADER_MAPPING[key].includes(c));
|
||||||
|
newValue.conferenceInfo.autoHide
|
||||||
|
= _.union(newValue.conferenceInfo.autoHide, CONFERENCE_HEADER_MAPPING[key]);
|
||||||
|
} else {
|
||||||
|
newValue.conferenceInfo.alwaysVisible
|
||||||
|
= newValue.conferenceInfo.alwaysVisible.filter(c => !CONFERENCE_HEADER_MAPPING[key].includes(c));
|
||||||
|
newValue.conferenceInfo.autoHide
|
||||||
|
= newValue.conferenceInfo.autoHide.filter(c => !CONFERENCE_HEADER_MAPPING[key].includes(c));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
if (!oldValue.connectionIndicators
|
if (!oldValue.connectionIndicators
|
||||||
&& typeof interfaceConfig === 'object'
|
&& typeof interfaceConfig === 'object'
|
||||||
&& (interfaceConfig.hasOwnProperty('CONNECTION_INDICATOR_DISABLED')
|
&& (interfaceConfig.hasOwnProperty('CONNECTION_INDICATOR_DISABLED')
|
||||||
|
|
|
@ -0,0 +1,12 @@
|
||||||
|
export const CONFERENCE_INFO = {
|
||||||
|
alwaysVisible: [ 'recording', 'local-recording' ],
|
||||||
|
autoHide: [
|
||||||
|
'subject',
|
||||||
|
'conference-timer',
|
||||||
|
'participants-count',
|
||||||
|
'e2ee',
|
||||||
|
'transcribing',
|
||||||
|
'video-quality',
|
||||||
|
'insecure-room'
|
||||||
|
]
|
||||||
|
};
|
|
@ -0,0 +1,22 @@
|
||||||
|
// @flow
|
||||||
|
|
||||||
|
import { CONFERENCE_INFO } from './constants';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Retrieves the conference info labels based on config values and defaults.
|
||||||
|
*
|
||||||
|
* @param {Object} state - The redux state.
|
||||||
|
* @returns {Object} The conferenceInfo object.
|
||||||
|
*/
|
||||||
|
export const getConferenceInfo = (state: Object) => {
|
||||||
|
const { conferenceInfo } = state['features/base/config'];
|
||||||
|
|
||||||
|
if (conferenceInfo) {
|
||||||
|
return {
|
||||||
|
alwaysVisible: conferenceInfo.alwaysVisible ?? CONFERENCE_INFO.alwaysVisible,
|
||||||
|
autoHide: conferenceInfo.autoHide ?? CONFERENCE_INFO.autoHide
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
return CONFERENCE_INFO;
|
||||||
|
};
|
|
@ -1,22 +1,22 @@
|
||||||
/* @flow */
|
/* @flow */
|
||||||
|
|
||||||
import React from 'react';
|
import React, { Component } from 'react';
|
||||||
|
|
||||||
import { getConferenceName } from '../../../base/conference/functions';
|
|
||||||
import { JitsiRecordingConstants } from '../../../base/lib-jitsi-meet';
|
import { JitsiRecordingConstants } from '../../../base/lib-jitsi-meet';
|
||||||
import { getParticipantCount } from '../../../base/participants/functions';
|
|
||||||
import { connect } from '../../../base/redux';
|
import { connect } from '../../../base/redux';
|
||||||
import { E2EELabel } from '../../../e2ee';
|
import { E2EELabel } from '../../../e2ee';
|
||||||
import { LocalRecordingLabel } from '../../../local-recording';
|
import { LocalRecordingLabel } from '../../../local-recording';
|
||||||
import { getSessionStatusToShow, RecordingLabel } from '../../../recording';
|
import { RecordingLabel } from '../../../recording';
|
||||||
import { isToolboxVisible } from '../../../toolbox/functions.web';
|
import { isToolboxVisible } from '../../../toolbox/functions.web';
|
||||||
import { TranscribingLabel } from '../../../transcribing';
|
import { TranscribingLabel } from '../../../transcribing';
|
||||||
import { VideoQualityLabel } from '../../../video-quality';
|
import { VideoQualityLabel } from '../../../video-quality';
|
||||||
import ConferenceTimer from '../ConferenceTimer';
|
import ConferenceTimer from '../ConferenceTimer';
|
||||||
|
import { getConferenceInfo } from '../functions';
|
||||||
|
|
||||||
|
import ConferenceInfoContainer from './ConferenceInfoContainer';
|
||||||
|
import InsecureRoomNameLabel from './InsecureRoomNameLabel';
|
||||||
import ParticipantsCount from './ParticipantsCount';
|
import ParticipantsCount from './ParticipantsCount';
|
||||||
|
import SubjectText from './SubjectText';
|
||||||
import { InsecureRoomNameLabel } from '.';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The type of the React {@code Component} props of {@link Subject}.
|
* The type of the React {@code Component} props of {@link Subject}.
|
||||||
|
@ -24,54 +24,59 @@ import { InsecureRoomNameLabel } from '.';
|
||||||
type Props = {
|
type Props = {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Whether the info should span across the full width.
|
* The conference info labels to be shown in the conference header.
|
||||||
*/
|
*/
|
||||||
_fullWidth: boolean,
|
_conferenceInfo: Object,
|
||||||
|
|
||||||
/**
|
|
||||||
* Whether the conference name and timer should be displayed or not.
|
|
||||||
*/
|
|
||||||
_hideConferenceNameAndTimer: boolean,
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Whether the conference timer should be shown or not.
|
|
||||||
*/
|
|
||||||
_hideConferenceTimer: boolean,
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Whether the recording label should be shown or not.
|
|
||||||
*/
|
|
||||||
_hideRecordingLabel: boolean,
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Whether the participant count should be shown or not.
|
|
||||||
*/
|
|
||||||
_showParticipantCount: boolean,
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The subject or the of the conference.
|
|
||||||
* Falls back to conference name.
|
|
||||||
*/
|
|
||||||
_subject: string,
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Indicates whether the component should be visible or not.
|
* 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 COMPONENTS = [
|
||||||
const subjectContainerWidth = document.getElementById('subject-container')?.clientWidth ?? 0;
|
{
|
||||||
const recContainerWidth = document.getElementById('rec-container')?.clientWidth ?? 0;
|
Component: SubjectText,
|
||||||
const subjectDetailsContainer = document.getElementById('subject-details-container')?.clientWidth ?? 0;
|
id: 'subject'
|
||||||
|
},
|
||||||
return (subjectContainerWidth - recContainerWidth - subjectDetailsContainer) / 2;
|
{
|
||||||
};
|
Component: ConferenceTimer,
|
||||||
|
id: 'conference-timer'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
Component: ParticipantsCount,
|
||||||
|
id: 'participants-count'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
Component: E2EELabel,
|
||||||
|
id: 'e2ee'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
Component: () => (
|
||||||
|
<>
|
||||||
|
<RecordingLabel mode = { JitsiRecordingConstants.mode.FILE } />
|
||||||
|
<RecordingLabel mode = { JitsiRecordingConstants.mode.STREAM } />
|
||||||
|
</>
|
||||||
|
),
|
||||||
|
id: 'recording'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
Component: LocalRecordingLabel,
|
||||||
|
id: 'local-recording'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
Component: TranscribingLabel,
|
||||||
|
id: 'transcribing'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
Component: VideoQualityLabel,
|
||||||
|
id: 'video-quality'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
Component: InsecureRoomNameLabel,
|
||||||
|
id: 'insecure-room'
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The upper band of the meeing containing the conference name, timer and labels.
|
* The upper band of the meeing containing the conference name, timer and labels.
|
||||||
|
@ -79,61 +84,90 @@ const getLeftMargin = () => {
|
||||||
* @param {Object} props - The props of the component.
|
* @param {Object} props - The props of the component.
|
||||||
* @returns {React$None}
|
* @returns {React$None}
|
||||||
*/
|
*/
|
||||||
function ConferenceInfo(props: Props) {
|
class ConferenceInfo extends Component<Props> {
|
||||||
const {
|
/**
|
||||||
_hideConferenceNameAndTimer,
|
* Initializes a new {@code ConferenceInfo} instance.
|
||||||
_hideConferenceTimer,
|
*
|
||||||
_showParticipantCount,
|
* @param {Props} props - The read-only React {@code Component} props with
|
||||||
_hideRecordingLabel,
|
* which the new instance is to be initialized.
|
||||||
_subject,
|
*/
|
||||||
_fullWidth,
|
constructor(props: Props) {
|
||||||
_visible,
|
super(props);
|
||||||
_recordingLabel
|
|
||||||
} = props;
|
this._renderAutoHide = this._renderAutoHide.bind(this);
|
||||||
|
this._renderAlwaysVisible = this._renderAlwaysVisible.bind(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
_renderAutoHide: () => void;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Renders auto-hidden info header labels.
|
||||||
|
*
|
||||||
|
* @returns {void}
|
||||||
|
*/
|
||||||
|
_renderAutoHide() {
|
||||||
|
const { autoHide } = this.props._conferenceInfo;
|
||||||
|
|
||||||
|
if (!autoHide || !autoHide.length) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className = { `subject ${_recordingLabel ? 'recording' : ''} ${_visible ? 'visible' : ''}` }>
|
<ConferenceInfoContainer visible = { this.props._visible } >
|
||||||
<div
|
|
||||||
className = { `subject-info-container${_fullWidth ? ' subject-info-container--full-width' : ''}` }
|
|
||||||
id = 'subject-container'>
|
|
||||||
{!_hideRecordingLabel && <div
|
|
||||||
className = 'show-always'
|
|
||||||
id = 'rec-container'
|
|
||||||
// eslint-disable-next-line react-native/no-inline-styles
|
|
||||||
style = {{
|
|
||||||
marginLeft: !_recordingLabel || _visible ? 0 : getLeftMargin()
|
|
||||||
}}>
|
|
||||||
<RecordingLabel mode = { JitsiRecordingConstants.mode.FILE } />
|
|
||||||
<RecordingLabel mode = { JitsiRecordingConstants.mode.STREAM } />
|
|
||||||
<LocalRecordingLabel />
|
|
||||||
</div>
|
|
||||||
}
|
|
||||||
<div
|
|
||||||
className = 'subject-details-container'
|
|
||||||
id = 'subject-details-container'>
|
|
||||||
{
|
{
|
||||||
!_hideConferenceNameAndTimer
|
COMPONENTS
|
||||||
&& <div className = 'subject-info'>
|
.filter(comp => autoHide.includes(comp.id))
|
||||||
{ _subject && <span className = 'subject-text'>{ _subject }</span>}
|
.map(c =>
|
||||||
{ !_hideConferenceTimer && <ConferenceTimer /> }
|
<c.Component key = { c.id } />
|
||||||
</div>
|
)
|
||||||
}
|
}
|
||||||
{ _showParticipantCount && <ParticipantsCount /> }
|
</ConferenceInfoContainer>
|
||||||
<E2EELabel />
|
);
|
||||||
{_hideRecordingLabel && (
|
}
|
||||||
<>
|
|
||||||
<RecordingLabel mode = { JitsiRecordingConstants.mode.FILE } />
|
_renderAlwaysVisible: () => void;
|
||||||
<RecordingLabel mode = { JitsiRecordingConstants.mode.STREAM } />
|
|
||||||
<LocalRecordingLabel />
|
/**
|
||||||
</>
|
* Renders the always visible info header labels.
|
||||||
)}
|
*
|
||||||
<TranscribingLabel />
|
* @returns {void}
|
||||||
<VideoQualityLabel />
|
*/
|
||||||
<InsecureRoomNameLabel />
|
_renderAlwaysVisible() {
|
||||||
</div>
|
const { alwaysVisible } = this.props._conferenceInfo;
|
||||||
</div>
|
|
||||||
|
if (!alwaysVisible || !alwaysVisible.length) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
<ConferenceInfoContainer visible = { true } >
|
||||||
|
{
|
||||||
|
COMPONENTS
|
||||||
|
.filter(comp => alwaysVisible.includes(comp.id))
|
||||||
|
.map(c =>
|
||||||
|
<c.Component key = { c.id } />
|
||||||
|
)
|
||||||
|
}
|
||||||
|
</ConferenceInfoContainer>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Implements React's {@link Component#render()}.
|
||||||
|
*
|
||||||
|
* @inheritdoc
|
||||||
|
* @returns {ReactElement}
|
||||||
|
*/
|
||||||
|
render() {
|
||||||
|
return (
|
||||||
|
<div className = 'details-container' >
|
||||||
|
{ [
|
||||||
|
this._renderAlwaysVisible(),
|
||||||
|
this._renderAutoHide()
|
||||||
|
] }
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -143,40 +177,14 @@ function ConferenceInfo(props: Props) {
|
||||||
* @param {Object} state - The Redux state.
|
* @param {Object} state - The Redux state.
|
||||||
* @private
|
* @private
|
||||||
* @returns {{
|
* @returns {{
|
||||||
* _hideConferenceTimer: boolean,
|
* _visible: boolean,
|
||||||
* _showParticipantCount: boolean,
|
* _conferenceInfo: Object
|
||||||
* _subject: string,
|
|
||||||
* _visible: boolean
|
|
||||||
* }}
|
* }}
|
||||||
*/
|
*/
|
||||||
function _mapStateToProps(state) {
|
function _mapStateToProps(state) {
|
||||||
const participantCount = getParticipantCount(state);
|
|
||||||
const {
|
|
||||||
hideConferenceTimer,
|
|
||||||
hideConferenceSubject,
|
|
||||||
hideParticipantsStats,
|
|
||||||
hideRecordingLabel,
|
|
||||||
iAmRecorder
|
|
||||||
} = state['features/base/config'];
|
|
||||||
const { clientWidth } = state['features/base/responsive-ui'];
|
|
||||||
|
|
||||||
const shouldHideRecordingLabel = hideRecordingLabel || iAmRecorder;
|
|
||||||
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 {
|
return {
|
||||||
_hideConferenceNameAndTimer: clientWidth < 300,
|
|
||||||
_hideConferenceTimer: Boolean(hideConferenceTimer),
|
|
||||||
_hideRecordingLabel: shouldHideRecordingLabel,
|
|
||||||
_fullWidth: state['features/video-layout'].tileViewEnabled,
|
|
||||||
_showParticipantCount: participantCount > 2 && !hideParticipantsStats,
|
|
||||||
_subject: hideConferenceSubject ? '' : getConferenceName(state),
|
|
||||||
_visible: isToolboxVisible(state),
|
_visible: isToolboxVisible(state),
|
||||||
_recordingLabel: (isFileRecording || isStreamRecording || isEngaged) && !shouldHideRecordingLabel
|
_conferenceInfo: getConferenceInfo(state)
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,24 @@
|
||||||
|
/* @flow */
|
||||||
|
|
||||||
|
import React from 'react';
|
||||||
|
|
||||||
|
type Props = {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The children components.
|
||||||
|
*/
|
||||||
|
children: React$Node,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Whether this conference info container should be visible or not.
|
||||||
|
*/
|
||||||
|
visible: boolean
|
||||||
|
}
|
||||||
|
|
||||||
|
export default ({ visible, children }: Props) => (
|
||||||
|
<div className = { `subject${visible ? ' visible' : ''}` }>
|
||||||
|
<div className = { 'subject-info-container' }>
|
||||||
|
{children}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
|
@ -19,7 +19,7 @@ type Props = {
|
||||||
/**
|
/**
|
||||||
* Number of the conference participants.
|
* Number of the conference participants.
|
||||||
*/
|
*/
|
||||||
count: string,
|
count: number,
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Conference data.
|
* Conference data.
|
||||||
|
@ -72,6 +72,12 @@ class ParticipantsCount extends PureComponent<Props> {
|
||||||
* @returns {ReactElement}
|
* @returns {ReactElement}
|
||||||
*/
|
*/
|
||||||
render() {
|
render() {
|
||||||
|
const { count } = this.props;
|
||||||
|
|
||||||
|
if (count <= 2) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
className = 'participants-count'
|
className = 'participants-count'
|
||||||
|
@ -79,7 +85,7 @@ class ParticipantsCount extends PureComponent<Props> {
|
||||||
<Label
|
<Label
|
||||||
className = 'label--white'
|
className = 'label--white'
|
||||||
icon = { IconUserGroups }
|
icon = { IconUserGroups }
|
||||||
text = { this.props.count } />
|
text = { count } />
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,50 @@
|
||||||
|
/* @flow */
|
||||||
|
|
||||||
|
import React from 'react';
|
||||||
|
|
||||||
|
import { getConferenceName } from '../../../base/conference/functions';
|
||||||
|
import { connect } from '../../../base/redux';
|
||||||
|
import { Tooltip } from '../../../base/tooltip';
|
||||||
|
|
||||||
|
type Props = {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The conference display name.
|
||||||
|
*/
|
||||||
|
_subject: string
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Label for the conference name.
|
||||||
|
*
|
||||||
|
* @param {Props} props - The props of the component.
|
||||||
|
* @returns {ReactElement}
|
||||||
|
*/
|
||||||
|
const SubjectText = ({ _subject }: Props) => (
|
||||||
|
<div className = 'subject-text'>
|
||||||
|
<Tooltip
|
||||||
|
content = { _subject }
|
||||||
|
position = 'bottom'>
|
||||||
|
<div className = 'subject-text--content'>{ _subject }</div>
|
||||||
|
</Tooltip>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Maps (parts of) the Redux state to the associated
|
||||||
|
* {@code Subject}'s props.
|
||||||
|
*
|
||||||
|
* @param {Object} state - The Redux state.
|
||||||
|
* @private
|
||||||
|
* @returns {{
|
||||||
|
* _subject: string,
|
||||||
|
* }}
|
||||||
|
*/
|
||||||
|
function _mapStateToProps(state) {
|
||||||
|
return {
|
||||||
|
_subject: getConferenceName(state)
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
export default connect(_mapStateToProps)(SubjectText);
|
|
@ -5,3 +5,4 @@ export { default as renderConferenceTimer } from './ConferenceTimerDisplay';
|
||||||
export { default as InsecureRoomNameLabel } from './InsecureRoomNameLabel';
|
export { default as InsecureRoomNameLabel } from './InsecureRoomNameLabel';
|
||||||
export { default as InviteMore } from './InviteMore';
|
export { default as InviteMore } from './InviteMore';
|
||||||
export { default as ConferenceInfo } from './ConferenceInfo';
|
export { default as ConferenceInfo } from './ConferenceInfo';
|
||||||
|
export { default as SubjectText } from './SubjectText';
|
||||||
|
|
|
@ -14,14 +14,19 @@ import { Tooltip } from '../../base/tooltip';
|
||||||
type Props = {
|
type Props = {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Invoked to obtain translated strings.
|
* Whether this is the Jibri recorder participant.
|
||||||
*/
|
*/
|
||||||
t: Function,
|
_iAmRecorder: boolean,
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Whether local recording is engaged or not.
|
* Whether local recording is engaged or not.
|
||||||
*/
|
*/
|
||||||
isEngaged: boolean
|
_isEngaged: boolean,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Invoked to obtain translated strings.
|
||||||
|
*/
|
||||||
|
t: Function,
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -38,7 +43,7 @@ class LocalRecordingLabel extends Component<Props> {
|
||||||
* @returns {ReactElement}
|
* @returns {ReactElement}
|
||||||
*/
|
*/
|
||||||
render() {
|
render() {
|
||||||
if (!this.props.isEngaged) {
|
if (!this.props._isEngaged || this.props._iAmRecorder) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -66,9 +71,11 @@ class LocalRecordingLabel extends Component<Props> {
|
||||||
*/
|
*/
|
||||||
function _mapStateToProps(state) {
|
function _mapStateToProps(state) {
|
||||||
const { isEngaged } = state['features/local-recording'];
|
const { isEngaged } = state['features/local-recording'];
|
||||||
|
const { iAmRecorder } = state['features/base/config'];
|
||||||
|
|
||||||
return {
|
return {
|
||||||
isEngaged
|
_isEngaged: isEngaged,
|
||||||
|
_iAmRecorder: iAmRecorder
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -15,6 +15,11 @@ import { getSessionStatusToShow } from '../functions';
|
||||||
*/
|
*/
|
||||||
type Props = {
|
type Props = {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Whether this is the Jibri recorder participant.
|
||||||
|
*/
|
||||||
|
_iAmRecorder: boolean,
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The status of the highermost priority session.
|
* The status of the highermost priority session.
|
||||||
*/
|
*/
|
||||||
|
@ -100,7 +105,7 @@ export default class AbstractRecordingLabel
|
||||||
* @inheritdoc
|
* @inheritdoc
|
||||||
*/
|
*/
|
||||||
render() {
|
render() {
|
||||||
return this.props._status && !this.state.staleLabel
|
return this.props._status && !this.state.staleLabel && !this.props._iAmRecorder
|
||||||
? this._renderLabel() : null;
|
? this._renderLabel() : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -172,6 +177,7 @@ export function _mapStateToProps(state: Object, ownProps: Props) {
|
||||||
const { mode } = ownProps;
|
const { mode } = ownProps;
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
_iAmRecorder: state['features/base/config'].iAmRecorder,
|
||||||
_status: getSessionStatusToShow(state, mode)
|
_status: getSessionStatusToShow(state, mode)
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue