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.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. // @flow
  2. import React, { PureComponent } from 'react';
  3. import { AudioSettingsButton, VideoSettingsButton } from '../../../../toolbox/components/web';
  4. import ConnectionStatus from './ConnectionStatus';
  5. import CopyMeetingUrl from './CopyMeetingUrl';
  6. import Preview from './Preview';
  7. type Props = {
  8. /**
  9. * Children component(s) to be rendered on the screen.
  10. */
  11. children: React$Node,
  12. /**
  13. * Footer to be rendered for the page (if any).
  14. */
  15. footer?: React$Node,
  16. /**
  17. * The name of the participant.
  18. */
  19. name?: string,
  20. /**
  21. * Indicates whether the avatar should be shown when video is off
  22. */
  23. showAvatar: boolean,
  24. /**
  25. * Indicates whether the label and copy url action should be shown
  26. */
  27. showConferenceInfo: boolean,
  28. /**
  29. * Title of the screen.
  30. */
  31. title: string,
  32. /**
  33. * The 'Skip prejoin' button to be rendered (if any).
  34. */
  35. skipPrejoinButton?: React$Node,
  36. /**
  37. * True if the preview overlay should be muted, false otherwise.
  38. */
  39. videoMuted?: boolean,
  40. /**
  41. * The video track to render as preview (if omitted, the default local track will be rendered).
  42. */
  43. videoTrack?: Object
  44. }
  45. /**
  46. * Implements a pre-meeting screen that can be used at various pre-meeting phases, for example
  47. * on the prejoin screen (pre-connection) or lobby (post-connection).
  48. */
  49. export default class PreMeetingScreen extends PureComponent<Props> {
  50. /**
  51. * Default values for {@code Prejoin} component's properties.
  52. *
  53. * @static
  54. */
  55. static defaultProps = {
  56. showAvatar: true,
  57. showConferenceInfo: true
  58. };
  59. /**
  60. * Implements {@code PureComponent#render}.
  61. *
  62. * @inheritdoc
  63. */
  64. render() {
  65. const { name, showAvatar, showConferenceInfo, title, videoMuted, videoTrack } = this.props;
  66. return (
  67. <div
  68. className = 'premeeting-screen'
  69. id = 'lobby-screen'>
  70. <ConnectionStatus />
  71. <Preview
  72. name = { name }
  73. showAvatar = { showAvatar }
  74. videoMuted = { videoMuted }
  75. videoTrack = { videoTrack } />
  76. {!videoMuted && <div className = 'preview-overlay' />}
  77. <div className = 'content'>
  78. {showConferenceInfo && (
  79. <>
  80. <div className = 'title'>
  81. { title }
  82. </div>
  83. <CopyMeetingUrl />
  84. </>
  85. )}
  86. { this.props.children }
  87. <div className = 'media-btn-container'>
  88. <AudioSettingsButton visible = { true } />
  89. <VideoSettingsButton visible = { true } />
  90. </div>
  91. { this.props.skipPrejoinButton }
  92. { this.props.footer }
  93. </div>
  94. </div>
  95. );
  96. }
  97. }