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

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  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 { 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. /**
  19. * A container to hold video status labels, including recording status and
  20. * current large video quality.
  21. *
  22. * @extends Component
  23. */
  24. export default class AbstractLabels<P: Props, S> extends Component<P, S> {
  25. /**
  26. * Renders the {@code RecordingLabel} that is platform independent.
  27. *
  28. * @protected
  29. * @param {string} mode - The recording mode that this label is rendered
  30. * for.
  31. * @returns {React$Element}
  32. */
  33. _renderRecordingLabel(mode: string) {
  34. return (
  35. <RecordingLabel mode = { mode } />
  36. );
  37. }
  38. /**
  39. * Renders the {@code VideoQualityLabel} that is platform independent.
  40. *
  41. * @protected
  42. * @returns {React$Element}
  43. */
  44. _renderVideoQualityLabel() {
  45. return (
  46. <VideoQualityLabel />
  47. );
  48. }
  49. /**
  50. * Renders the {@code TranscribingLabel}.
  51. *
  52. * @returns {React$Element}
  53. * @protected
  54. */
  55. _renderTranscribingLabel() {
  56. return (
  57. <TranscribingLabel />
  58. );
  59. }
  60. /**
  61. * Renders the {@code LocalRecordingLabel}.
  62. *
  63. * @returns {React$Element}
  64. * @protected
  65. */
  66. _renderLocalRecordingLabel() {
  67. return (
  68. <LocalRecordingLabel />
  69. );
  70. }
  71. }
  72. /**
  73. * Maps (parts of) the Redux state to the associated props for the
  74. * {@code Labels} component.
  75. *
  76. * @param {Object} state - The Redux state.
  77. * @private
  78. * @returns {{
  79. * _filmstripVisible: boolean
  80. * }}
  81. */
  82. export function _abstractMapStateToProps(state: Object) {
  83. return {
  84. _filmstripVisible: isFilmstripVisible(state)
  85. };
  86. }