123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150 |
- // @flow
-
- import React, { PureComponent } from 'react';
-
- import { AudioSettingsButton, VideoSettingsButton } from '../../../../toolbox/components/web';
- import { VideoBackgroundButton } from '../../../../virtual-background';
- import { checkBlurSupport } from '../../../../virtual-background/functions';
- import { Avatar } from '../../../avatar';
- import { allowUrlSharing } from '../../functions';
-
- import ConnectionStatus from './ConnectionStatus';
- import CopyMeetingUrl from './CopyMeetingUrl';
- import Preview from './Preview';
-
- type Props = {
-
- /**
- * Children component(s) to be rendered on the screen.
- */
- children: React$Node,
-
- /**
- * Footer to be rendered for the page (if any).
- */
- footer?: React$Node,
-
- /**
- * The name of the participant.
- */
- name?: string,
-
- /**
- * Indicates whether the copy url button should be shown
- */
- showCopyUrlButton: boolean,
-
- /**
- * Indicates whether the avatar should be shown when video is off
- */
- showAvatar: boolean,
-
- /**
- * Indicates whether the label and copy url action should be shown
- */
- showConferenceInfo: boolean,
-
- /**
- * Title of the screen.
- */
- title: string,
-
- /**
- * The 'Skip prejoin' button to be rendered (if any).
- */
- skipPrejoinButton?: React$Node,
-
- /**
- * True if the preview overlay should be muted, false otherwise.
- */
- videoMuted?: boolean,
-
- /**
- * The video track to render as preview (if omitted, the default local track will be rendered).
- */
- videoTrack?: Object,
-
- /**
- * Array with the buttons which this Toolbox should display.
- */
- visibleButtons?: Array<string>
- }
-
- /**
- * Implements a pre-meeting screen that can be used at various pre-meeting phases, for example
- * on the prejoin screen (pre-connection) or lobby (post-connection).
- */
- export default class PreMeetingScreen extends PureComponent<Props> {
- /**
- * Default values for {@code Prejoin} component's properties.
- *
- * @static
- */
- static defaultProps = {
- showAvatar: true,
- showCopyUrlButton: true,
- showConferenceInfo: true
- };
-
- /**
- * Implements {@code PureComponent#render}.
- *
- * @inheritdoc
- */
- render() {
- const {
- name,
- showAvatar,
- showConferenceInfo,
- showCopyUrlButton,
- title,
- videoMuted,
- videoTrack,
- visibleButtons
- } = this.props;
- const showSharingButton = allowUrlSharing() && showCopyUrlButton;
-
- return (
- <div
- className = 'premeeting-screen'
- id = 'lobby-screen'>
- <ConnectionStatus />
- <Preview
- videoMuted = { videoMuted }
- videoTrack = { videoTrack } />
- <div className = 'content'>
- {showAvatar && videoMuted && (
- <Avatar
- className = 'premeeting-screen-avatar'
- displayName = { name }
- dynamicColor = { false }
- participantId = 'local'
- size = { 80 } />
- )}
- {showConferenceInfo && (
- <>
- <h1 className = 'title'>
- { title }
- </h1>
- {showSharingButton ? <CopyMeetingUrl /> : null}
- </>
- )}
- { this.props.children }
- <div className = 'media-btn-container'>
- <div className = 'toolbox-content'>
- <div className = 'toolbox-content-items'>
- <AudioSettingsButton visible = { true } />
- <VideoSettingsButton visible = { true } />
- { ((visibleButtons && visibleButtons.includes('select-background'))
- || (visibleButtons && visibleButtons.includes('videobackgroundblur')))
- && <VideoBackgroundButton visible = { checkBlurSupport() } /> }
- </div>
- </div>
- </div>
- { this.props.skipPrejoinButton }
- { this.props.footer }
- </div>
- </div>
- );
- }
- }
|