選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

PreMeetingScreen.js 3.7KB

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