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.

Labels.native.js 2.6KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. // @flow
  2. import React from 'react';
  3. import { View } from 'react-native';
  4. import { connect } from 'react-redux';
  5. import { JitsiRecordingConstants } from '../../base/lib-jitsi-meet';
  6. import {
  7. isNarrowAspectRatio,
  8. makeAspectRatioAware
  9. } from '../../base/responsive-ui';
  10. import AbstractLabels, {
  11. _abstractMapStateToProps,
  12. type Props as AbstractLabelsProps
  13. } from './AbstractLabels';
  14. import styles from './styles';
  15. /**
  16. * The type of the React {@code Component} props of {@link Labels}.
  17. */
  18. type Props = AbstractLabelsProps & {
  19. /**
  20. * The indicator which determines whether the UI is reduced (to accommodate
  21. * smaller display areas).
  22. *
  23. * @private
  24. */
  25. _reducedUI: boolean
  26. };
  27. /**
  28. * A container that renders the conference indicators, if any.
  29. */
  30. class Labels extends AbstractLabels<Props, *> {
  31. /**
  32. * Implements React {@code Component}'s render.
  33. *
  34. * @inheritdoc
  35. */
  36. render() {
  37. const wide = !isNarrowAspectRatio(this);
  38. const { _filmstripVisible, _reducedUI } = this.props;
  39. return (
  40. <View
  41. pointerEvents = 'box-none'
  42. style = { [
  43. styles.indicatorContainer,
  44. wide && _filmstripVisible && styles.indicatorContainerWide
  45. ] }>
  46. {
  47. this._renderRecordingLabel(
  48. JitsiRecordingConstants.mode.FILE)
  49. }
  50. {
  51. this._renderRecordingLabel(
  52. JitsiRecordingConstants.mode.STREAM)
  53. }
  54. {/*
  55. * Emil, Lyubomir, Nichole, and Zoli said that the Labels
  56. * should not be rendered in Picture-in-Picture. Saul argued
  57. * that the recording Labels should be rendered. As a temporary
  58. * compromise, don't render the VideoQualityLabel at least
  59. * because it's not that important.
  60. */
  61. _reducedUI || this._renderVideoQualityLabel()
  62. }
  63. </View>
  64. );
  65. }
  66. _renderRecordingLabel: string => React$Element<*>;
  67. _renderVideoQualityLabel: () => React$Element<*>;
  68. }
  69. /**
  70. * Maps (parts of) the redux state to the associated
  71. * {@code Labels}'s props.
  72. *
  73. * @param {Object} state - The redux state.
  74. * @private
  75. * @returns {{
  76. * _filmstripVisible: boolean,
  77. * _reducedUI: boolean
  78. * }}
  79. */
  80. function _mapStateToProps(state) {
  81. return {
  82. ..._abstractMapStateToProps(state),
  83. _reducedUI: state['features/base/responsive-ui'].reducedUI
  84. };
  85. }
  86. export default connect(_mapStateToProps)(makeAspectRatioAware(Labels));