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 3.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  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. /**
  50. * Implements a pre-meeting screen that can be used at various pre-meeting phases, for example
  51. * on the prejoin screen (pre-connection) or lobby (post-connection).
  52. */
  53. export default class PreMeetingScreen extends PureComponent<Props> {
  54. /**
  55. * Default values for {@code Prejoin} component's properties.
  56. *
  57. * @static
  58. */
  59. static defaultProps = {
  60. showAvatar: true,
  61. showConferenceInfo: true
  62. };
  63. /**
  64. * Implements {@code PureComponent#render}.
  65. *
  66. * @inheritdoc
  67. */
  68. render() {
  69. const { name, showAvatar, showConferenceInfo, title, videoMuted, videoTrack } = this.props;
  70. const showSharingButton = allowUrlSharing();
  71. return (
  72. <div
  73. className = 'premeeting-screen'
  74. id = 'lobby-screen'>
  75. <ConnectionStatus />
  76. <Preview
  77. videoMuted = { videoMuted }
  78. videoTrack = { videoTrack } />
  79. {!videoMuted && <div className = 'preview-overlay' />}
  80. <div className = 'content'>
  81. {showAvatar && videoMuted && (
  82. <Avatar
  83. className = 'premeeting-screen-avatar'
  84. displayName = { name }
  85. dynamicColor = { false }
  86. participantId = 'local'
  87. size = { 80 } />
  88. )}
  89. {showConferenceInfo && (
  90. <>
  91. <div className = 'title'>
  92. { title }
  93. </div>
  94. {showSharingButton ? <CopyMeetingUrl /> : null}
  95. </>
  96. )}
  97. { this.props.children }
  98. <div className = 'media-btn-container'>
  99. <div className = 'toolbox-content'>
  100. <div className = 'toolbox-content-items'>
  101. <AudioSettingsButton visible = { true } />
  102. <VideoSettingsButton visible = { true } />
  103. <VideoBackgroundButton visible = { checkBlurSupport() } />
  104. </div>
  105. </div>
  106. </div>
  107. { this.props.skipPrejoinButton }
  108. { this.props.footer }
  109. </div>
  110. </div>
  111. );
  112. }
  113. }