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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. // @flow
  2. import React, { PureComponent } from 'react';
  3. import { AudioSettingsButton, VideoSettingsButton } from '../../../../toolbox/components/web';
  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. * The 'Skip prejoin' button to be rendered (if any).
  33. */
  34. skipPrejoinButton?: React$Node,
  35. /**
  36. * True if the preview overlay should be muted, false otherwise.
  37. */
  38. videoMuted?: boolean,
  39. /**
  40. * The video track to render as preview (if omitted, the default local track will be rendered).
  41. */
  42. videoTrack?: Object
  43. }
  44. /**
  45. * Implements a pre-meeting screen that can be used at various pre-meeting phases, for example
  46. * on the prejoin screen (pre-connection) or lobby (post-connection).
  47. */
  48. export default class PreMeetingScreen extends PureComponent<Props> {
  49. /**
  50. * Default values for {@code Prejoin} component's properties.
  51. *
  52. * @static
  53. */
  54. static defaultProps = {
  55. showAvatar: true,
  56. showConferenceInfo: true
  57. };
  58. /**
  59. * Implements {@code PureComponent#render}.
  60. *
  61. * @inheritdoc
  62. */
  63. render() {
  64. const { name, showAvatar, showConferenceInfo, title, videoMuted, videoTrack } = this.props;
  65. return (
  66. <div
  67. className = 'premeeting-screen'
  68. id = 'lobby-screen'>
  69. <Preview
  70. name = { name }
  71. showAvatar = { showAvatar }
  72. videoMuted = { videoMuted }
  73. videoTrack = { videoTrack } />
  74. {!videoMuted && <div className = 'preview-overlay' />}
  75. <div className = 'content'>
  76. {showConferenceInfo && (
  77. <>
  78. <div className = 'title'>
  79. { title }
  80. </div>
  81. <CopyMeetingUrl />
  82. </>
  83. )}
  84. { this.props.children }
  85. <div className = 'media-btn-container'>
  86. <AudioSettingsButton visible = { true } />
  87. <VideoSettingsButton visible = { true } />
  88. </div>
  89. { this.props.skipPrejoinButton }
  90. { this.props.footer }
  91. </div>
  92. </div>
  93. );
  94. }
  95. }