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

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