您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

AbstractLabels.js 3.0KB

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