mirror of https://github.com/jitsi/jitsi-meet
parent
9eb9306e87
commit
118250750a
@ -0,0 +1,41 @@ |
||||
// @flow
|
||||
|
||||
import { Component } from 'react'; |
||||
|
||||
export type Props = { |
||||
|
||||
/** |
||||
* Whether or not the conference is in audio only mode. |
||||
*/ |
||||
_audioOnly: boolean, |
||||
|
||||
/** |
||||
* Invoked to obtain translated strings. |
||||
*/ |
||||
t: Function |
||||
}; |
||||
|
||||
/** |
||||
* Abstract class for the {@code VideoQualityLabel} component. |
||||
*/ |
||||
export default class AbstractVideoQualityLabel<P: Props> extends Component<P> { |
||||
|
||||
} |
||||
|
||||
/** |
||||
* Maps (parts of) the Redux state to the associated |
||||
* {@code AbstractVideoQualityLabel}'s props. |
||||
* |
||||
* @param {Object} state - The Redux state. |
||||
* @private |
||||
* @returns {{ |
||||
* _audioOnly: boolean |
||||
* }} |
||||
*/ |
||||
export function _abstractMapStateToProps(state: Object) { |
||||
const { audioOnly } = state['features/base/conference']; |
||||
|
||||
return { |
||||
_audioOnly: audioOnly |
||||
}; |
||||
} |
@ -0,0 +1,76 @@ |
||||
// @flow
|
||||
|
||||
import React from 'react'; |
||||
import { connect } from 'react-redux'; |
||||
|
||||
import { translate } from '../../base/i18n'; |
||||
import { CircularLabel } from '../../base/label'; |
||||
import { combineStyles, type StyleType } from '../../base/styles'; |
||||
|
||||
import AbstractVideoQualityLabel, { |
||||
_abstractMapStateToProps, |
||||
type Props as AbstractProps |
||||
} from './AbstractVideoQualityLabel'; |
||||
import styles from './styles'; |
||||
|
||||
type Props = AbstractProps & { |
||||
|
||||
/** |
||||
* Style of the component passed as props. |
||||
*/ |
||||
style: ?StyleType |
||||
}; |
||||
|
||||
/** |
||||
* React {@code Component} responsible for displaying a label that indicates |
||||
* the displayed video state of the current conference. |
||||
* |
||||
* NOTE: Due to the lack of actual video quality information on mobile side, |
||||
* this component currently only displays audio only indicator, but the naming |
||||
* is kept consistent with web and in the future we may introduce the required |
||||
* api and extend this component with actual quality indication. |
||||
*/ |
||||
class VideoQualityLabel extends AbstractVideoQualityLabel<Props> { |
||||
|
||||
/** |
||||
* Implements React {@link Component}'s render. |
||||
* |
||||
* @inheritdoc |
||||
*/ |
||||
render() { |
||||
const { _audioOnly, style, t } = this.props; |
||||
|
||||
if (!_audioOnly) { |
||||
// We don't have info about the quality so no need for the indicator
|
||||
return null; |
||||
} |
||||
|
||||
return ( |
||||
<CircularLabel |
||||
label = { t('videoStatus.audioOnly') } |
||||
style = { |
||||
combineStyles(styles.indicatorAudioOnly, style) |
||||
} /> |
||||
); |
||||
} |
||||
} |
||||
|
||||
/** |
||||
* Maps (parts of) the Redux state to the associated |
||||
* {@code VideoQualityLabel}'s props. |
||||
* |
||||
* NOTE: This component has no props other than the abstract ones but keeping |
||||
* the coding style the same for consistency reasons. |
||||
* |
||||
* @param {Object} state - The Redux state. |
||||
* @private |
||||
* @returns {{ |
||||
* }} |
||||
*/ |
||||
function _mapStateToProps(state: Object) { |
||||
return { |
||||
..._abstractMapStateToProps(state) |
||||
}; |
||||
} |
||||
|
||||
export default translate(connect(_mapStateToProps)(VideoQualityLabel)); |
@ -0,0 +1,16 @@ |
||||
// @flow
|
||||
|
||||
import { ColorPalette, createStyleSheet } from '../../base/styles'; |
||||
|
||||
/** |
||||
* The styles of the React {@code Components} of the feature video-quality. |
||||
*/ |
||||
export default createStyleSheet({ |
||||
|
||||
/** |
||||
* Style for the audio-only indicator. |
||||
*/ |
||||
indicatorAudioOnly: { |
||||
backgroundColor: ColorPalette.green |
||||
} |
||||
}); |
Loading…
Reference in new issue