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.5KB

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