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

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