You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

VideoQualityLabel.native.js 2.0KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. // @flow
  2. import React from 'react';
  3. import { translate } from '../../base/i18n';
  4. import { Label } from '../../base/label';
  5. import { connect } from '../../base/redux';
  6. import { combineStyles, type StyleType } from '../../base/styles';
  7. import AbstractVideoQualityLabel, {
  8. _abstractMapStateToProps,
  9. type Props as AbstractProps
  10. } from './AbstractVideoQualityLabel';
  11. import styles from './styles';
  12. type Props = AbstractProps & {
  13. /**
  14. * Style of the component passed as props.
  15. */
  16. style: ?StyleType
  17. };
  18. /**
  19. * React {@code Component} responsible for displaying a label that indicates
  20. * the displayed video state of the current conference.
  21. *
  22. * NOTE: Due to the lack of actual video quality information on mobile side,
  23. * this component currently only displays audio only indicator, but the naming
  24. * is kept consistent with web and in the future we may introduce the required
  25. * api and extend this component with actual quality indication.
  26. */
  27. class VideoQualityLabel extends AbstractVideoQualityLabel<Props> {
  28. /**
  29. * Implements React {@link Component}'s render.
  30. *
  31. * @inheritdoc
  32. */
  33. render() {
  34. const { _audioOnly, style, t } = this.props;
  35. if (!_audioOnly) {
  36. // We don't have info about the quality so no need for the indicator
  37. return null;
  38. }
  39. return (
  40. <Label
  41. style = { combineStyles(styles.indicatorAudioOnly, style) }
  42. text = { t('videoStatus.audioOnly') } />
  43. );
  44. }
  45. }
  46. /**
  47. * Maps (parts of) the Redux state to the associated
  48. * {@code VideoQualityLabel}'s props.
  49. *
  50. * NOTE: This component has no props other than the abstract ones but keeping
  51. * the coding style the same for consistency reasons.
  52. *
  53. * @param {Object} state - The Redux state.
  54. * @private
  55. * @returns {{
  56. * }}
  57. */
  58. function _mapStateToProps(state: Object) {
  59. return {
  60. ..._abstractMapStateToProps(state)
  61. };
  62. }
  63. export default translate(connect(_mapStateToProps)(VideoQualityLabel));