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

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