Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

VideoQualityLabel.native.js 2.0KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. // @flow
  2. import React from 'react';
  3. import { translate } from '../../base/i18n';
  4. import { CircularLabel } 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. <CircularLabel
  41. label = { t('videoStatus.audioOnly') }
  42. style = {
  43. combineStyles(styles.indicatorAudioOnly, style)
  44. } />
  45. );
  46. }
  47. }
  48. /**
  49. * Maps (parts of) the Redux state to the associated
  50. * {@code VideoQualityLabel}'s props.
  51. *
  52. * NOTE: This component has no props other than the abstract ones but keeping
  53. * the coding style the same for consistency reasons.
  54. *
  55. * @param {Object} state - The Redux state.
  56. * @private
  57. * @returns {{
  58. * }}
  59. */
  60. function _mapStateToProps(state: Object) {
  61. return {
  62. ..._abstractMapStateToProps(state)
  63. };
  64. }
  65. export default translate(connect(_mapStateToProps)(VideoQualityLabel));