2018-05-16 14:00:16 +00:00
|
|
|
// @flow
|
|
|
|
|
2018-06-14 11:14:17 +00:00
|
|
|
import React from 'react';
|
2018-05-16 14:00:16 +00:00
|
|
|
|
2019-02-05 10:10:15 +00:00
|
|
|
import { JitsiRecordingConstants } from '../../../base/lib-jitsi-meet';
|
2019-03-21 16:38:29 +00:00
|
|
|
import { connect } from '../../../base/redux';
|
2018-06-14 11:14:17 +00:00
|
|
|
import AbstractLabels, {
|
|
|
|
_abstractMapStateToProps as _mapStateToProps,
|
|
|
|
type Props
|
2019-02-05 10:10:15 +00:00
|
|
|
} from '../AbstractLabels';
|
2018-05-16 14:00:16 +00:00
|
|
|
|
2020-05-28 07:38:29 +00:00
|
|
|
declare var interfaceConfig: Object;
|
|
|
|
|
2018-05-16 14:00:16 +00:00
|
|
|
/**
|
|
|
|
* The type of the React {@code Component} state of {@link Labels}.
|
|
|
|
*/
|
|
|
|
type State = {
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Whether or not the filmstrip was not visible but has transitioned in the
|
|
|
|
* latest component update to visible. This boolean is used to set a class
|
|
|
|
* for position animations.
|
|
|
|
*
|
|
|
|
* @type {boolean}
|
|
|
|
*/
|
|
|
|
filmstripBecomingVisible: boolean
|
2018-08-31 20:06:48 +00:00
|
|
|
};
|
2018-05-16 14:00:16 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* A container to hold video status labels, including recording status and
|
|
|
|
* current large video quality.
|
|
|
|
*
|
|
|
|
* @extends Component
|
|
|
|
*/
|
2018-06-14 11:14:17 +00:00
|
|
|
class Labels extends AbstractLabels<Props, State> {
|
2018-10-29 02:10:33 +00:00
|
|
|
/**
|
|
|
|
* Updates the state for whether or not the filmstrip is transitioning to
|
|
|
|
* a displayed state.
|
|
|
|
*
|
|
|
|
* @inheritdoc
|
|
|
|
*/
|
2019-03-19 15:42:25 +00:00
|
|
|
static getDerivedStateFromProps(props: Props, prevState: State) {
|
2018-10-29 02:10:33 +00:00
|
|
|
return {
|
2020-06-02 09:03:17 +00:00
|
|
|
filmstripBecomingVisible: !prevState.filmstripBecomingVisible && props._filmstripVisible
|
2018-10-29 02:10:33 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2018-05-16 14:00:16 +00:00
|
|
|
/**
|
|
|
|
* Initializes a new {@code Labels} instance.
|
|
|
|
*
|
|
|
|
* @param {Object} props - The read-only properties with which the new
|
|
|
|
* instance is to be initialized.
|
|
|
|
*/
|
|
|
|
constructor(props: Props) {
|
|
|
|
super(props);
|
|
|
|
|
|
|
|
this.state = {
|
|
|
|
filmstripBecomingVisible: false
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Implements React's {@link Component#render()}.
|
|
|
|
*
|
|
|
|
* @inheritdoc
|
|
|
|
* @returns {ReactElement}
|
|
|
|
*/
|
|
|
|
render() {
|
2018-06-14 11:14:17 +00:00
|
|
|
const { _filmstripVisible } = this.props;
|
2018-05-16 14:00:16 +00:00
|
|
|
const { filmstripBecomingVisible } = this.state;
|
2020-05-28 07:38:29 +00:00
|
|
|
const { VIDEO_QUALITY_LABEL_DISABLED } = interfaceConfig;
|
2018-05-16 14:00:16 +00:00
|
|
|
const className = `large-video-labels ${
|
|
|
|
filmstripBecomingVisible ? 'opening' : ''} ${
|
|
|
|
_filmstripVisible ? 'with-filmstrip' : 'without-filmstrip'}`;
|
|
|
|
|
|
|
|
return (
|
|
|
|
<div className = { className } >
|
2020-04-23 13:45:36 +00:00
|
|
|
{
|
|
|
|
this._renderE2EELabel()
|
|
|
|
}
|
2018-06-14 11:14:17 +00:00
|
|
|
{
|
|
|
|
this._renderRecordingLabel(
|
|
|
|
JitsiRecordingConstants.mode.FILE)
|
|
|
|
}
|
|
|
|
{
|
|
|
|
this._renderRecordingLabel(
|
|
|
|
JitsiRecordingConstants.mode.STREAM)
|
|
|
|
}
|
2018-07-31 22:20:31 +00:00
|
|
|
{
|
|
|
|
this._renderLocalRecordingLabel()
|
|
|
|
}
|
2018-07-26 16:33:40 +00:00
|
|
|
{
|
|
|
|
this._renderTranscribingLabel()
|
|
|
|
}
|
2018-06-14 11:14:17 +00:00
|
|
|
{
|
2020-05-28 07:38:29 +00:00
|
|
|
this.props._showVideoQualityLabel && !VIDEO_QUALITY_LABEL_DISABLED
|
2018-08-08 18:48:23 +00:00
|
|
|
&& this._renderVideoQualityLabel()
|
2018-06-14 11:14:17 +00:00
|
|
|
}
|
2020-05-18 12:07:09 +00:00
|
|
|
{
|
|
|
|
this._renderInsecureRoomNameLabel()
|
|
|
|
}
|
2018-05-16 14:00:16 +00:00
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2020-04-23 13:45:36 +00:00
|
|
|
_renderE2EELabel: () => React$Element<*>;
|
|
|
|
|
2018-08-31 20:06:48 +00:00
|
|
|
_renderLocalRecordingLabel: () => React$Element<*>;
|
2018-05-16 14:00:16 +00:00
|
|
|
|
2018-08-31 20:06:48 +00:00
|
|
|
_renderRecordingLabel: string => React$Element<*>;
|
2018-07-26 16:33:40 +00:00
|
|
|
|
2018-08-31 20:06:48 +00:00
|
|
|
_renderTranscribingLabel: () => React$Element<*>;
|
2018-07-31 22:20:31 +00:00
|
|
|
|
2020-05-18 12:07:09 +00:00
|
|
|
_renderInsecureRoomNameLabel: () => React$Element<any>;
|
|
|
|
|
2018-08-31 20:06:48 +00:00
|
|
|
_renderVideoQualityLabel: () => React$Element<*>;
|
2018-05-16 14:00:16 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export default connect(_mapStateToProps)(Labels);
|