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.

AbstractLabels.js 2.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. // @flow
  2. import React, { Component } from 'react';
  3. import { E2EELabel } from '../../e2ee';
  4. import { isFilmstripVisible } from '../../filmstrip';
  5. import { LocalRecordingLabel } from '../../local-recording';
  6. import { RecordingLabel } from '../../recording';
  7. import { TranscribingLabel } from '../../transcribing';
  8. import { shouldDisplayTileView } from '../../video-layout';
  9. import { VideoQualityLabel } from '../../video-quality';
  10. /**
  11. * The type of the React {@code Component} props of {@link AbstractLabels}.
  12. */
  13. export type Props = {
  14. /**
  15. * Whether the filmstrip is displayed with remote videos. Used to determine
  16. * display classes to set.
  17. */
  18. _filmstripVisible: boolean,
  19. /**
  20. * Whether the video quality label should be displayed.
  21. */
  22. _showVideoQualityLabel: boolean
  23. };
  24. /**
  25. * A container to hold video status labels, including recording status and
  26. * current large video quality.
  27. *
  28. * @extends Component
  29. */
  30. export default class AbstractLabels<P: Props, S> extends Component<P, S> {
  31. /**
  32. * Renders the {@code E2EELabel}.
  33. *
  34. * @protected
  35. * @returns {React$Element}
  36. */
  37. _renderE2EELabel() {
  38. return (
  39. <E2EELabel />
  40. );
  41. }
  42. /**
  43. * Renders the {@code LocalRecordingLabel}.
  44. *
  45. * @protected
  46. * @returns {React$Element}
  47. */
  48. _renderLocalRecordingLabel() {
  49. return (
  50. <LocalRecordingLabel />
  51. );
  52. }
  53. /**
  54. * Renders the {@code RecordingLabel} that is platform independent.
  55. *
  56. * @param {string} mode - The recording mode that this label is rendered
  57. * for.
  58. * @protected
  59. * @returns {React$Element}
  60. */
  61. _renderRecordingLabel(mode: string) {
  62. return (
  63. <RecordingLabel mode = { mode } />
  64. );
  65. }
  66. /**
  67. * Renders the {@code TranscribingLabel}.
  68. *
  69. * @protected
  70. * @returns {React$Element}
  71. */
  72. _renderTranscribingLabel() {
  73. return (
  74. <TranscribingLabel />
  75. );
  76. }
  77. /**
  78. * Renders the {@code VideoQualityLabel} that is platform independent.
  79. *
  80. * @protected
  81. * @returns {React$Element}
  82. */
  83. _renderVideoQualityLabel() {
  84. return (
  85. <VideoQualityLabel />
  86. );
  87. }
  88. }
  89. /**
  90. * Maps (parts of) the redux state to the associated props of the {@link Labels}
  91. * {@code Component}.
  92. *
  93. * @param {Object} state - The redux state.
  94. * @private
  95. * @returns {{
  96. * _filmstripVisible: boolean,
  97. * _showVideoQualityLabel: boolean
  98. * }}
  99. */
  100. export function _abstractMapStateToProps(state: Object) {
  101. return {
  102. _filmstripVisible: isFilmstripVisible(state),
  103. _showVideoQualityLabel: !shouldDisplayTileView(state)
  104. };
  105. }