|
|
|
@ -1,22 +1,22 @@ |
|
|
|
|
/* @flow */ |
|
|
|
|
|
|
|
|
|
import React from 'react'; |
|
|
|
|
import React, { Component } from 'react'; |
|
|
|
|
|
|
|
|
|
import { getConferenceName } from '../../../base/conference/functions'; |
|
|
|
|
import { JitsiRecordingConstants } from '../../../base/lib-jitsi-meet'; |
|
|
|
|
import { getParticipantCount } from '../../../base/participants/functions'; |
|
|
|
|
import { connect } from '../../../base/redux'; |
|
|
|
|
import { E2EELabel } from '../../../e2ee'; |
|
|
|
|
import { LocalRecordingLabel } from '../../../local-recording'; |
|
|
|
|
import { getSessionStatusToShow, RecordingLabel } from '../../../recording'; |
|
|
|
|
import { RecordingLabel } from '../../../recording'; |
|
|
|
|
import { isToolboxVisible } from '../../../toolbox/functions.web'; |
|
|
|
|
import { TranscribingLabel } from '../../../transcribing'; |
|
|
|
|
import { VideoQualityLabel } from '../../../video-quality'; |
|
|
|
|
import ConferenceTimer from '../ConferenceTimer'; |
|
|
|
|
import { getConferenceInfo } from '../functions'; |
|
|
|
|
|
|
|
|
|
import ConferenceInfoContainer from './ConferenceInfoContainer'; |
|
|
|
|
import InsecureRoomNameLabel from './InsecureRoomNameLabel'; |
|
|
|
|
import ParticipantsCount from './ParticipantsCount'; |
|
|
|
|
|
|
|
|
|
import { InsecureRoomNameLabel } from '.'; |
|
|
|
|
import SubjectText from './SubjectText'; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* The type of the React {@code Component} props of {@link Subject}. |
|
|
|
@ -24,117 +24,151 @@ import { InsecureRoomNameLabel } from '.'; |
|
|
|
|
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. |
|
|
|
|
* Indicates whether the component should be visible or not. |
|
|
|
|
*/ |
|
|
|
|
_hideConferenceNameAndTimer: boolean, |
|
|
|
|
_visible: boolean |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Whether the conference timer should be shown or not. |
|
|
|
|
*/ |
|
|
|
|
_hideConferenceTimer: boolean, |
|
|
|
|
const COMPONENTS = [ |
|
|
|
|
{ |
|
|
|
|
Component: SubjectText, |
|
|
|
|
id: 'subject' |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
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' |
|
|
|
|
} |
|
|
|
|
]; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Whether the recording label should be shown or not. |
|
|
|
|
* The upper band of the meeing containing the conference name, timer and labels. |
|
|
|
|
* |
|
|
|
|
* @param {Object} props - The props of the component. |
|
|
|
|
* @returns {React$None} |
|
|
|
|
*/ |
|
|
|
|
_hideRecordingLabel: boolean, |
|
|
|
|
|
|
|
|
|
class ConferenceInfo extends Component<Props> { |
|
|
|
|
/** |
|
|
|
|
* Whether the participant count should be shown or not. |
|
|
|
|
* Initializes a new {@code ConferenceInfo} instance. |
|
|
|
|
* |
|
|
|
|
* @param {Props} props - The read-only React {@code Component} props with |
|
|
|
|
* which the new instance is to be initialized. |
|
|
|
|
*/ |
|
|
|
|
_showParticipantCount: boolean, |
|
|
|
|
constructor(props: Props) { |
|
|
|
|
super(props); |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* The subject or the of the conference. |
|
|
|
|
* Falls back to conference name. |
|
|
|
|
*/ |
|
|
|
|
_subject: string, |
|
|
|
|
this._renderAutoHide = this._renderAutoHide.bind(this); |
|
|
|
|
this._renderAlwaysVisible = this._renderAlwaysVisible.bind(this); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Indicates whether the component should be visible or not. |
|
|
|
|
*/ |
|
|
|
|
_visible: boolean, |
|
|
|
|
_renderAutoHide: () => void; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Whether or not the recording label is visible. |
|
|
|
|
* Renders auto-hidden info header labels. |
|
|
|
|
* |
|
|
|
|
* @returns {void} |
|
|
|
|
*/ |
|
|
|
|
_recordingLabel: boolean |
|
|
|
|
}; |
|
|
|
|
_renderAutoHide() { |
|
|
|
|
const { autoHide } = this.props._conferenceInfo; |
|
|
|
|
|
|
|
|
|
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; |
|
|
|
|
if (!autoHide || !autoHide.length) { |
|
|
|
|
return null; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return (subjectContainerWidth - recContainerWidth - subjectDetailsContainer) / 2; |
|
|
|
|
}; |
|
|
|
|
return ( |
|
|
|
|
<ConferenceInfoContainer visible = { this.props._visible } > |
|
|
|
|
{ |
|
|
|
|
COMPONENTS |
|
|
|
|
.filter(comp => autoHide.includes(comp.id)) |
|
|
|
|
.map(c => |
|
|
|
|
<c.Component key = { c.id } /> |
|
|
|
|
) |
|
|
|
|
} |
|
|
|
|
</ConferenceInfoContainer> |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
_renderAlwaysVisible: () => void; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* The upper band of the meeing containing the conference name, timer and labels. |
|
|
|
|
* Renders the always visible info header labels. |
|
|
|
|
* |
|
|
|
|
* @param {Object} props - The props of the component. |
|
|
|
|
* @returns {React$None} |
|
|
|
|
* @returns {void} |
|
|
|
|
*/ |
|
|
|
|
function ConferenceInfo(props: Props) { |
|
|
|
|
const { |
|
|
|
|
_hideConferenceNameAndTimer, |
|
|
|
|
_hideConferenceTimer, |
|
|
|
|
_showParticipantCount, |
|
|
|
|
_hideRecordingLabel, |
|
|
|
|
_subject, |
|
|
|
|
_fullWidth, |
|
|
|
|
_visible, |
|
|
|
|
_recordingLabel |
|
|
|
|
} = props; |
|
|
|
|
_renderAlwaysVisible() { |
|
|
|
|
const { alwaysVisible } = this.props._conferenceInfo; |
|
|
|
|
|
|
|
|
|
return ( |
|
|
|
|
<div className = { `subject ${_recordingLabel ? 'recording' : ''} ${_visible ? '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> |
|
|
|
|
if (!alwaysVisible || !alwaysVisible.length) { |
|
|
|
|
return null; |
|
|
|
|
} |
|
|
|
|
<div |
|
|
|
|
className = 'subject-details-container' |
|
|
|
|
id = 'subject-details-container'> |
|
|
|
|
|
|
|
|
|
return ( |
|
|
|
|
<ConferenceInfoContainer visible = { true } > |
|
|
|
|
{ |
|
|
|
|
!_hideConferenceNameAndTimer |
|
|
|
|
&& <div className = 'subject-info'> |
|
|
|
|
{ _subject && <span className = 'subject-text'>{ _subject }</span>} |
|
|
|
|
{ !_hideConferenceTimer && <ConferenceTimer /> } |
|
|
|
|
</div> |
|
|
|
|
COMPONENTS |
|
|
|
|
.filter(comp => alwaysVisible.includes(comp.id)) |
|
|
|
|
.map(c => |
|
|
|
|
<c.Component key = { c.id } /> |
|
|
|
|
) |
|
|
|
|
} |
|
|
|
|
{ _showParticipantCount && <ParticipantsCount /> } |
|
|
|
|
<E2EELabel /> |
|
|
|
|
{_hideRecordingLabel && ( |
|
|
|
|
<> |
|
|
|
|
<RecordingLabel mode = { JitsiRecordingConstants.mode.FILE } /> |
|
|
|
|
<RecordingLabel mode = { JitsiRecordingConstants.mode.STREAM } /> |
|
|
|
|
<LocalRecordingLabel /> |
|
|
|
|
</> |
|
|
|
|
)} |
|
|
|
|
<TranscribingLabel /> |
|
|
|
|
<VideoQualityLabel /> |
|
|
|
|
<InsecureRoomNameLabel /> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
</ConferenceInfoContainer> |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Implements React's {@link Component#render()}. |
|
|
|
|
* |
|
|
|
|
* @inheritdoc |
|
|
|
|
* @returns {ReactElement} |
|
|
|
|
*/ |
|
|
|
|
render() { |
|
|
|
|
return ( |
|
|
|
|
<div className = 'details-container' > |
|
|
|
|
{ [ |
|
|
|
|
this._renderAlwaysVisible(), |
|
|
|
|
this._renderAutoHide() |
|
|
|
|
] } |
|
|
|
|
</div> |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Maps (parts of) the Redux state to the associated |
|
|
|
@ -143,40 +177,14 @@ function ConferenceInfo(props: Props) { |
|
|
|
|
* @param {Object} state - The Redux state. |
|
|
|
|
* @private |
|
|
|
|
* @returns {{ |
|
|
|
|
* _hideConferenceTimer: boolean, |
|
|
|
|
* _showParticipantCount: boolean, |
|
|
|
|
* _subject: string, |
|
|
|
|
* _visible: boolean |
|
|
|
|
* _visible: boolean, |
|
|
|
|
* _conferenceInfo: Object |
|
|
|
|
* }} |
|
|
|
|
*/ |
|
|
|
|
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 { |
|
|
|
|
_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), |
|
|
|
|
_recordingLabel: (isFileRecording || isStreamRecording || isEngaged) && !shouldHideRecordingLabel |
|
|
|
|
_conferenceInfo: getConferenceInfo(state) |
|
|
|
|
}; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|