2018-06-14 11:14:17 +00:00
|
|
|
// @flow
|
2018-08-31 20:06:48 +00:00
|
|
|
|
2018-06-14 11:14:17 +00:00
|
|
|
import React from 'react';
|
|
|
|
import { View } from 'react-native';
|
|
|
|
import { connect } from 'react-redux';
|
|
|
|
|
|
|
|
import { JitsiRecordingConstants } from '../../base/lib-jitsi-meet';
|
|
|
|
import {
|
|
|
|
isNarrowAspectRatio,
|
|
|
|
makeAspectRatioAware
|
|
|
|
} from '../../base/responsive-ui';
|
|
|
|
|
2018-08-31 20:12:09 +00:00
|
|
|
import AbstractLabels, {
|
|
|
|
_abstractMapStateToProps,
|
|
|
|
type Props as AbstractLabelsProps
|
|
|
|
} from './AbstractLabels';
|
2018-06-14 11:14:17 +00:00
|
|
|
import styles from './styles';
|
|
|
|
|
2018-08-31 20:12:09 +00:00
|
|
|
/**
|
|
|
|
* The type of the React {@code Component} props of {@link Labels}.
|
|
|
|
*/
|
|
|
|
type Props = AbstractLabelsProps & {
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The indicator which determines whether the UI is reduced (to accommodate
|
|
|
|
* smaller display areas).
|
|
|
|
*
|
|
|
|
* @private
|
|
|
|
*/
|
|
|
|
_reducedUI: boolean
|
|
|
|
};
|
|
|
|
|
2018-06-14 11:14:17 +00:00
|
|
|
/**
|
|
|
|
* A container that renders the conference indicators, if any.
|
|
|
|
*/
|
|
|
|
class Labels extends AbstractLabels<Props, *> {
|
|
|
|
/**
|
|
|
|
* Implements React {@code Component}'s render.
|
|
|
|
*
|
|
|
|
* @inheritdoc
|
|
|
|
*/
|
|
|
|
render() {
|
2018-08-31 20:06:48 +00:00
|
|
|
const wide = !isNarrowAspectRatio(this);
|
2018-08-31 20:12:09 +00:00
|
|
|
const { _filmstripVisible, _reducedUI } = this.props;
|
2018-06-14 11:14:17 +00:00
|
|
|
|
|
|
|
return (
|
|
|
|
<View
|
|
|
|
pointerEvents = 'box-none'
|
|
|
|
style = { [
|
|
|
|
styles.indicatorContainer,
|
2018-08-31 20:06:48 +00:00
|
|
|
wide && _filmstripVisible && styles.indicatorContainerWide
|
2018-06-14 11:14:17 +00:00
|
|
|
] }>
|
|
|
|
{
|
|
|
|
this._renderRecordingLabel(
|
|
|
|
JitsiRecordingConstants.mode.FILE)
|
|
|
|
}
|
|
|
|
{
|
|
|
|
this._renderRecordingLabel(
|
|
|
|
JitsiRecordingConstants.mode.STREAM)
|
|
|
|
}
|
2018-08-16 19:34:26 +00:00
|
|
|
{
|
|
|
|
this._renderTranscribingLabel()
|
|
|
|
}
|
2018-08-31 20:12:09 +00:00
|
|
|
{/*
|
|
|
|
* Emil, Lyubomir, Nichole, and Zoli said that the Labels
|
|
|
|
* should not be rendered in Picture-in-Picture. Saul argued
|
|
|
|
* that the recording Labels should be rendered. As a temporary
|
|
|
|
* compromise, don't render the VideoQualityLabel at least
|
|
|
|
* because it's not that important.
|
|
|
|
*/
|
|
|
|
_reducedUI || this._renderVideoQualityLabel()
|
2018-06-14 11:14:17 +00:00
|
|
|
}
|
|
|
|
</View>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2018-08-31 20:06:48 +00:00
|
|
|
_renderRecordingLabel: string => React$Element<*>;
|
2018-06-14 11:14:17 +00:00
|
|
|
|
2018-08-16 19:34:26 +00:00
|
|
|
_renderTranscribingLabel: () => React$Element<*>
|
|
|
|
|
2018-08-31 20:06:48 +00:00
|
|
|
_renderVideoQualityLabel: () => React$Element<*>;
|
2018-06-14 11:14:17 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Maps (parts of) the redux state to the associated
|
|
|
|
* {@code Labels}'s props.
|
|
|
|
*
|
|
|
|
* @param {Object} state - The redux state.
|
|
|
|
* @private
|
|
|
|
* @returns {{
|
2018-08-31 20:12:09 +00:00
|
|
|
* _filmstripVisible: boolean,
|
|
|
|
* _reducedUI: boolean
|
2018-06-14 11:14:17 +00:00
|
|
|
* }}
|
|
|
|
*/
|
|
|
|
function _mapStateToProps(state) {
|
|
|
|
return {
|
2018-08-31 20:12:09 +00:00
|
|
|
..._abstractMapStateToProps(state),
|
|
|
|
_reducedUI: state['features/base/responsive-ui'].reducedUI
|
2018-06-14 11:14:17 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2018-08-31 20:06:48 +00:00
|
|
|
export default connect(_mapStateToProps)(makeAspectRatioAware(Labels));
|