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.

PreMeetingScreen.js 4.2KB

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