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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. // @flow
  2. import React, { PureComponent } from 'react';
  3. import DeviceStatus from '../../../../prejoin/components/preview/DeviceStatus';
  4. import { Toolbox } from '../../../../toolbox/components/web';
  5. import ConnectionStatus from './ConnectionStatus';
  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. * Additional CSS class names to set on the icon container.
  14. */
  15. className?: string,
  16. /**
  17. * The name of the participant.
  18. */
  19. name?: string,
  20. /**
  21. * Indicates whether the copy url button should be shown
  22. */
  23. showCopyUrlButton: boolean,
  24. /**
  25. * Indicates whether the device status should be shown
  26. */
  27. showDeviceStatus: boolean,
  28. /**
  29. * The 'Skip prejoin' button to be rendered (if any).
  30. */
  31. skipPrejoinButton?: React$Node,
  32. /**
  33. * Title of the screen.
  34. */
  35. title?: string,
  36. /**
  37. * Override for default toolbar buttons
  38. */
  39. toolbarButtons?: Array<string>,
  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. const buttons = [ 'microphone', 'camera', 'select-background', 'invite', 'settings' ];
  50. /**
  51. * Implements a pre-meeting screen that can be used at various pre-meeting phases, for example
  52. * on the prejoin screen (pre-connection) or lobby (post-connection).
  53. */
  54. export default class PreMeetingScreen extends PureComponent<Props> {
  55. /**
  56. * Default values for {@code Prejoin} component's properties.
  57. *
  58. * @static
  59. */
  60. static defaultProps = {
  61. showCopyUrlButton: true,
  62. showToolbox: true
  63. };
  64. /**
  65. * Implements {@code PureComponent#render}.
  66. *
  67. * @inheritdoc
  68. */
  69. render() {
  70. const {
  71. children,
  72. className,
  73. showDeviceStatus,
  74. skipPrejoinButton,
  75. title,
  76. toolbarButtons,
  77. videoMuted,
  78. videoTrack
  79. } = this.props;
  80. const containerClassName = `premeeting-screen ${className ? className : ''}`;
  81. return (
  82. <div className = { containerClassName }>
  83. <div className = 'content'>
  84. <ConnectionStatus />
  85. <div className = 'content-controls'>
  86. <h1 className = 'title'>
  87. { title }
  88. </h1>
  89. { children }
  90. <Toolbox toolbarButtons = { toolbarButtons || buttons } />
  91. { skipPrejoinButton }
  92. { showDeviceStatus && <DeviceStatus /> }
  93. </div>
  94. </div>
  95. <Preview
  96. videoMuted = { videoMuted }
  97. videoTrack = { videoTrack } />
  98. </div>
  99. );
  100. }
  101. }