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.

ConferenceIndicators.native.js 2.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. // @flow
  2. import React, { Component } 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 { RecordingLabel } from '../../recording';
  11. import { VideoQualityLabel } from '../../video-quality';
  12. import styles from './styles';
  13. type Props = {
  14. /**
  15. * The indicator which determines whether the filmstrip is visible.
  16. */
  17. _filmstripVisible: boolean
  18. };
  19. /**
  20. * A container that renders the conference indicators, if any.
  21. */
  22. class ConferenceIndicators extends Component<Props> {
  23. /**
  24. * Implements React {@code Component}'s render.
  25. *
  26. * @inheritdoc
  27. */
  28. render() {
  29. const _wide = !isNarrowAspectRatio(this);
  30. const { _filmstripVisible } = this.props;
  31. return (
  32. <View
  33. style = { [
  34. styles.indicatorContainer,
  35. _wide && _filmstripVisible && styles.indicatorContainerWide
  36. ] }>
  37. <RecordingLabel
  38. mode = { JitsiRecordingConstants.mode.FILE } />
  39. <RecordingLabel
  40. mode = { JitsiRecordingConstants.mode.STREAM } />
  41. <VideoQualityLabel />
  42. </View>
  43. );
  44. }
  45. }
  46. /**
  47. * Maps (parts of) the redux state to the associated
  48. * {@code ConferenceIndicators}'s props.
  49. *
  50. * @param {Object} state - The redux state.
  51. * @private
  52. * @returns {{
  53. * _filmstripVisible: boolean
  54. * }}
  55. */
  56. function _mapStateToProps(state) {
  57. const { length: participantCount } = state['features/base/participants'];
  58. const { visible } = state['features/filmstrip'];
  59. return {
  60. /**
  61. * The indicator which determines whether the filmstrip is visible.
  62. *
  63. * @private
  64. * @type {boolean}
  65. */
  66. _filmstripVisible: visible && participantCount > 1
  67. };
  68. }
  69. export default connect(_mapStateToProps)(
  70. makeAspectRatioAware(ConferenceIndicators)
  71. );