Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

PreMeetingScreen.js 4.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  1. // @flow
  2. import React, { PureComponent } from 'react';
  3. import { AudioSettingsButton, VideoSettingsButton } from '../../../../toolbox/components/web';
  4. import { VideoBackgroundButton } from '../../../../virtual-background';
  5. import { checkBlurSupport } from '../../../../virtual-background/functions';
  6. import { Avatar } from '../../../avatar';
  7. import { allowUrlSharing } from '../../functions';
  8. import ConnectionStatus from './ConnectionStatus';
  9. import CopyMeetingUrl from './CopyMeetingUrl';
  10. import Preview from './Preview';
  11. type Props = {
  12. /**
  13. * Children component(s) to be rendered on the screen.
  14. */
  15. children: React$Node,
  16. /**
  17. * Footer to be rendered for the page (if any).
  18. */
  19. footer?: React$Node,
  20. /**
  21. * The name of the participant.
  22. */
  23. name?: string,
  24. /**
  25. * Indicates whether the copy url button should be shown
  26. */
  27. showCopyUrlButton: boolean,
  28. /**
  29. * Indicates whether the avatar should be shown when video is off
  30. */
  31. showAvatar: boolean,
  32. /**
  33. * Indicates whether the label and copy url action should be shown
  34. */
  35. showConferenceInfo: boolean,
  36. /**
  37. * Title of the screen.
  38. */
  39. title: string,
  40. /**
  41. * The 'Skip prejoin' button to be rendered (if any).
  42. */
  43. skipPrejoinButton?: React$Node,
  44. /**
  45. * True if the preview overlay should be muted, false otherwise.
  46. */
  47. videoMuted?: boolean,
  48. /**
  49. * The video track to render as preview (if omitted, the default local track will be rendered).
  50. */
  51. videoTrack?: Object,
  52. /**
  53. * Array with the buttons which this Toolbox should display.
  54. */
  55. visibleButtons?: Array<string>
  56. }
  57. /**
  58. * Implements a pre-meeting screen that can be used at various pre-meeting phases, for example
  59. * on the prejoin screen (pre-connection) or lobby (post-connection).
  60. */
  61. export default class PreMeetingScreen extends PureComponent<Props> {
  62. /**
  63. * Default values for {@code Prejoin} component's properties.
  64. *
  65. * @static
  66. */
  67. static defaultProps = {
  68. showAvatar: true,
  69. showCopyUrlButton: true,
  70. showConferenceInfo: true
  71. };
  72. /**
  73. * Implements {@code PureComponent#render}.
  74. *
  75. * @inheritdoc
  76. */
  77. render() {
  78. const {
  79. name,
  80. showAvatar,
  81. showConferenceInfo,
  82. showCopyUrlButton,
  83. title,
  84. videoMuted,
  85. videoTrack,
  86. visibleButtons
  87. } = this.props;
  88. const showSharingButton = allowUrlSharing() && showCopyUrlButton;
  89. return (
  90. <div
  91. className = 'premeeting-screen'
  92. id = 'lobby-screen'>
  93. <ConnectionStatus />
  94. <Preview
  95. videoMuted = { videoMuted }
  96. videoTrack = { videoTrack } />
  97. <div className = 'content'>
  98. {showAvatar && videoMuted && (
  99. <Avatar
  100. className = 'premeeting-screen-avatar'
  101. displayName = { name }
  102. dynamicColor = { false }
  103. participantId = 'local'
  104. size = { 80 } />
  105. )}
  106. {showConferenceInfo && (
  107. <>
  108. <h1 className = 'title'>
  109. { title }
  110. </h1>
  111. {showSharingButton ? <CopyMeetingUrl /> : null}
  112. </>
  113. )}
  114. { this.props.children }
  115. <div className = 'media-btn-container'>
  116. <div className = 'toolbox-content'>
  117. <div className = 'toolbox-content-items'>
  118. <AudioSettingsButton visible = { true } />
  119. <VideoSettingsButton visible = { true } />
  120. { ((visibleButtons && visibleButtons.includes('select-background'))
  121. || (visibleButtons && visibleButtons.includes('videobackgroundblur')))
  122. && <VideoBackgroundButton visible = { checkBlurSupport() } /> }
  123. </div>
  124. </div>
  125. </div>
  126. { this.props.skipPrejoinButton }
  127. { this.props.footer }
  128. </div>
  129. </div>
  130. );
  131. }
  132. }