2022-08-25 11:35:19 +00:00
|
|
|
/* eslint-disable lines-around-comment */
|
2022-09-13 07:36:00 +00:00
|
|
|
import { withStyles } from '@mui/styles';
|
2022-04-05 12:19:03 +00:00
|
|
|
import React, { Component } from 'react';
|
2022-08-25 11:35:19 +00:00
|
|
|
import { WithTranslation } from 'react-i18next';
|
2022-03-11 13:00:49 +00:00
|
|
|
import { batch } from 'react-redux';
|
2017-02-16 23:02:40 +00:00
|
|
|
|
2022-10-19 08:42:54 +00:00
|
|
|
// @ts-expect-error
|
2021-06-10 12:48:44 +00:00
|
|
|
import keyboardShortcut from '../../../../../modules/keyboardshortcut/keyboardshortcut';
|
2022-10-17 20:40:13 +00:00
|
|
|
import { isSpeakerStatsDisabled } from '../../../../features/speaker-stats/functions';
|
2022-09-07 08:20:05 +00:00
|
|
|
import { ACTION_SHORTCUT_TRIGGERED, createShortcutEvent, createToolbarEvent } from '../../../analytics/AnalyticsEvents';
|
|
|
|
import { sendAnalytics } from '../../../analytics/functions';
|
2022-10-20 09:11:27 +00:00
|
|
|
import { IReduxState } from '../../../app/types';
|
2022-10-11 10:47:54 +00:00
|
|
|
import {
|
|
|
|
getMultipleVideoSendingSupportFeatureFlag,
|
|
|
|
getToolbarButtons,
|
|
|
|
isToolbarButtonEnabled
|
|
|
|
} from '../../../base/config/functions.web';
|
|
|
|
import { openDialog, toggleDialog } from '../../../base/dialog/actions';
|
2021-11-17 11:55:10 +00:00
|
|
|
import { isIosMobileBrowser, isMobileBrowser } from '../../../base/environment/utils';
|
2022-08-25 11:35:19 +00:00
|
|
|
import { translate } from '../../../base/i18n/functions';
|
2020-11-03 09:44:41 +00:00
|
|
|
import JitsiMeetJS from '../../../base/lib-jitsi-meet';
|
2017-02-16 23:02:40 +00:00
|
|
|
import {
|
2021-06-23 11:23:44 +00:00
|
|
|
raiseHand
|
2022-08-25 11:35:19 +00:00
|
|
|
} from '../../../base/participants/actions';
|
|
|
|
import {
|
|
|
|
getLocalParticipant,
|
|
|
|
hasRaisedHand
|
|
|
|
} from '../../../base/participants/functions';
|
|
|
|
import { connect } from '../../../base/redux/functions';
|
2022-10-11 10:47:54 +00:00
|
|
|
import { getLocalVideoTrack } from '../../../base/tracks/functions';
|
2022-10-06 10:09:40 +00:00
|
|
|
import ContextMenu from '../../../base/ui/components/web/ContextMenu';
|
|
|
|
import ContextMenuItemGroup from '../../../base/ui/components/web/ContextMenuItemGroup';
|
2022-10-11 10:47:54 +00:00
|
|
|
import { toggleChat } from '../../../chat/actions.web';
|
2022-08-25 11:35:19 +00:00
|
|
|
// @ts-ignore
|
2021-07-08 13:42:07 +00:00
|
|
|
import { ChatButton } from '../../../chat/components';
|
2022-08-25 11:35:19 +00:00
|
|
|
// @ts-ignore
|
2021-07-08 13:42:07 +00:00
|
|
|
import { EmbedMeetingButton } from '../../../embed-meeting';
|
2022-08-25 11:35:19 +00:00
|
|
|
// @ts-ignore
|
2019-10-08 12:27:35 +00:00
|
|
|
import { SharedDocumentButton } from '../../../etherpad';
|
2022-08-25 11:35:19 +00:00
|
|
|
// @ts-ignore
|
2021-07-08 13:42:07 +00:00
|
|
|
import { FeedbackButton } from '../../../feedback';
|
2022-03-11 13:00:49 +00:00
|
|
|
import { setGifMenuVisibility } from '../../../gifs/actions';
|
|
|
|
import { isGifEnabled } from '../../../gifs/functions';
|
2022-08-25 11:35:19 +00:00
|
|
|
// @ts-ignore
|
2021-08-20 08:53:11 +00:00
|
|
|
import { InviteButton } from '../../../invite/components/add-people-dialog';
|
2021-07-20 08:58:42 +00:00
|
|
|
import { isVpaasMeeting } from '../../../jaas/functions';
|
2022-08-25 11:35:19 +00:00
|
|
|
// @ts-ignore
|
2021-07-08 13:42:07 +00:00
|
|
|
import { KeyboardShortcutsButton } from '../../../keyboard-shortcuts';
|
2022-07-20 12:31:17 +00:00
|
|
|
import { NoiseSuppressionButton } from '../../../noise-suppression/components';
|
2021-04-21 13:48:05 +00:00
|
|
|
import {
|
|
|
|
close as closeParticipantsPane,
|
|
|
|
open as openParticipantsPane
|
|
|
|
} from '../../../participants-pane/actions';
|
2022-08-25 11:35:19 +00:00
|
|
|
// @ts-ignore
|
2021-10-22 13:23:52 +00:00
|
|
|
import { ParticipantsPaneButton } from '../../../participants-pane/components/web';
|
2021-04-21 13:48:05 +00:00
|
|
|
import { getParticipantsPaneOpen } from '../../../participants-pane/functions';
|
2021-07-20 11:31:49 +00:00
|
|
|
import { addReactionToBuffer } from '../../../reactions/actions.any';
|
2022-03-11 13:00:49 +00:00
|
|
|
import { toggleReactionsMenuVisibility } from '../../../reactions/actions.web';
|
2022-08-25 11:35:19 +00:00
|
|
|
import ReactionsMenuButton from '../../../reactions/components/web/ReactionsMenuButton';
|
2022-04-05 12:19:03 +00:00
|
|
|
import { REACTIONS } from '../../../reactions/constants';
|
2021-08-31 11:00:27 +00:00
|
|
|
import { isReactionsEnabled } from '../../../reactions/functions.any';
|
2018-05-16 14:00:16 +00:00
|
|
|
import {
|
2018-07-05 11:17:45 +00:00
|
|
|
LiveStreamButton,
|
|
|
|
RecordButton
|
2022-08-25 11:35:19 +00:00
|
|
|
// @ts-ignore
|
2018-05-16 14:00:16 +00:00
|
|
|
} from '../../../recording';
|
2022-03-31 13:11:44 +00:00
|
|
|
import { isSalesforceEnabled } from '../../../salesforce/functions';
|
2021-07-07 08:07:30 +00:00
|
|
|
import {
|
|
|
|
startScreenShareFlow
|
2022-10-28 10:07:58 +00:00
|
|
|
} from '../../../screen-share/actions.web';
|
|
|
|
// @ts-ignore
|
|
|
|
import ShareAudioButton from '../../../screen-share/components/web/ShareAudioButton';
|
|
|
|
import {
|
|
|
|
isScreenAudioSupported,
|
|
|
|
isScreenVideoShared
|
|
|
|
} from '../../../screen-share/functions';
|
2022-08-25 11:35:19 +00:00
|
|
|
// @ts-ignore
|
2021-12-10 16:23:27 +00:00
|
|
|
import SecurityDialogButton from '../../../security/components/security-dialog/web/SecurityDialogButton';
|
2022-08-25 11:35:19 +00:00
|
|
|
// @ts-ignore
|
2021-07-08 13:42:07 +00:00
|
|
|
import { SettingsButton } from '../../../settings';
|
2022-08-25 11:35:19 +00:00
|
|
|
// @ts-ignore
|
2021-03-03 14:37:38 +00:00
|
|
|
import { SharedVideoButton } from '../../../shared-video/components';
|
2022-08-25 11:35:19 +00:00
|
|
|
// @ts-ignore
|
2021-11-10 17:49:53 +00:00
|
|
|
import { SpeakerStatsButton } from '../../../speaker-stats/components/web';
|
2022-10-17 20:40:13 +00:00
|
|
|
import SpeakerStats from '../../../speaker-stats/components/web/SpeakerStats';
|
2020-05-20 10:57:03 +00:00
|
|
|
import {
|
|
|
|
ClosedCaptionButton
|
2022-08-25 11:35:19 +00:00
|
|
|
// @ts-ignore
|
2020-05-20 10:57:03 +00:00
|
|
|
} from '../../../subtitles';
|
2019-11-22 16:15:39 +00:00
|
|
|
import {
|
|
|
|
TileViewButton,
|
2020-07-23 13:12:25 +00:00
|
|
|
shouldDisplayTileView,
|
2019-11-22 16:15:39 +00:00
|
|
|
toggleTileView
|
2022-08-25 11:35:19 +00:00
|
|
|
// @ts-ignore
|
2019-11-22 16:15:39 +00:00
|
|
|
} from '../../../video-layout';
|
2022-08-25 11:35:19 +00:00
|
|
|
// @ts-ignore
|
2022-09-27 07:10:28 +00:00
|
|
|
import { VideoQualityButton, VideoQualityDialog } from '../../../video-quality/components';
|
2022-08-25 11:35:19 +00:00
|
|
|
// @ts-ignore
|
2022-10-07 20:51:43 +00:00
|
|
|
import { VideoBackgroundButton } from '../../../virtual-background';
|
2022-09-30 14:50:45 +00:00
|
|
|
import WhiteboardButton from '../../../whiteboard/components/web/WhiteboardButton';
|
2022-10-06 13:01:45 +00:00
|
|
|
import { isWhiteboardButtonVisible } from '../../../whiteboard/functions';
|
2018-04-20 11:24:14 +00:00
|
|
|
import {
|
|
|
|
setFullScreen,
|
2022-08-26 18:25:04 +00:00
|
|
|
setHangupMenuVisible,
|
2018-04-20 11:24:14 +00:00
|
|
|
setOverflowMenuVisible,
|
2021-01-15 11:43:09 +00:00
|
|
|
setToolbarHovered,
|
2021-04-14 17:30:19 +00:00
|
|
|
showToolbox
|
2018-05-10 23:01:55 +00:00
|
|
|
} from '../../actions';
|
2022-09-27 07:10:28 +00:00
|
|
|
import { NOTIFY_CLICK_MODE, NOT_APPLICABLE, THRESHOLDS } from '../../constants';
|
2022-01-05 20:27:42 +00:00
|
|
|
import { isDesktopShareButtonDisabled, isToolboxVisible } from '../../functions';
|
2022-10-04 13:02:49 +00:00
|
|
|
import { getJwtDisabledButtons } from '../../functions.any';
|
2022-08-25 11:35:19 +00:00
|
|
|
// @ts-ignore
|
2020-05-20 10:57:03 +00:00
|
|
|
import DownloadButton from '../DownloadButton';
|
2022-08-25 11:35:19 +00:00
|
|
|
// @ts-ignore
|
2018-05-10 23:01:55 +00:00
|
|
|
import HangupButton from '../HangupButton';
|
2022-08-25 11:35:19 +00:00
|
|
|
// @ts-ignore
|
2019-10-11 18:09:50 +00:00
|
|
|
import HelpButton from '../HelpButton';
|
2020-05-20 10:57:03 +00:00
|
|
|
|
2022-08-25 11:35:19 +00:00
|
|
|
// @ts-ignore
|
2020-05-20 10:57:03 +00:00
|
|
|
import AudioSettingsButton from './AudioSettingsButton';
|
2022-08-26 18:25:04 +00:00
|
|
|
import { EndConferenceButton } from './EndConferenceButton';
|
2022-08-25 11:35:19 +00:00
|
|
|
// @ts-ignore
|
2021-07-08 13:42:07 +00:00
|
|
|
import FullscreenButton from './FullscreenButton';
|
2022-08-26 18:25:04 +00:00
|
|
|
import HangupMenuButton from './HangupMenuButton';
|
|
|
|
import { LeaveConferenceButton } from './LeaveConferenceButton';
|
2022-08-25 11:35:19 +00:00
|
|
|
// @ts-ignore
|
2022-03-08 09:10:30 +00:00
|
|
|
import LinkToSalesforceButton from './LinkToSalesforceButton';
|
2022-08-25 11:35:19 +00:00
|
|
|
// @ts-ignore
|
2018-04-09 05:03:26 +00:00
|
|
|
import OverflowMenuButton from './OverflowMenuButton';
|
2022-08-25 11:35:19 +00:00
|
|
|
// @ts-ignore
|
2021-07-08 13:42:07 +00:00
|
|
|
import ProfileButton from './ProfileButton';
|
2022-08-25 11:35:19 +00:00
|
|
|
// @ts-ignore
|
2021-07-08 13:42:07 +00:00
|
|
|
import Separator from './Separator';
|
2022-08-25 11:35:19 +00:00
|
|
|
// @ts-ignore
|
2021-07-08 13:42:07 +00:00
|
|
|
import ShareDesktopButton from './ShareDesktopButton';
|
2022-08-25 11:35:19 +00:00
|
|
|
// @ts-ignore
|
2021-07-22 08:39:13 +00:00
|
|
|
import ToggleCameraButton from './ToggleCameraButton';
|
2022-08-25 11:35:19 +00:00
|
|
|
// @ts-ignore
|
2020-03-30 14:17:18 +00:00
|
|
|
import VideoSettingsButton from './VideoSettingsButton';
|
2018-04-09 05:03:26 +00:00
|
|
|
|
2018-05-11 02:10:26 +00:00
|
|
|
/**
|
|
|
|
* The type of the React {@code Component} props of {@link Toolbox}.
|
|
|
|
*/
|
2022-10-20 09:11:27 +00:00
|
|
|
interface IProps extends WithTranslation {
|
2018-04-09 05:03:26 +00:00
|
|
|
|
2021-05-14 07:10:46 +00:00
|
|
|
/**
|
|
|
|
* String showing if the virtual background type is desktop-share.
|
|
|
|
*/
|
2022-09-08 09:52:36 +00:00
|
|
|
_backgroundType: String;
|
2021-05-14 07:10:46 +00:00
|
|
|
|
2021-09-14 07:07:20 +00:00
|
|
|
/**
|
|
|
|
* Toolbar buttons which have their click exposed through the API.
|
|
|
|
*/
|
2022-08-25 11:35:19 +00:00
|
|
|
_buttonsWithNotifyClick: Array<string | {
|
|
|
|
key: string;
|
|
|
|
preventExecution: boolean;
|
2022-09-08 09:52:36 +00:00
|
|
|
}>;
|
2021-09-14 07:07:20 +00:00
|
|
|
|
2018-04-09 05:03:26 +00:00
|
|
|
/**
|
|
|
|
* Whether or not the chat feature is currently displayed.
|
|
|
|
*/
|
2022-09-08 09:52:36 +00:00
|
|
|
_chatOpen: boolean;
|
2018-04-09 05:03:26 +00:00
|
|
|
|
2021-03-23 12:06:43 +00:00
|
|
|
/**
|
|
|
|
* The width of the client.
|
|
|
|
*/
|
2022-09-08 09:52:36 +00:00
|
|
|
_clientWidth: number;
|
2021-03-23 12:06:43 +00:00
|
|
|
|
2018-04-09 05:03:26 +00:00
|
|
|
/**
|
|
|
|
* The {@code JitsiConference} for the current conference.
|
|
|
|
*/
|
2022-09-08 09:52:36 +00:00
|
|
|
_conference: Object;
|
2018-04-09 05:03:26 +00:00
|
|
|
|
2022-01-05 20:27:42 +00:00
|
|
|
/**
|
|
|
|
* Whether or not screensharing button is disabled.
|
|
|
|
*/
|
2022-09-08 09:52:36 +00:00
|
|
|
_desktopSharingButtonDisabled: boolean;
|
2022-01-05 20:27:42 +00:00
|
|
|
|
2018-04-09 05:03:26 +00:00
|
|
|
/**
|
|
|
|
* Whether or not screensharing is initialized.
|
|
|
|
*/
|
2022-09-08 09:52:36 +00:00
|
|
|
_desktopSharingEnabled: boolean;
|
2018-04-09 05:03:26 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Whether or not a dialog is displayed.
|
|
|
|
*/
|
2022-09-08 09:52:36 +00:00
|
|
|
_dialog: boolean;
|
2018-04-09 05:03:26 +00:00
|
|
|
|
2022-02-04 10:06:07 +00:00
|
|
|
/**
|
|
|
|
* Whether or not the toolbox is disabled. It is for recorders.
|
|
|
|
*/
|
2022-09-08 09:52:36 +00:00
|
|
|
_disabled: boolean;
|
2022-02-04 10:06:07 +00:00
|
|
|
|
2022-08-26 18:25:04 +00:00
|
|
|
/**
|
|
|
|
* Whether the end conference feature is supported.
|
|
|
|
*/
|
2022-09-08 09:52:36 +00:00
|
|
|
_endConferenceSupported: boolean;
|
2022-08-26 18:25:04 +00:00
|
|
|
|
2018-04-09 05:03:26 +00:00
|
|
|
/**
|
|
|
|
* Whether or not call feedback can be sent.
|
|
|
|
*/
|
2022-09-08 09:52:36 +00:00
|
|
|
_feedbackConfigured: boolean;
|
2018-04-09 05:03:26 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Whether or not the app is currently in full screen.
|
|
|
|
*/
|
2022-09-08 09:52:36 +00:00
|
|
|
_fullScreen: boolean;
|
2018-04-09 05:03:26 +00:00
|
|
|
|
2022-03-11 13:00:49 +00:00
|
|
|
/**
|
|
|
|
* Whether or not the GIFs feature is enabled.
|
|
|
|
*/
|
2022-09-08 09:52:36 +00:00
|
|
|
_gifsEnabled: boolean;
|
2022-03-11 13:00:49 +00:00
|
|
|
|
2022-08-26 18:25:04 +00:00
|
|
|
/**
|
|
|
|
* Whether the hangup menu is visible.
|
|
|
|
*/
|
2022-09-08 09:52:36 +00:00
|
|
|
_hangupMenuVisible: boolean;
|
2022-08-26 18:25:04 +00:00
|
|
|
|
2022-03-08 09:10:30 +00:00
|
|
|
/**
|
|
|
|
* Whether the app has Salesforce integration.
|
|
|
|
*/
|
2022-09-08 09:52:36 +00:00
|
|
|
_hasSalesforce: boolean;
|
2022-03-08 09:10:30 +00:00
|
|
|
|
2022-09-06 17:32:20 +00:00
|
|
|
/**
|
2021-11-17 11:55:10 +00:00
|
|
|
* Whether or not the app is running in an ios mobile browser.
|
|
|
|
*/
|
2022-09-08 09:52:36 +00:00
|
|
|
_isIosMobile: boolean;
|
2021-11-17 11:55:10 +00:00
|
|
|
|
2021-03-12 12:19:04 +00:00
|
|
|
/**
|
|
|
|
* Whether or not the app is running in mobile browser.
|
|
|
|
*/
|
2022-09-08 09:52:36 +00:00
|
|
|
_isMobile: boolean;
|
2021-03-12 12:19:04 +00:00
|
|
|
|
2019-11-22 16:15:39 +00:00
|
|
|
/**
|
2020-11-05 17:35:03 +00:00
|
|
|
* Whether or not the profile is disabled.
|
2019-11-22 16:15:39 +00:00
|
|
|
*/
|
2022-09-08 09:52:36 +00:00
|
|
|
_isProfileDisabled: boolean;
|
2019-11-22 16:15:39 +00:00
|
|
|
|
2020-09-23 09:09:07 +00:00
|
|
|
/**
|
2022-10-17 20:40:13 +00:00
|
|
|
* Whether or not speaker stats is disable.
|
|
|
|
*/
|
2022-11-08 10:24:32 +00:00
|
|
|
_isSpeakerStatsDisabled: boolean;
|
2022-10-17 20:40:13 +00:00
|
|
|
|
|
|
|
|
2022-11-08 10:24:32 +00:00
|
|
|
/**
|
2020-09-23 09:09:07 +00:00
|
|
|
* Whether or not the current meeting belongs to a JaaS user.
|
|
|
|
*/
|
2022-09-08 09:52:36 +00:00
|
|
|
_isVpaasMeeting: boolean;
|
2020-09-23 09:09:07 +00:00
|
|
|
|
2022-10-04 13:02:49 +00:00
|
|
|
/**
|
|
|
|
* The array of toolbar buttons disabled through jwt features.
|
|
|
|
*/
|
|
|
|
_jwtDisabledButons: string[];
|
|
|
|
|
2018-04-09 05:03:26 +00:00
|
|
|
/**
|
|
|
|
* The ID of the local participant.
|
|
|
|
*/
|
2022-09-08 09:52:36 +00:00
|
|
|
_localParticipantID: String;
|
2018-04-09 05:03:26 +00:00
|
|
|
|
2021-05-24 12:30:45 +00:00
|
|
|
/**
|
|
|
|
* The JitsiLocalTrack to display.
|
|
|
|
*/
|
2022-09-08 09:52:36 +00:00
|
|
|
_localVideo: Object;
|
2021-05-24 12:30:45 +00:00
|
|
|
|
2021-12-14 11:39:01 +00:00
|
|
|
/**
|
2022-07-05 21:37:06 +00:00
|
|
|
* Whether or not multi-stream send support is enabled.
|
|
|
|
*/
|
2022-09-08 09:52:36 +00:00
|
|
|
_multiStreamModeEnabled: boolean;
|
2022-07-05 21:37:06 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Whether or not the overflow menu is displayed in a drawer drawer.
|
2021-12-14 11:39:01 +00:00
|
|
|
*/
|
2022-09-08 09:52:36 +00:00
|
|
|
_overflowDrawer: boolean;
|
2021-12-14 11:39:01 +00:00
|
|
|
|
2018-04-20 11:24:14 +00:00
|
|
|
/**
|
|
|
|
* Whether or not the overflow menu is visible.
|
|
|
|
*/
|
2022-09-08 09:52:36 +00:00
|
|
|
_overflowMenuVisible: boolean;
|
2018-04-20 11:24:14 +00:00
|
|
|
|
2021-04-21 13:48:05 +00:00
|
|
|
/**
|
|
|
|
* Whether or not the participants pane is open.
|
|
|
|
*/
|
2022-09-08 09:52:36 +00:00
|
|
|
_participantsPaneOpen: boolean;
|
2021-04-21 13:48:05 +00:00
|
|
|
|
2018-04-09 05:03:26 +00:00
|
|
|
/**
|
|
|
|
* Whether or not the local participant's hand is raised.
|
|
|
|
*/
|
2022-09-08 09:52:36 +00:00
|
|
|
_raisedHand: boolean;
|
2018-04-09 05:03:26 +00:00
|
|
|
|
2021-08-31 11:00:27 +00:00
|
|
|
/**
|
|
|
|
* Whether or not reactions feature is enabled.
|
|
|
|
*/
|
2022-09-08 09:52:36 +00:00
|
|
|
_reactionsEnabled: boolean;
|
2021-08-31 11:00:27 +00:00
|
|
|
|
2018-04-09 05:03:26 +00:00
|
|
|
/**
|
2021-07-09 12:36:19 +00:00
|
|
|
* Whether or not the local participant is screenSharing.
|
2018-04-09 05:03:26 +00:00
|
|
|
*/
|
2022-09-08 09:52:36 +00:00
|
|
|
_screenSharing: boolean;
|
2018-04-09 05:03:26 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Whether or not the local participant is sharing a YouTube video.
|
|
|
|
*/
|
2022-09-08 09:52:36 +00:00
|
|
|
_sharingVideo: boolean;
|
2018-04-09 05:03:26 +00:00
|
|
|
|
2021-08-31 11:00:27 +00:00
|
|
|
/**
|
|
|
|
* Whether or not the tile view is enabled.
|
|
|
|
*/
|
2022-09-08 09:52:36 +00:00
|
|
|
_tileViewEnabled: boolean;
|
2021-08-31 11:00:27 +00:00
|
|
|
|
2021-07-09 12:36:19 +00:00
|
|
|
/**
|
|
|
|
* The enabled buttons.
|
|
|
|
*/
|
2022-09-08 09:52:36 +00:00
|
|
|
_toolbarButtons: Array<string>;
|
2021-07-09 12:36:19 +00:00
|
|
|
|
2018-04-09 05:03:26 +00:00
|
|
|
/**
|
2022-08-25 11:35:19 +00:00
|
|
|
* Returns the selected virtual source object.
|
2018-04-09 05:03:26 +00:00
|
|
|
*/
|
2022-09-08 09:52:36 +00:00
|
|
|
_virtualSource: any;
|
2018-04-09 05:03:26 +00:00
|
|
|
|
2021-05-24 12:30:45 +00:00
|
|
|
/**
|
2022-08-25 11:35:19 +00:00
|
|
|
* Flag showing whether toolbar is visible.
|
2021-05-24 12:30:45 +00:00
|
|
|
*/
|
2022-09-08 09:52:36 +00:00
|
|
|
_visible: boolean;
|
2021-07-22 10:17:42 +00:00
|
|
|
|
2022-09-30 14:50:45 +00:00
|
|
|
/**
|
|
|
|
* Whether the whiteboard is visible.
|
|
|
|
*/
|
|
|
|
_whiteboardEnabled: boolean;
|
|
|
|
|
2021-11-15 08:37:54 +00:00
|
|
|
/**
|
|
|
|
* An object containing the CSS classes.
|
|
|
|
*/
|
2022-09-08 09:52:36 +00:00
|
|
|
classes: any;
|
2021-11-15 08:37:54 +00:00
|
|
|
|
2018-04-09 05:03:26 +00:00
|
|
|
/**
|
|
|
|
* Invoked to active other features of the app.
|
|
|
|
*/
|
2022-09-08 09:52:36 +00:00
|
|
|
dispatch: Function;
|
2018-04-09 05:03:26 +00:00
|
|
|
|
2021-08-20 08:53:11 +00:00
|
|
|
/**
|
|
|
|
* Explicitly passed array with the buttons which this Toolbox should display.
|
|
|
|
*/
|
2022-09-08 09:52:36 +00:00
|
|
|
toolbarButtons: Array<string>;
|
2022-08-25 11:35:19 +00:00
|
|
|
}
|
2021-09-02 11:42:39 +00:00
|
|
|
|
2022-04-05 12:19:03 +00:00
|
|
|
const styles = () => {
|
2021-11-15 08:37:54 +00:00
|
|
|
return {
|
2022-04-05 12:19:03 +00:00
|
|
|
contextMenu: {
|
2022-09-13 07:36:00 +00:00
|
|
|
position: 'relative' as const,
|
2022-04-05 12:19:03 +00:00
|
|
|
right: 'auto',
|
|
|
|
maxHeight: 'inherit',
|
2022-10-24 09:51:18 +00:00
|
|
|
margin: 0,
|
|
|
|
marginBottom: '8px'
|
2022-08-26 18:25:04 +00:00
|
|
|
},
|
2022-09-13 07:36:00 +00:00
|
|
|
|
2022-08-26 18:25:04 +00:00
|
|
|
hangupMenu: {
|
2022-09-13 07:36:00 +00:00
|
|
|
position: 'relative' as const,
|
2022-08-26 18:25:04 +00:00
|
|
|
right: 'auto',
|
|
|
|
display: 'flex',
|
2022-09-13 07:36:00 +00:00
|
|
|
flexDirection: 'column' as const,
|
2022-08-26 18:25:04 +00:00
|
|
|
rowGap: '8px',
|
|
|
|
margin: 0,
|
2022-10-25 13:11:55 +00:00
|
|
|
padding: '16px',
|
|
|
|
marginBottom: '8px'
|
2021-11-15 08:37:54 +00:00
|
|
|
}
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2017-02-16 23:02:40 +00:00
|
|
|
/**
|
2017-04-01 05:52:40 +00:00
|
|
|
* Implements the conference toolbox on React/Web.
|
2018-04-09 05:03:26 +00:00
|
|
|
*
|
2021-11-04 21:10:43 +00:00
|
|
|
* @augments Component
|
2017-02-16 23:02:40 +00:00
|
|
|
*/
|
2022-10-20 09:11:27 +00:00
|
|
|
class Toolbox extends Component<IProps> {
|
2017-02-16 23:02:40 +00:00
|
|
|
/**
|
2018-04-09 05:03:26 +00:00
|
|
|
* Initializes a new {@code Toolbox} instance.
|
2017-02-16 23:02:40 +00:00
|
|
|
*
|
2022-10-20 09:11:27 +00:00
|
|
|
* @param {IProps} props - The read-only React {@code Component} props with
|
2018-04-09 05:03:26 +00:00
|
|
|
* which the new instance is to be initialized.
|
2017-02-16 23:02:40 +00:00
|
|
|
*/
|
2022-10-20 09:11:27 +00:00
|
|
|
constructor(props: IProps) {
|
2018-04-09 05:03:26 +00:00
|
|
|
super(props);
|
2017-04-06 18:43:36 +00:00
|
|
|
|
2018-04-09 05:03:26 +00:00
|
|
|
// Bind event handlers so they are only bound once per instance.
|
|
|
|
this._onMouseOut = this._onMouseOut.bind(this);
|
|
|
|
this._onMouseOver = this._onMouseOver.bind(this);
|
2022-08-26 18:25:04 +00:00
|
|
|
this._onSetHangupVisible = this._onSetHangupVisible.bind(this);
|
2018-04-09 05:03:26 +00:00
|
|
|
this._onSetOverflowVisible = this._onSetOverflowVisible.bind(this);
|
2021-01-15 11:43:09 +00:00
|
|
|
this._onTabIn = this._onTabIn.bind(this);
|
2017-02-16 23:02:40 +00:00
|
|
|
|
2018-04-09 05:03:26 +00:00
|
|
|
this._onShortcutToggleChat = this._onShortcutToggleChat.bind(this);
|
2019-10-11 14:51:42 +00:00
|
|
|
this._onShortcutToggleFullScreen = this._onShortcutToggleFullScreen.bind(this);
|
2021-04-21 13:48:05 +00:00
|
|
|
this._onShortcutToggleParticipantsPane = this._onShortcutToggleParticipantsPane.bind(this);
|
2019-10-11 14:51:42 +00:00
|
|
|
this._onShortcutToggleRaiseHand = this._onShortcutToggleRaiseHand.bind(this);
|
|
|
|
this._onShortcutToggleScreenshare = this._onShortcutToggleScreenshare.bind(this);
|
|
|
|
this._onShortcutToggleVideoQuality = this._onShortcutToggleVideoQuality.bind(this);
|
2021-04-21 13:48:05 +00:00
|
|
|
this._onToolbarToggleParticipantsPane = this._onToolbarToggleParticipantsPane.bind(this);
|
2019-10-11 14:51:42 +00:00
|
|
|
this._onToolbarOpenVideoQuality = this._onToolbarOpenVideoQuality.bind(this);
|
2018-04-09 05:03:26 +00:00
|
|
|
this._onToolbarToggleChat = this._onToolbarToggleChat.bind(this);
|
2019-10-11 14:51:42 +00:00
|
|
|
this._onToolbarToggleFullScreen = this._onToolbarToggleFullScreen.bind(this);
|
2021-07-22 10:17:42 +00:00
|
|
|
this._onToolbarToggleRaiseHand = this._onToolbarToggleRaiseHand.bind(this);
|
2019-10-11 14:51:42 +00:00
|
|
|
this._onToolbarToggleScreenshare = this._onToolbarToggleScreenshare.bind(this);
|
2019-11-22 16:15:39 +00:00
|
|
|
this._onShortcutToggleTileView = this._onShortcutToggleTileView.bind(this);
|
2022-10-17 20:40:13 +00:00
|
|
|
this._onShortcutSpeakerStats = this._onShortcutSpeakerStats.bind(this);
|
2021-06-10 12:48:44 +00:00
|
|
|
this._onEscKey = this._onEscKey.bind(this);
|
2018-04-09 05:03:26 +00:00
|
|
|
}
|
2017-02-16 23:02:40 +00:00
|
|
|
|
|
|
|
/**
|
2018-04-09 05:03:26 +00:00
|
|
|
* Sets keyboard shortcuts for to trigger ToolbarButtons actions.
|
2017-02-16 23:02:40 +00:00
|
|
|
*
|
2018-04-09 05:03:26 +00:00
|
|
|
* @inheritdoc
|
2017-02-16 23:02:40 +00:00
|
|
|
* @returns {void}
|
|
|
|
*/
|
2018-04-09 05:03:26 +00:00
|
|
|
componentDidMount() {
|
2022-10-17 20:40:13 +00:00
|
|
|
const { _toolbarButtons, t, dispatch, _reactionsEnabled, _gifsEnabled, _isSpeakerStatsDisabled } = this.props;
|
|
|
|
|
2018-04-09 05:03:26 +00:00
|
|
|
const KEYBOARD_SHORTCUTS = [
|
2021-07-09 12:36:19 +00:00
|
|
|
isToolbarButtonEnabled('videoquality', _toolbarButtons) && {
|
2019-07-28 15:36:11 +00:00
|
|
|
character: 'A',
|
|
|
|
exec: this._onShortcutToggleVideoQuality,
|
2020-12-08 14:01:16 +00:00
|
|
|
helpDescription: 'toolbar.callQuality'
|
2019-07-28 15:36:11 +00:00
|
|
|
},
|
2021-07-09 12:36:19 +00:00
|
|
|
isToolbarButtonEnabled('chat', _toolbarButtons) && {
|
2018-04-09 05:03:26 +00:00
|
|
|
character: 'C',
|
|
|
|
exec: this._onShortcutToggleChat,
|
|
|
|
helpDescription: 'keyboardShortcuts.toggleChat'
|
|
|
|
},
|
2021-07-09 12:36:19 +00:00
|
|
|
isToolbarButtonEnabled('desktop', _toolbarButtons) && {
|
2018-04-09 05:03:26 +00:00
|
|
|
character: 'D',
|
|
|
|
exec: this._onShortcutToggleScreenshare,
|
|
|
|
helpDescription: 'keyboardShortcuts.toggleScreensharing'
|
|
|
|
},
|
2021-07-09 12:36:19 +00:00
|
|
|
isToolbarButtonEnabled('participants-pane', _toolbarButtons) && {
|
2021-04-21 13:48:05 +00:00
|
|
|
character: 'P',
|
|
|
|
exec: this._onShortcutToggleParticipantsPane,
|
|
|
|
helpDescription: 'keyboardShortcuts.toggleParticipantsPane'
|
|
|
|
},
|
2021-07-09 12:36:19 +00:00
|
|
|
isToolbarButtonEnabled('raisehand', _toolbarButtons) && {
|
2018-04-09 05:03:26 +00:00
|
|
|
character: 'R',
|
|
|
|
exec: this._onShortcutToggleRaiseHand,
|
|
|
|
helpDescription: 'keyboardShortcuts.raiseHand'
|
|
|
|
},
|
2021-07-09 12:36:19 +00:00
|
|
|
isToolbarButtonEnabled('fullscreen', _toolbarButtons) && {
|
2018-04-09 05:03:26 +00:00
|
|
|
character: 'S',
|
|
|
|
exec: this._onShortcutToggleFullScreen,
|
|
|
|
helpDescription: 'keyboardShortcuts.fullScreen'
|
2019-11-22 16:15:39 +00:00
|
|
|
},
|
2021-07-09 12:36:19 +00:00
|
|
|
isToolbarButtonEnabled('tileview', _toolbarButtons) && {
|
2019-11-22 16:15:39 +00:00
|
|
|
character: 'W',
|
|
|
|
exec: this._onShortcutToggleTileView,
|
|
|
|
helpDescription: 'toolbar.tileViewToggle'
|
2022-10-17 20:40:13 +00:00
|
|
|
},
|
|
|
|
!_isSpeakerStatsDisabled && isToolbarButtonEnabled('stats', _toolbarButtons) && {
|
|
|
|
character: 'T',
|
|
|
|
exec: this._onShortcutSpeakerStats,
|
|
|
|
helpDescription: 'keyboardShortcuts.showSpeakerStats'
|
2018-04-09 05:03:26 +00:00
|
|
|
}
|
|
|
|
];
|
|
|
|
|
|
|
|
KEYBOARD_SHORTCUTS.forEach(shortcut => {
|
|
|
|
if (typeof shortcut === 'object') {
|
|
|
|
APP.keyboardshortcut.registerShortcut(
|
|
|
|
shortcut.character,
|
|
|
|
null,
|
|
|
|
shortcut.exec,
|
|
|
|
shortcut.helpDescription);
|
|
|
|
}
|
|
|
|
});
|
2021-07-20 11:31:49 +00:00
|
|
|
|
2021-09-21 17:30:24 +00:00
|
|
|
if (_reactionsEnabled) {
|
2021-07-22 10:17:42 +00:00
|
|
|
const REACTION_SHORTCUTS = Object.keys(REACTIONS).map(key => {
|
|
|
|
const onShortcutSendReaction = () => {
|
|
|
|
dispatch(addReactionToBuffer(key));
|
|
|
|
sendAnalytics(createShortcutEvent(
|
|
|
|
`reaction.${key}`
|
|
|
|
));
|
|
|
|
};
|
|
|
|
|
|
|
|
return {
|
|
|
|
character: REACTIONS[key].shortcutChar,
|
|
|
|
exec: onShortcutSendReaction,
|
|
|
|
helpDescription: t(`toolbar.reaction${key.charAt(0).toUpperCase()}${key.slice(1)}`),
|
|
|
|
altKey: true
|
|
|
|
};
|
|
|
|
});
|
|
|
|
|
|
|
|
REACTION_SHORTCUTS.forEach(shortcut => {
|
|
|
|
APP.keyboardshortcut.registerShortcut(
|
|
|
|
shortcut.character,
|
|
|
|
null,
|
|
|
|
shortcut.exec,
|
|
|
|
shortcut.helpDescription,
|
|
|
|
shortcut.altKey);
|
|
|
|
});
|
2022-03-11 13:00:49 +00:00
|
|
|
|
|
|
|
if (_gifsEnabled) {
|
|
|
|
const onGifShortcut = () => {
|
|
|
|
batch(() => {
|
|
|
|
dispatch(toggleReactionsMenuVisibility());
|
|
|
|
dispatch(setGifMenuVisibility(true));
|
|
|
|
});
|
|
|
|
};
|
|
|
|
|
|
|
|
APP.keyboardshortcut.registerShortcut(
|
|
|
|
'G',
|
|
|
|
null,
|
|
|
|
onGifShortcut,
|
|
|
|
t('keyboardShortcuts.giphyMenu')
|
|
|
|
);
|
|
|
|
}
|
2021-07-22 10:17:42 +00:00
|
|
|
}
|
2018-04-09 05:03:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Update the visibility of the {@code OverflowMenuButton}.
|
|
|
|
*
|
|
|
|
* @inheritdoc
|
|
|
|
*/
|
2022-10-20 09:11:27 +00:00
|
|
|
componentDidUpdate(prevProps: IProps) {
|
2022-08-26 18:25:04 +00:00
|
|
|
const { _dialog, _visible, dispatch } = this.props;
|
2021-09-14 07:43:52 +00:00
|
|
|
|
2018-04-09 05:03:26 +00:00
|
|
|
|
2018-10-29 02:09:50 +00:00
|
|
|
if (prevProps._overflowMenuVisible
|
|
|
|
&& !prevProps._dialog
|
2021-09-14 07:43:52 +00:00
|
|
|
&& _dialog) {
|
2018-04-09 05:03:26 +00:00
|
|
|
this._onSetOverflowVisible(false);
|
2021-09-14 07:43:52 +00:00
|
|
|
dispatch(setToolbarHovered(false));
|
2018-04-09 05:03:26 +00:00
|
|
|
}
|
2022-08-26 18:25:04 +00:00
|
|
|
if (prevProps._hangupMenuVisible
|
|
|
|
&& prevProps._visible
|
|
|
|
&& !_visible) {
|
|
|
|
this._onSetHangupVisible(false);
|
|
|
|
dispatch(setToolbarHovered(false));
|
|
|
|
}
|
2018-04-09 05:03:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Removes keyboard shortcuts registered by this component.
|
|
|
|
*
|
|
|
|
* @inheritdoc
|
|
|
|
* @returns {void}
|
|
|
|
*/
|
|
|
|
componentWillUnmount() {
|
2019-07-28 15:36:11 +00:00
|
|
|
[ 'A', 'C', 'D', 'R', 'S' ].forEach(letter =>
|
2018-04-09 05:03:26 +00:00
|
|
|
APP.keyboardshortcut.unregisterShortcut(letter));
|
2021-07-20 11:31:49 +00:00
|
|
|
|
2021-09-21 17:30:24 +00:00
|
|
|
if (this.props._reactionsEnabled) {
|
2021-07-22 10:17:42 +00:00
|
|
|
Object.keys(REACTIONS).map(key => REACTIONS[key].shortcutChar)
|
|
|
|
.forEach(letter =>
|
|
|
|
APP.keyboardshortcut.unregisterShortcut(letter, true));
|
|
|
|
}
|
2017-02-16 23:02:40 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Implements React's {@link Component#render()}.
|
|
|
|
*
|
|
|
|
* @inheritdoc
|
|
|
|
* @returns {ReactElement}
|
|
|
|
*/
|
2018-04-09 05:03:26 +00:00
|
|
|
render() {
|
2022-02-04 10:06:07 +00:00
|
|
|
if (this.props._disabled) {
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
2021-08-20 08:53:11 +00:00
|
|
|
const { _chatOpen, _visible, _toolbarButtons } = this.props;
|
2018-04-09 05:03:26 +00:00
|
|
|
const rootClassNames = `new-toolbox ${_visible ? 'visible' : ''} ${
|
2021-08-20 08:53:11 +00:00
|
|
|
_toolbarButtons.length ? '' : 'no-buttons'} ${_chatOpen ? 'shift-right' : ''}`;
|
2018-04-09 05:03:26 +00:00
|
|
|
|
2017-02-16 23:02:40 +00:00
|
|
|
return (
|
2018-04-09 05:03:26 +00:00
|
|
|
<div
|
|
|
|
className = { rootClassNames }
|
2021-04-19 11:18:28 +00:00
|
|
|
id = 'new-toolbox'>
|
2019-02-20 23:35:19 +00:00
|
|
|
{ this._renderToolboxContent() }
|
2017-02-16 23:02:40 +00:00
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2021-06-10 12:48:44 +00:00
|
|
|
/**
|
2022-08-26 18:25:04 +00:00
|
|
|
* Key handler for overflow/hangup menus.
|
2021-06-10 12:48:44 +00:00
|
|
|
*
|
|
|
|
* @param {KeyboardEvent} e - Esc key click to close the popup.
|
|
|
|
* @returns {void}
|
|
|
|
*/
|
2022-09-06 17:32:20 +00:00
|
|
|
_onEscKey(e?: React.KeyboardEvent) {
|
|
|
|
if (e?.key === 'Escape') {
|
|
|
|
e?.stopPropagation();
|
2022-08-26 18:25:04 +00:00
|
|
|
this._closeHangupMenuIfOpen();
|
2021-06-10 12:48:44 +00:00
|
|
|
this._closeOverflowMenuIfOpen();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-08-26 18:25:04 +00:00
|
|
|
/**
|
|
|
|
* Closes the hangup menu if opened.
|
|
|
|
*
|
|
|
|
* @private
|
|
|
|
* @returns {void}
|
|
|
|
*/
|
|
|
|
_closeHangupMenuIfOpen() {
|
|
|
|
const { dispatch, _hangupMenuVisible } = this.props;
|
|
|
|
|
|
|
|
_hangupMenuVisible && dispatch(setHangupMenuVisible(false));
|
|
|
|
}
|
|
|
|
|
2021-02-23 11:09:22 +00:00
|
|
|
/**
|
|
|
|
* Closes the overflow menu if opened.
|
|
|
|
*
|
|
|
|
* @private
|
|
|
|
* @returns {void}
|
|
|
|
*/
|
|
|
|
_closeOverflowMenuIfOpen() {
|
|
|
|
const { dispatch, _overflowMenuVisible } = this.props;
|
|
|
|
|
|
|
|
_overflowMenuVisible && dispatch(setOverflowMenuVisible(false));
|
|
|
|
}
|
|
|
|
|
2018-04-09 05:03:26 +00:00
|
|
|
/**
|
2019-07-28 15:36:11 +00:00
|
|
|
* Dispatches an action to open the video quality dialog.
|
2018-04-09 05:03:26 +00:00
|
|
|
*
|
|
|
|
* @private
|
|
|
|
* @returns {void}
|
|
|
|
*/
|
|
|
|
_doOpenVideoQuality() {
|
|
|
|
this.props.dispatch(openDialog(VideoQualityDialog));
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Dispatches an action to toggle the display of chat.
|
|
|
|
*
|
|
|
|
* @private
|
|
|
|
* @returns {void}
|
|
|
|
*/
|
|
|
|
_doToggleChat() {
|
|
|
|
this.props.dispatch(toggleChat());
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Dispatches an action to toggle screensharing.
|
|
|
|
*
|
|
|
|
* @private
|
|
|
|
* @returns {void}
|
|
|
|
*/
|
|
|
|
_doToggleFullScreen() {
|
|
|
|
const fullScreen = !this.props._fullScreen;
|
|
|
|
|
|
|
|
this.props.dispatch(setFullScreen(fullScreen));
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Dispatches an action to toggle the local participant's raised hand state.
|
|
|
|
*
|
|
|
|
* @private
|
|
|
|
* @returns {void}
|
|
|
|
*/
|
|
|
|
_doToggleRaiseHand() {
|
2021-10-21 09:40:57 +00:00
|
|
|
const { _raisedHand } = this.props;
|
2018-04-09 05:03:26 +00:00
|
|
|
|
2021-10-21 09:40:57 +00:00
|
|
|
this.props.dispatch(raiseHand(!_raisedHand));
|
2018-04-09 05:03:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Dispatches an action to toggle screensharing.
|
|
|
|
*
|
|
|
|
* @private
|
2021-04-22 12:24:17 +00:00
|
|
|
* @param {boolean} enabled - The state to toggle screen sharing to.
|
2021-04-12 07:37:39 +00:00
|
|
|
* @param {boolean} audioOnly - Only share system audio.
|
2018-04-09 05:03:26 +00:00
|
|
|
* @returns {void}
|
|
|
|
*/
|
2021-07-07 08:07:30 +00:00
|
|
|
_doToggleScreenshare() {
|
2021-07-08 13:42:07 +00:00
|
|
|
const {
|
2022-01-05 20:27:42 +00:00
|
|
|
_desktopSharingButtonDisabled,
|
2021-07-08 13:42:07 +00:00
|
|
|
_desktopSharingEnabled,
|
2022-03-15 17:24:49 +00:00
|
|
|
_screenSharing,
|
2021-07-08 13:42:07 +00:00
|
|
|
dispatch
|
|
|
|
} = this.props;
|
|
|
|
|
2022-01-05 20:27:42 +00:00
|
|
|
if (_desktopSharingEnabled && !_desktopSharingButtonDisabled) {
|
2022-03-15 17:24:49 +00:00
|
|
|
dispatch(startScreenShareFlow(!_screenSharing));
|
2017-02-16 23:02:40 +00:00
|
|
|
}
|
2018-04-09 05:03:26 +00:00
|
|
|
}
|
2017-02-16 23:02:40 +00:00
|
|
|
|
2019-07-28 15:36:11 +00:00
|
|
|
/**
|
|
|
|
* Dispatches an action to toggle the video quality dialog.
|
|
|
|
*
|
|
|
|
* @private
|
|
|
|
* @returns {void}
|
|
|
|
*/
|
|
|
|
_doToggleVideoQuality() {
|
|
|
|
this.props.dispatch(toggleDialog(VideoQualityDialog));
|
|
|
|
}
|
|
|
|
|
2019-11-22 16:15:39 +00:00
|
|
|
/**
|
|
|
|
* Dispaches an action to toggle tile view.
|
|
|
|
*
|
|
|
|
* @private
|
|
|
|
* @returns {void}
|
|
|
|
*/
|
|
|
|
_doToggleTileView() {
|
|
|
|
this.props.dispatch(toggleTileView());
|
|
|
|
}
|
|
|
|
|
2021-07-08 13:42:07 +00:00
|
|
|
/**
|
|
|
|
* Returns all buttons that could be rendered.
|
|
|
|
*
|
|
|
|
* @param {Object} state - The redux state.
|
|
|
|
* @returns {Object} The button maps mainMenuButtons and overflowMenuButtons.
|
|
|
|
*/
|
|
|
|
_getAllButtons() {
|
|
|
|
const {
|
|
|
|
_feedbackConfigured,
|
2022-10-17 20:40:13 +00:00
|
|
|
_hasSalesforce,
|
2021-11-17 11:55:10 +00:00
|
|
|
_isIosMobile,
|
2021-07-08 13:42:07 +00:00
|
|
|
_isMobile,
|
2022-10-17 20:40:13 +00:00
|
|
|
_isSpeakerStatsDisabled,
|
2022-07-05 21:37:06 +00:00
|
|
|
_multiStreamModeEnabled,
|
2022-09-30 14:50:45 +00:00
|
|
|
_screenSharing,
|
|
|
|
_whiteboardEnabled
|
2021-07-08 13:42:07 +00:00
|
|
|
} = this.props;
|
|
|
|
|
|
|
|
const microphone = {
|
|
|
|
key: 'microphone',
|
|
|
|
Content: AudioSettingsButton,
|
|
|
|
group: 0
|
|
|
|
};
|
|
|
|
|
|
|
|
const camera = {
|
|
|
|
key: 'camera',
|
|
|
|
Content: VideoSettingsButton,
|
|
|
|
group: 0
|
|
|
|
};
|
|
|
|
|
|
|
|
const profile = this._isProfileVisible() && {
|
|
|
|
key: 'profile',
|
|
|
|
Content: ProfileButton,
|
|
|
|
group: 1
|
|
|
|
};
|
|
|
|
|
|
|
|
const chat = {
|
|
|
|
key: 'chat',
|
|
|
|
Content: ChatButton,
|
|
|
|
handleClick: this._onToolbarToggleChat,
|
|
|
|
group: 2
|
|
|
|
};
|
|
|
|
|
|
|
|
const desktop = this._showDesktopSharingButton() && {
|
|
|
|
key: 'desktop',
|
|
|
|
Content: ShareDesktopButton,
|
|
|
|
handleClick: this._onToolbarToggleScreenshare,
|
|
|
|
group: 2
|
|
|
|
};
|
|
|
|
|
|
|
|
const raisehand = {
|
|
|
|
key: 'raisehand',
|
2021-09-21 17:30:24 +00:00
|
|
|
Content: ReactionsMenuButton,
|
|
|
|
handleClick: this._onToolbarToggleRaiseHand,
|
2021-07-08 13:42:07 +00:00
|
|
|
group: 2
|
|
|
|
};
|
|
|
|
|
|
|
|
const participants = {
|
|
|
|
key: 'participants-pane',
|
|
|
|
Content: ParticipantsPaneButton,
|
|
|
|
handleClick: this._onToolbarToggleParticipantsPane,
|
|
|
|
group: 2
|
|
|
|
};
|
|
|
|
|
2021-08-20 08:53:11 +00:00
|
|
|
const invite = {
|
|
|
|
key: 'invite',
|
|
|
|
Content: InviteButton,
|
|
|
|
group: 2
|
|
|
|
};
|
|
|
|
|
2021-07-08 13:42:07 +00:00
|
|
|
const tileview = {
|
|
|
|
key: 'tileview',
|
|
|
|
Content: TileViewButton,
|
|
|
|
group: 2
|
|
|
|
};
|
|
|
|
|
2021-07-22 08:39:13 +00:00
|
|
|
const toggleCamera = {
|
|
|
|
key: 'toggle-camera',
|
|
|
|
Content: ToggleCameraButton,
|
|
|
|
group: 2
|
|
|
|
};
|
|
|
|
|
2021-07-08 13:42:07 +00:00
|
|
|
const videoQuality = {
|
|
|
|
key: 'videoquality',
|
|
|
|
Content: VideoQualityButton,
|
|
|
|
handleClick: this._onToolbarOpenVideoQuality,
|
|
|
|
group: 2
|
|
|
|
};
|
|
|
|
|
2021-11-17 11:55:10 +00:00
|
|
|
const fullscreen = !_isIosMobile && {
|
2021-07-08 13:42:07 +00:00
|
|
|
key: 'fullscreen',
|
|
|
|
Content: FullscreenButton,
|
|
|
|
handleClick: this._onToolbarToggleFullScreen,
|
|
|
|
group: 2
|
|
|
|
};
|
|
|
|
|
|
|
|
const security = {
|
|
|
|
key: 'security',
|
2021-07-22 12:26:56 +00:00
|
|
|
alias: 'info',
|
2021-07-08 13:42:07 +00:00
|
|
|
Content: SecurityDialogButton,
|
|
|
|
group: 2
|
|
|
|
};
|
|
|
|
|
|
|
|
const cc = {
|
|
|
|
key: 'closedcaptions',
|
|
|
|
Content: ClosedCaptionButton,
|
|
|
|
group: 2
|
|
|
|
};
|
|
|
|
|
|
|
|
const recording = {
|
|
|
|
key: 'recording',
|
|
|
|
Content: RecordButton,
|
|
|
|
group: 2
|
|
|
|
};
|
|
|
|
|
2021-08-05 09:36:25 +00:00
|
|
|
const livestreaming = {
|
|
|
|
key: 'livestreaming',
|
|
|
|
Content: LiveStreamButton,
|
|
|
|
group: 2
|
|
|
|
};
|
|
|
|
|
2022-03-08 09:10:30 +00:00
|
|
|
const linkToSalesforce = _hasSalesforce && {
|
|
|
|
key: 'linktosalesforce',
|
|
|
|
Content: LinkToSalesforceButton,
|
|
|
|
group: 2
|
|
|
|
};
|
|
|
|
|
2021-07-08 13:42:07 +00:00
|
|
|
const shareVideo = {
|
|
|
|
key: 'sharedvideo',
|
|
|
|
Content: SharedVideoButton,
|
|
|
|
group: 3
|
|
|
|
};
|
|
|
|
|
|
|
|
const shareAudio = this._showAudioSharingButton() && {
|
|
|
|
key: 'shareaudio',
|
|
|
|
Content: ShareAudioButton,
|
|
|
|
group: 3
|
|
|
|
};
|
|
|
|
|
2022-07-20 12:31:17 +00:00
|
|
|
const noiseSuppression = {
|
|
|
|
key: 'noisesuppression',
|
|
|
|
Content: NoiseSuppressionButton,
|
|
|
|
group: 3
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2022-09-30 14:50:45 +00:00
|
|
|
const whiteboard = _whiteboardEnabled && {
|
|
|
|
key: 'whiteboard',
|
|
|
|
Content: WhiteboardButton,
|
|
|
|
group: 3
|
|
|
|
};
|
|
|
|
|
2021-07-08 13:42:07 +00:00
|
|
|
const etherpad = {
|
|
|
|
key: 'etherpad',
|
|
|
|
Content: SharedDocumentButton,
|
|
|
|
group: 3
|
|
|
|
};
|
|
|
|
|
2022-07-05 21:37:06 +00:00
|
|
|
const virtualBackground = (_multiStreamModeEnabled || !_screenSharing) && {
|
2021-07-08 13:42:07 +00:00
|
|
|
key: 'select-background',
|
|
|
|
Content: VideoBackgroundButton,
|
|
|
|
group: 3
|
|
|
|
};
|
|
|
|
|
2022-10-17 20:40:13 +00:00
|
|
|
const speakerStats = !_isSpeakerStatsDisabled && {
|
2021-07-08 13:42:07 +00:00
|
|
|
key: 'stats',
|
|
|
|
Content: SpeakerStatsButton,
|
|
|
|
group: 3
|
|
|
|
};
|
|
|
|
|
|
|
|
const settings = {
|
|
|
|
key: 'settings',
|
|
|
|
Content: SettingsButton,
|
|
|
|
group: 4
|
|
|
|
};
|
|
|
|
|
|
|
|
const shortcuts = !_isMobile && keyboardShortcut.getEnabled() && {
|
|
|
|
key: 'shortcuts',
|
|
|
|
Content: KeyboardShortcutsButton,
|
|
|
|
group: 4
|
|
|
|
};
|
|
|
|
|
|
|
|
const embed = this._isEmbedMeetingVisible() && {
|
|
|
|
key: 'embedmeeting',
|
|
|
|
Content: EmbedMeetingButton,
|
|
|
|
group: 4
|
|
|
|
};
|
|
|
|
|
|
|
|
const feedback = _feedbackConfigured && {
|
|
|
|
key: 'feedback',
|
|
|
|
Content: FeedbackButton,
|
|
|
|
group: 4
|
|
|
|
};
|
|
|
|
|
|
|
|
const download = {
|
|
|
|
key: 'download',
|
|
|
|
Content: DownloadButton,
|
|
|
|
group: 4
|
|
|
|
};
|
|
|
|
|
|
|
|
const help = {
|
|
|
|
key: 'help',
|
|
|
|
Content: HelpButton,
|
|
|
|
group: 4
|
|
|
|
};
|
|
|
|
|
|
|
|
return {
|
|
|
|
microphone,
|
|
|
|
camera,
|
|
|
|
profile,
|
|
|
|
desktop,
|
|
|
|
chat,
|
|
|
|
raisehand,
|
|
|
|
participants,
|
2021-08-20 08:53:11 +00:00
|
|
|
invite,
|
2021-07-08 13:42:07 +00:00
|
|
|
tileview,
|
2021-07-22 08:39:13 +00:00
|
|
|
toggleCamera,
|
2021-07-08 13:42:07 +00:00
|
|
|
videoQuality,
|
|
|
|
fullscreen,
|
|
|
|
security,
|
|
|
|
cc,
|
|
|
|
recording,
|
2021-08-05 09:36:25 +00:00
|
|
|
livestreaming,
|
2022-03-08 09:10:30 +00:00
|
|
|
linkToSalesforce,
|
2021-07-08 13:42:07 +00:00
|
|
|
shareVideo,
|
|
|
|
shareAudio,
|
2022-07-20 12:31:17 +00:00
|
|
|
noiseSuppression,
|
2022-09-30 14:50:45 +00:00
|
|
|
whiteboard,
|
2021-07-08 13:42:07 +00:00
|
|
|
etherpad,
|
|
|
|
virtualBackground,
|
|
|
|
speakerStats,
|
|
|
|
settings,
|
|
|
|
shortcuts,
|
|
|
|
embed,
|
|
|
|
feedback,
|
|
|
|
download,
|
|
|
|
help
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2022-04-19 10:26:07 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns the notify mode of the given toolbox button.
|
|
|
|
*
|
|
|
|
* @param {string} btnName - The toolbar button's name.
|
|
|
|
* @returns {string|undefined} - The button's notify mode.
|
|
|
|
*/
|
2022-08-25 11:35:19 +00:00
|
|
|
_getButtonNotifyMode(btnName: string) {
|
2022-04-19 10:26:07 +00:00
|
|
|
const notify = this.props._buttonsWithNotifyClick?.find(
|
2022-08-25 11:35:19 +00:00
|
|
|
btn =>
|
2022-04-19 10:26:07 +00:00
|
|
|
(typeof btn === 'string' && btn === btnName)
|
|
|
|
|| (typeof btn === 'object' && btn.key === btnName)
|
|
|
|
);
|
|
|
|
|
|
|
|
if (notify) {
|
|
|
|
return typeof notify === 'string' || notify.preventExecution
|
|
|
|
? NOTIFY_CLICK_MODE.PREVENT_AND_NOTIFY
|
|
|
|
: NOTIFY_CLICK_MODE.ONLY_NOTIFY;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-09-14 07:07:20 +00:00
|
|
|
/**
|
2022-01-04 11:21:00 +00:00
|
|
|
* Sets the notify click mode for the buttons.
|
2021-09-14 07:07:20 +00:00
|
|
|
*
|
|
|
|
* @param {Object} buttons - The list of toolbar buttons.
|
|
|
|
* @returns {void}
|
|
|
|
*/
|
2022-08-25 11:35:19 +00:00
|
|
|
_setButtonsNotifyClickMode(buttons: Object) {
|
2021-09-14 07:07:20 +00:00
|
|
|
if (typeof APP === 'undefined' || !this.props._buttonsWithNotifyClick?.length) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
Object.values(buttons).forEach((button: any) => {
|
2022-01-04 11:21:00 +00:00
|
|
|
if (typeof button === 'object') {
|
2022-04-19 10:26:07 +00:00
|
|
|
button.notifyMode = this._getButtonNotifyMode(button.key);
|
2021-09-14 07:07:20 +00:00
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2021-07-08 13:42:07 +00:00
|
|
|
/**
|
|
|
|
* Returns all buttons that need to be rendered.
|
|
|
|
*
|
|
|
|
* @param {Object} state - The redux state.
|
|
|
|
* @returns {Object} The visible buttons arrays .
|
|
|
|
*/
|
|
|
|
_getVisibleButtons() {
|
|
|
|
const {
|
|
|
|
_clientWidth,
|
2022-10-04 13:02:49 +00:00
|
|
|
_toolbarButtons,
|
|
|
|
_jwtDisabledButons
|
2021-07-08 13:42:07 +00:00
|
|
|
} = this.props;
|
|
|
|
|
|
|
|
const buttons = this._getAllButtons();
|
2021-09-14 07:07:20 +00:00
|
|
|
|
2022-01-04 11:21:00 +00:00
|
|
|
this._setButtonsNotifyClickMode(buttons);
|
2021-07-09 12:36:19 +00:00
|
|
|
const isHangupVisible = isToolbarButtonEnabled('hangup', _toolbarButtons);
|
2021-07-08 13:42:07 +00:00
|
|
|
const { order } = THRESHOLDS.find(({ width }) => _clientWidth > width)
|
|
|
|
|| THRESHOLDS[THRESHOLDS.length - 1];
|
|
|
|
let sliceIndex = order.length + 2;
|
|
|
|
|
|
|
|
const keys = Object.keys(buttons);
|
|
|
|
|
|
|
|
const filtered = [
|
2022-08-25 11:35:19 +00:00
|
|
|
...order.map(key => buttons[key as keyof typeof buttons]),
|
2021-07-08 13:42:07 +00:00
|
|
|
...Object.values(buttons).filter((button, index) => !order.includes(keys[index]))
|
2021-07-22 12:26:56 +00:00
|
|
|
].filter(Boolean).filter(({ key, alias = NOT_APPLICABLE }) =>
|
2022-10-04 13:02:49 +00:00
|
|
|
!_jwtDisabledButons.includes(key)
|
|
|
|
&& (isToolbarButtonEnabled(key, _toolbarButtons) || isToolbarButtonEnabled(alias, _toolbarButtons))
|
|
|
|
);
|
2021-07-08 13:42:07 +00:00
|
|
|
|
|
|
|
if (isHangupVisible) {
|
|
|
|
sliceIndex -= 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
// This implies that the overflow button will be displayed, so save some space for it.
|
|
|
|
if (sliceIndex < filtered.length) {
|
|
|
|
sliceIndex -= 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
return {
|
|
|
|
mainMenuButtons: filtered.slice(0, sliceIndex),
|
|
|
|
overflowMenuButtons: filtered.slice(sliceIndex)
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2018-04-09 05:03:26 +00:00
|
|
|
/**
|
|
|
|
* Dispatches an action signaling the toolbar is not being hovered.
|
|
|
|
*
|
|
|
|
* @private
|
|
|
|
* @returns {void}
|
|
|
|
*/
|
|
|
|
_onMouseOut() {
|
2021-09-14 07:43:52 +00:00
|
|
|
const { _overflowMenuVisible, dispatch } = this.props;
|
|
|
|
|
|
|
|
!_overflowMenuVisible && dispatch(setToolbarHovered(false));
|
2017-02-16 23:02:40 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2018-04-09 05:03:26 +00:00
|
|
|
* Dispatches an action signaling the toolbar is being hovered.
|
2017-02-16 23:02:40 +00:00
|
|
|
*
|
|
|
|
* @private
|
2018-04-09 05:03:26 +00:00
|
|
|
* @returns {void}
|
2017-02-16 23:02:40 +00:00
|
|
|
*/
|
2018-04-09 05:03:26 +00:00
|
|
|
_onMouseOver() {
|
|
|
|
this.props.dispatch(setToolbarHovered(true));
|
|
|
|
}
|
|
|
|
|
2022-08-26 18:25:04 +00:00
|
|
|
/**
|
|
|
|
* Sets the visibility of the hangup menu.
|
|
|
|
*
|
|
|
|
* @param {boolean} visible - Whether or not the hangup menu should be
|
|
|
|
* displayed.
|
|
|
|
* @private
|
|
|
|
* @returns {void}
|
|
|
|
*/
|
|
|
|
_onSetHangupVisible(visible: boolean) {
|
|
|
|
this.props.dispatch(setHangupMenuVisible(visible));
|
|
|
|
this.props.dispatch(setToolbarHovered(visible));
|
|
|
|
}
|
|
|
|
|
2018-04-09 05:03:26 +00:00
|
|
|
/**
|
|
|
|
* Sets the visibility of the overflow menu.
|
|
|
|
*
|
|
|
|
* @param {boolean} visible - Whether or not the overflow menu should be
|
|
|
|
* displayed.
|
|
|
|
* @private
|
|
|
|
* @returns {void}
|
|
|
|
*/
|
2022-08-25 11:35:19 +00:00
|
|
|
_onSetOverflowVisible(visible: boolean) {
|
2018-04-20 11:24:14 +00:00
|
|
|
this.props.dispatch(setOverflowMenuVisible(visible));
|
2021-09-14 07:43:52 +00:00
|
|
|
this.props.dispatch(setToolbarHovered(visible));
|
2018-04-09 05:03:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Creates an analytics keyboard shortcut event and dispatches an action for
|
|
|
|
* toggling the display of chat.
|
|
|
|
*
|
|
|
|
* @private
|
|
|
|
* @returns {void}
|
|
|
|
*/
|
|
|
|
_onShortcutToggleChat() {
|
|
|
|
sendAnalytics(createShortcutEvent(
|
|
|
|
'toggle.chat',
|
2022-09-07 08:20:05 +00:00
|
|
|
ACTION_SHORTCUT_TRIGGERED,
|
2018-04-09 05:03:26 +00:00
|
|
|
{
|
|
|
|
enable: !this.props._chatOpen
|
|
|
|
}));
|
|
|
|
|
2021-06-16 16:36:36 +00:00
|
|
|
// Checks if there was any text selected by the user.
|
|
|
|
// Used for when we press simultaneously keys for copying
|
|
|
|
// text messages from the chat board
|
2022-08-25 11:35:19 +00:00
|
|
|
if (window.getSelection()?.toString() !== '') {
|
2021-06-16 16:36:36 +00:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2018-04-09 05:03:26 +00:00
|
|
|
this._doToggleChat();
|
|
|
|
}
|
|
|
|
|
2021-04-21 13:48:05 +00:00
|
|
|
/**
|
|
|
|
* Creates an analytics keyboard shortcut event and dispatches an action for
|
|
|
|
* toggling the display of the participants pane.
|
|
|
|
*
|
|
|
|
* @private
|
|
|
|
* @returns {void}
|
|
|
|
*/
|
|
|
|
_onShortcutToggleParticipantsPane() {
|
|
|
|
sendAnalytics(createShortcutEvent(
|
|
|
|
'toggle.participants-pane',
|
2022-09-07 08:20:05 +00:00
|
|
|
ACTION_SHORTCUT_TRIGGERED,
|
2021-04-21 13:48:05 +00:00
|
|
|
{
|
|
|
|
enable: !this.props._participantsPaneOpen
|
|
|
|
}));
|
|
|
|
|
|
|
|
this._onToolbarToggleParticipantsPane();
|
|
|
|
}
|
|
|
|
|
2019-07-28 15:36:11 +00:00
|
|
|
/**
|
|
|
|
* Creates an analytics keyboard shortcut event and dispatches an action for
|
|
|
|
* toggling the display of Video Quality.
|
|
|
|
*
|
|
|
|
* @private
|
|
|
|
* @returns {void}
|
|
|
|
*/
|
|
|
|
_onShortcutToggleVideoQuality() {
|
|
|
|
sendAnalytics(createShortcutEvent('video.quality'));
|
|
|
|
|
|
|
|
this._doToggleVideoQuality();
|
|
|
|
}
|
|
|
|
|
2019-11-22 16:15:39 +00:00
|
|
|
/**
|
|
|
|
* Dispatches an action for toggling the tile view.
|
|
|
|
*
|
|
|
|
* @private
|
|
|
|
* @returns {void}
|
|
|
|
*/
|
|
|
|
_onShortcutToggleTileView() {
|
|
|
|
sendAnalytics(createShortcutEvent(
|
|
|
|
'toggle.tileview',
|
2022-09-07 08:20:05 +00:00
|
|
|
ACTION_SHORTCUT_TRIGGERED,
|
2019-11-22 16:15:39 +00:00
|
|
|
{
|
|
|
|
enable: !this.props._tileViewEnabled
|
|
|
|
}));
|
|
|
|
|
|
|
|
this._doToggleTileView();
|
|
|
|
}
|
|
|
|
|
2018-04-09 05:03:26 +00:00
|
|
|
/**
|
|
|
|
* Creates an analytics keyboard shortcut event and dispatches an action for
|
|
|
|
* toggling full screen mode.
|
|
|
|
*
|
|
|
|
* @private
|
|
|
|
* @returns {void}
|
|
|
|
*/
|
|
|
|
_onShortcutToggleFullScreen() {
|
|
|
|
sendAnalytics(createShortcutEvent(
|
|
|
|
'toggle.fullscreen',
|
2022-09-07 08:20:05 +00:00
|
|
|
ACTION_SHORTCUT_TRIGGERED,
|
2018-04-09 05:03:26 +00:00
|
|
|
{
|
|
|
|
enable: !this.props._fullScreen
|
|
|
|
}));
|
|
|
|
|
|
|
|
this._doToggleFullScreen();
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Creates an analytics keyboard shortcut event and dispatches an action for
|
|
|
|
* toggling raise hand.
|
|
|
|
*
|
|
|
|
* @private
|
|
|
|
* @returns {void}
|
|
|
|
*/
|
|
|
|
_onShortcutToggleRaiseHand() {
|
|
|
|
sendAnalytics(createShortcutEvent(
|
|
|
|
'toggle.raise.hand',
|
|
|
|
ACTION_SHORTCUT_TRIGGERED,
|
|
|
|
{ enable: !this.props._raisedHand }));
|
|
|
|
|
|
|
|
this._doToggleRaiseHand();
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Creates an analytics keyboard shortcut event and dispatches an action for
|
|
|
|
* toggling screensharing.
|
|
|
|
*
|
|
|
|
* @private
|
|
|
|
* @returns {void}
|
|
|
|
*/
|
|
|
|
_onShortcutToggleScreenshare() {
|
2022-01-05 20:27:42 +00:00
|
|
|
// Ignore the shortcut if the button is disabled.
|
|
|
|
if (this.props._desktopSharingButtonDisabled) {
|
|
|
|
return;
|
|
|
|
}
|
2021-07-08 13:42:07 +00:00
|
|
|
sendAnalytics(createShortcutEvent(
|
|
|
|
'toggle.screen.sharing',
|
|
|
|
ACTION_SHORTCUT_TRIGGERED,
|
|
|
|
{
|
2021-07-09 12:36:19 +00:00
|
|
|
enable: !this.props._screenSharing
|
2021-07-08 13:42:07 +00:00
|
|
|
}));
|
2018-04-09 05:03:26 +00:00
|
|
|
|
2021-07-07 08:07:30 +00:00
|
|
|
this._doToggleScreenshare();
|
2018-04-09 05:03:26 +00:00
|
|
|
}
|
|
|
|
|
2022-10-17 20:40:13 +00:00
|
|
|
/**
|
|
|
|
* Creates an analytics keyboard shortcut event and dispatches an action for
|
|
|
|
* toggling speaker stats.
|
|
|
|
*
|
|
|
|
* @private
|
|
|
|
* @returns {void}
|
|
|
|
*/
|
|
|
|
_onShortcutSpeakerStats() {
|
|
|
|
sendAnalytics(createShortcutEvent(
|
|
|
|
'speaker.stats'
|
|
|
|
));
|
|
|
|
|
|
|
|
this._doToggleSpekearStats();
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Dispatches an action to toggle speakerStats.
|
|
|
|
*
|
|
|
|
* @private
|
|
|
|
* @returns {void}
|
|
|
|
*/
|
|
|
|
_doToggleSpekearStats() {
|
|
|
|
const { dispatch } = this.props;
|
|
|
|
|
|
|
|
dispatch(toggleDialog(SpeakerStats, {
|
|
|
|
conference: APP.conference
|
|
|
|
}));
|
|
|
|
}
|
2021-01-15 11:43:09 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Toggle the toolbar visibility when tabbing into it.
|
|
|
|
*
|
|
|
|
* @returns {void}
|
|
|
|
*/
|
|
|
|
_onTabIn() {
|
|
|
|
if (!this.props._visible) {
|
2021-04-14 17:30:19 +00:00
|
|
|
this.props.dispatch(showToolbox());
|
2021-01-15 11:43:09 +00:00
|
|
|
}
|
|
|
|
}
|
2018-04-09 05:03:26 +00:00
|
|
|
|
|
|
|
/**
|
2021-04-21 13:48:05 +00:00
|
|
|
* Dispatches an action for toggling the participants pane.
|
2018-04-09 05:03:26 +00:00
|
|
|
*
|
|
|
|
* @private
|
|
|
|
* @returns {void}
|
|
|
|
*/
|
2021-04-21 13:48:05 +00:00
|
|
|
_onToolbarToggleParticipantsPane() {
|
|
|
|
const { dispatch, _participantsPaneOpen } = this.props;
|
|
|
|
|
|
|
|
if (_participantsPaneOpen) {
|
|
|
|
dispatch(closeParticipantsPane());
|
|
|
|
} else {
|
|
|
|
dispatch(openParticipantsPane());
|
|
|
|
}
|
2018-04-09 05:03:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Creates an analytics toolbar event and dispatches an action for toggling
|
|
|
|
* open the video quality dialog.
|
|
|
|
*
|
|
|
|
* @private
|
|
|
|
* @returns {void}
|
|
|
|
*/
|
|
|
|
_onToolbarOpenVideoQuality() {
|
|
|
|
sendAnalytics(createToolbarEvent('video.quality'));
|
|
|
|
|
|
|
|
this._doOpenVideoQuality();
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Creates an analytics toolbar event and dispatches an action for toggling
|
|
|
|
* the display of chat.
|
|
|
|
*
|
|
|
|
* @private
|
|
|
|
* @returns {void}
|
|
|
|
*/
|
|
|
|
_onToolbarToggleChat() {
|
|
|
|
sendAnalytics(createToolbarEvent(
|
|
|
|
'toggle.chat',
|
|
|
|
{
|
|
|
|
enable: !this.props._chatOpen
|
|
|
|
}));
|
2021-02-23 11:09:22 +00:00
|
|
|
this._closeOverflowMenuIfOpen();
|
2018-04-09 05:03:26 +00:00
|
|
|
this._doToggleChat();
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Creates an analytics toolbar event and dispatches an action for toggling
|
|
|
|
* full screen mode.
|
|
|
|
*
|
|
|
|
* @private
|
|
|
|
* @returns {void}
|
|
|
|
*/
|
|
|
|
_onToolbarToggleFullScreen() {
|
|
|
|
sendAnalytics(createToolbarEvent(
|
|
|
|
'toggle.fullscreen',
|
|
|
|
{
|
|
|
|
enable: !this.props._fullScreen
|
|
|
|
}));
|
2021-02-23 11:09:22 +00:00
|
|
|
this._closeOverflowMenuIfOpen();
|
2018-04-09 05:03:26 +00:00
|
|
|
this._doToggleFullScreen();
|
|
|
|
}
|
|
|
|
|
2021-07-22 10:17:42 +00:00
|
|
|
/**
|
|
|
|
* Creates an analytics toolbar event and dispatches an action for toggling
|
|
|
|
* raise hand.
|
|
|
|
*
|
|
|
|
* @private
|
|
|
|
* @returns {void}
|
|
|
|
*/
|
|
|
|
_onToolbarToggleRaiseHand() {
|
|
|
|
sendAnalytics(createToolbarEvent(
|
|
|
|
'raise.hand',
|
|
|
|
{ enable: !this.props._raisedHand }));
|
|
|
|
|
|
|
|
this._doToggleRaiseHand();
|
|
|
|
}
|
|
|
|
|
2018-04-09 05:03:26 +00:00
|
|
|
/**
|
|
|
|
* Creates an analytics toolbar event and dispatches an action for toggling
|
|
|
|
* screensharing.
|
|
|
|
*
|
|
|
|
* @private
|
|
|
|
* @returns {void}
|
|
|
|
*/
|
|
|
|
_onToolbarToggleScreenshare() {
|
2021-07-08 13:42:07 +00:00
|
|
|
sendAnalytics(createToolbarEvent(
|
2018-04-09 05:03:26 +00:00
|
|
|
'toggle.screen.sharing',
|
2021-07-09 12:36:19 +00:00
|
|
|
{ enable: !this.props._screenSharing }));
|
2021-04-22 12:24:17 +00:00
|
|
|
|
2021-04-12 07:37:39 +00:00
|
|
|
this._closeOverflowMenuIfOpen();
|
2021-07-07 08:07:30 +00:00
|
|
|
this._doToggleScreenshare();
|
2021-04-12 07:37:39 +00:00
|
|
|
}
|
|
|
|
|
2018-06-19 16:43:33 +00:00
|
|
|
/**
|
2021-07-08 13:42:07 +00:00
|
|
|
* Returns true if the audio sharing button should be visible and
|
|
|
|
* false otherwise.
|
2018-06-19 16:43:33 +00:00
|
|
|
*
|
2021-07-08 13:42:07 +00:00
|
|
|
* @returns {boolean}
|
2018-06-19 16:43:33 +00:00
|
|
|
*/
|
2021-07-08 13:42:07 +00:00
|
|
|
_showAudioSharingButton() {
|
|
|
|
const {
|
|
|
|
_desktopSharingEnabled
|
|
|
|
} = this.props;
|
2018-07-18 22:12:25 +00:00
|
|
|
|
2021-07-08 13:42:07 +00:00
|
|
|
return _desktopSharingEnabled && isScreenAudioSupported();
|
2018-06-19 16:43:33 +00:00
|
|
|
}
|
|
|
|
|
2019-03-05 14:26:45 +00:00
|
|
|
/**
|
2021-03-03 14:37:38 +00:00
|
|
|
* Returns true if the desktop sharing button should be visible and
|
2019-03-05 14:26:45 +00:00
|
|
|
* false otherwise.
|
|
|
|
*
|
|
|
|
* @returns {boolean}
|
|
|
|
*/
|
2021-02-23 11:09:22 +00:00
|
|
|
_showDesktopSharingButton() {
|
2022-08-16 12:53:53 +00:00
|
|
|
return this.props._desktopSharingEnabled;
|
2017-02-16 23:02:40 +00:00
|
|
|
}
|
|
|
|
|
2020-09-23 09:09:07 +00:00
|
|
|
/**
|
2021-03-17 08:44:18 +00:00
|
|
|
* Returns true if the embed meeting button is visible and false otherwise.
|
2020-09-23 09:09:07 +00:00
|
|
|
*
|
|
|
|
* @returns {boolean}
|
|
|
|
*/
|
|
|
|
_isEmbedMeetingVisible() {
|
2021-03-12 12:19:04 +00:00
|
|
|
return !this.props._isVpaasMeeting
|
2021-07-08 13:42:07 +00:00
|
|
|
&& !this.props._isMobile;
|
2020-09-23 09:09:07 +00:00
|
|
|
}
|
|
|
|
|
2019-03-05 14:26:45 +00:00
|
|
|
/**
|
|
|
|
* Returns true if the profile button is visible and false otherwise.
|
|
|
|
*
|
|
|
|
* @returns {boolean}
|
|
|
|
*/
|
|
|
|
_isProfileVisible() {
|
2021-07-08 13:42:07 +00:00
|
|
|
return !this.props._isProfileDisabled;
|
2020-03-30 14:17:18 +00:00
|
|
|
}
|
|
|
|
|
2019-02-20 23:35:19 +00:00
|
|
|
/**
|
|
|
|
* Renders the toolbox content.
|
|
|
|
*
|
2021-02-23 11:09:22 +00:00
|
|
|
* @returns {ReactElement}
|
2019-02-20 23:35:19 +00:00
|
|
|
*/
|
|
|
|
_renderToolboxContent() {
|
|
|
|
const {
|
2022-08-26 18:25:04 +00:00
|
|
|
_endConferenceSupported,
|
|
|
|
_hangupMenuVisible,
|
2021-03-12 12:19:04 +00:00
|
|
|
_isMobile,
|
2021-12-14 11:39:01 +00:00
|
|
|
_overflowDrawer,
|
2019-02-20 23:35:19 +00:00
|
|
|
_overflowMenuVisible,
|
2021-11-15 08:37:54 +00:00
|
|
|
_reactionsEnabled,
|
2021-07-09 12:36:19 +00:00
|
|
|
_toolbarButtons,
|
2021-11-15 08:37:54 +00:00
|
|
|
classes,
|
|
|
|
t
|
2019-02-20 23:35:19 +00:00
|
|
|
} = this.props;
|
2020-04-01 07:47:51 +00:00
|
|
|
|
2021-02-23 11:09:22 +00:00
|
|
|
const toolbarAccLabel = 'toolbar.accessibilityLabel.moreActionsMenu';
|
2021-03-12 12:19:04 +00:00
|
|
|
const containerClassName = `toolbox-content${_isMobile ? ' toolbox-content-mobile' : ''}`;
|
|
|
|
|
2021-07-08 13:42:07 +00:00
|
|
|
const { mainMenuButtons, overflowMenuButtons } = this._getVisibleButtons();
|
2019-03-05 14:26:45 +00:00
|
|
|
|
2019-02-20 23:35:19 +00:00
|
|
|
return (
|
2021-03-12 12:19:04 +00:00
|
|
|
<div className = { containerClassName }>
|
2021-04-19 11:18:28 +00:00
|
|
|
<div
|
|
|
|
className = 'toolbox-content-wrapper'
|
|
|
|
onFocus = { this._onTabIn }
|
2021-07-30 08:37:45 +00:00
|
|
|
{ ...(_isMobile ? {} : {
|
|
|
|
onMouseOut: this._onMouseOut,
|
|
|
|
onMouseOver: this._onMouseOver
|
|
|
|
}) }>
|
2021-09-02 11:42:39 +00:00
|
|
|
|
2021-03-18 12:09:22 +00:00
|
|
|
<div className = 'toolbox-content-items'>
|
2021-07-08 13:42:07 +00:00
|
|
|
{mainMenuButtons.map(({ Content, key, ...rest }) => Content !== Separator && (
|
|
|
|
<Content
|
|
|
|
{ ...rest }
|
2022-01-04 11:21:00 +00:00
|
|
|
buttonKey = { key }
|
2021-07-08 13:42:07 +00:00
|
|
|
key = { key } />))}
|
|
|
|
|
|
|
|
{Boolean(overflowMenuButtons.length) && (
|
|
|
|
<OverflowMenuButton
|
|
|
|
ariaControls = 'overflow-menu'
|
|
|
|
isOpen = { _overflowMenuVisible }
|
|
|
|
key = 'overflow-menu'
|
2021-07-13 06:50:08 +00:00
|
|
|
onVisibilityChange = { this._onSetOverflowVisible }
|
|
|
|
showMobileReactions = {
|
2021-07-22 10:17:42 +00:00
|
|
|
_reactionsEnabled && overflowMenuButtons.find(({ key }) => key === 'raisehand')
|
2021-07-13 06:50:08 +00:00
|
|
|
}>
|
2022-04-05 12:19:03 +00:00
|
|
|
<ContextMenu
|
|
|
|
accessibilityLabel = { t(toolbarAccLabel) }
|
|
|
|
className = { classes.contextMenu }
|
|
|
|
hidden = { false }
|
|
|
|
inDrawer = { _overflowDrawer }
|
|
|
|
onKeyDown = { this._onEscKey }>
|
|
|
|
{overflowMenuButtons.reduce((acc, val) => {
|
|
|
|
if (acc.length) {
|
|
|
|
const prev = acc[acc.length - 1];
|
|
|
|
const group = prev[prev.length - 1].group;
|
|
|
|
|
|
|
|
if (group === val.group) {
|
|
|
|
prev.push(val);
|
|
|
|
} else {
|
|
|
|
acc.push([ val ]);
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
acc.push([ val ]);
|
|
|
|
}
|
|
|
|
|
|
|
|
return acc;
|
2022-08-25 11:35:19 +00:00
|
|
|
}, []).map((buttonGroup: any) => (
|
2022-04-05 12:19:03 +00:00
|
|
|
<ContextMenuItemGroup key = { `group-${buttonGroup[0].group}` }>
|
2022-08-25 11:35:19 +00:00
|
|
|
{buttonGroup.map(({ key, Content, ...rest }: any) => (
|
2022-04-05 12:19:03 +00:00
|
|
|
key !== 'raisehand' || !_reactionsEnabled)
|
|
|
|
&& <Content
|
2021-07-08 13:42:07 +00:00
|
|
|
{ ...rest }
|
2022-01-04 11:21:00 +00:00
|
|
|
buttonKey = { key }
|
2022-04-05 12:19:03 +00:00
|
|
|
contextMenu = { true }
|
2021-07-08 13:42:07 +00:00
|
|
|
key = { key }
|
2022-04-05 12:19:03 +00:00
|
|
|
showLabel = { true } />)}
|
|
|
|
</ContextMenuItemGroup>))}
|
|
|
|
</ContextMenu>
|
2021-07-08 13:42:07 +00:00
|
|
|
</OverflowMenuButton>
|
|
|
|
)}
|
|
|
|
|
2022-08-26 18:25:04 +00:00
|
|
|
{ isToolbarButtonEnabled('hangup', _toolbarButtons) && (
|
|
|
|
_endConferenceSupported
|
|
|
|
? <HangupMenuButton
|
|
|
|
ariaControls = 'hangup-menu'
|
|
|
|
isOpen = { _hangupMenuVisible }
|
|
|
|
key = 'hangup-menu'
|
2022-09-14 16:42:30 +00:00
|
|
|
notifyMode = { this._getButtonNotifyMode('hangup-menu') }
|
2022-08-26 18:25:04 +00:00
|
|
|
onVisibilityChange = { this._onSetHangupVisible }>
|
|
|
|
<ContextMenu
|
|
|
|
accessibilityLabel = { t(toolbarAccLabel) }
|
|
|
|
className = { classes.hangupMenu }
|
|
|
|
hidden = { false }
|
|
|
|
inDrawer = { _overflowDrawer }
|
|
|
|
onKeyDown = { this._onEscKey }>
|
2022-09-14 16:42:30 +00:00
|
|
|
<EndConferenceButton
|
|
|
|
buttonKey = 'end-meeting'
|
|
|
|
notifyMode = { this._getButtonNotifyMode('end-meeting') } />
|
|
|
|
<LeaveConferenceButton
|
|
|
|
buttonKey = 'hangup'
|
|
|
|
notifyMode = { this._getButtonNotifyMode('hangup') } />
|
2022-08-26 18:25:04 +00:00
|
|
|
</ContextMenu>
|
|
|
|
</HangupMenuButton>
|
|
|
|
: <HangupButton
|
|
|
|
buttonKey = 'hangup'
|
|
|
|
customClass = 'hangup-button'
|
|
|
|
key = 'hangup-button'
|
|
|
|
notifyMode = { this._getButtonNotifyMode('hangup') }
|
|
|
|
visible = { isToolbarButtonEnabled('hangup', _toolbarButtons) } />
|
|
|
|
)}
|
2021-03-18 12:09:22 +00:00
|
|
|
</div>
|
2019-02-20 23:35:19 +00:00
|
|
|
</div>
|
2021-02-23 11:09:22 +00:00
|
|
|
</div>
|
|
|
|
);
|
2019-02-20 23:35:19 +00:00
|
|
|
}
|
2017-02-16 23:02:40 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2018-04-09 05:03:26 +00:00
|
|
|
* Maps (parts of) the redux state to {@link Toolbox}'s React {@code Component}
|
|
|
|
* props.
|
2017-02-16 23:02:40 +00:00
|
|
|
*
|
2018-04-09 05:03:26 +00:00
|
|
|
* @param {Object} state - The redux store/state.
|
2021-08-20 08:53:11 +00:00
|
|
|
* @param {Object} ownProps - The props explicitly passed.
|
2017-02-16 23:02:40 +00:00
|
|
|
* @private
|
2018-04-09 05:03:26 +00:00
|
|
|
* @returns {{}}
|
2017-02-16 23:02:40 +00:00
|
|
|
*/
|
2022-10-20 09:11:27 +00:00
|
|
|
function _mapStateToProps(state: IReduxState, ownProps: Partial<IProps>) {
|
2021-07-08 13:42:07 +00:00
|
|
|
const { conference } = state['features/base/conference'];
|
2022-08-26 18:25:04 +00:00
|
|
|
const endConferenceSupported = conference?.isEndConferenceSupported();
|
2022-10-17 20:40:13 +00:00
|
|
|
|
2018-04-09 05:03:26 +00:00
|
|
|
const {
|
2022-02-04 10:06:07 +00:00
|
|
|
buttonsWithNotifyClick,
|
2018-04-09 05:03:26 +00:00
|
|
|
callStatsID,
|
2021-09-14 07:07:20 +00:00
|
|
|
disableProfile,
|
2022-02-04 10:06:07 +00:00
|
|
|
iAmRecorder,
|
2022-03-31 13:11:44 +00:00
|
|
|
iAmSipGateway
|
2018-06-15 18:10:22 +00:00
|
|
|
} = state['features/base/config'];
|
2017-02-16 23:02:40 +00:00
|
|
|
const {
|
2018-04-09 05:03:26 +00:00
|
|
|
fullScreen,
|
2022-08-26 18:25:04 +00:00
|
|
|
hangupMenuVisible,
|
2021-12-14 11:39:01 +00:00
|
|
|
overflowMenuVisible,
|
|
|
|
overflowDrawer
|
2017-04-01 05:52:40 +00:00
|
|
|
} = state['features/toolbox'];
|
2018-04-09 05:03:26 +00:00
|
|
|
const localParticipant = getLocalParticipant(state);
|
|
|
|
const localVideo = getLocalVideoTrack(state['features/base/tracks']);
|
2021-03-23 12:06:43 +00:00
|
|
|
const { clientWidth } = state['features/base/responsive-ui'];
|
2022-04-19 14:31:58 +00:00
|
|
|
const toolbarButtons = ownProps.toolbarButtons || getToolbarButtons(state);
|
2021-08-20 08:53:11 +00:00
|
|
|
|
2017-02-16 23:02:40 +00:00
|
|
|
return {
|
2021-08-31 11:00:27 +00:00
|
|
|
_backgroundType: state['features/virtual-background'].backgroundType,
|
2021-09-14 07:07:20 +00:00
|
|
|
_buttonsWithNotifyClick: buttonsWithNotifyClick,
|
2018-08-29 17:24:25 +00:00
|
|
|
_chatOpen: state['features/chat'].isOpen,
|
2021-03-23 12:06:43 +00:00
|
|
|
_clientWidth: clientWidth,
|
2018-04-09 05:03:26 +00:00
|
|
|
_conference: conference,
|
2022-08-16 12:53:53 +00:00
|
|
|
_desktopSharingEnabled: JitsiMeetJS.isDesktopSharingEnabled(),
|
2022-01-05 20:27:42 +00:00
|
|
|
_desktopSharingButtonDisabled: isDesktopShareButtonDisabled(state),
|
2018-04-09 05:03:26 +00:00
|
|
|
_dialog: Boolean(state['features/base/dialog'].component),
|
2022-02-04 10:06:07 +00:00
|
|
|
_disabled: Boolean(iAmRecorder || iAmSipGateway),
|
2022-08-26 18:25:04 +00:00
|
|
|
_endConferenceSupported: Boolean(endConferenceSupported),
|
2018-04-09 05:03:26 +00:00
|
|
|
_feedbackConfigured: Boolean(callStatsID),
|
2021-08-31 11:00:27 +00:00
|
|
|
_fullScreen: fullScreen,
|
2022-03-11 13:00:49 +00:00
|
|
|
_gifsEnabled: isGifEnabled(state),
|
2021-09-14 07:07:20 +00:00
|
|
|
_isProfileDisabled: Boolean(disableProfile),
|
2021-11-17 11:55:10 +00:00
|
|
|
_isIosMobile: isIosMobileBrowser(),
|
2021-03-12 12:19:04 +00:00
|
|
|
_isMobile: isMobileBrowser(),
|
2022-10-17 20:40:13 +00:00
|
|
|
_isSpeakerStatsDisabled: isSpeakerStatsDisabled(state),
|
2020-09-23 09:09:07 +00:00
|
|
|
_isVpaasMeeting: isVpaasMeeting(state),
|
2022-10-04 13:02:49 +00:00
|
|
|
_jwtDisabledButons: getJwtDisabledButtons(state),
|
2022-03-31 13:11:44 +00:00
|
|
|
_hasSalesforce: isSalesforceEnabled(state),
|
2022-08-26 18:25:04 +00:00
|
|
|
_hangupMenuVisible: hangupMenuVisible,
|
2021-07-09 12:36:19 +00:00
|
|
|
_localParticipantID: localParticipant?.id,
|
2021-05-24 12:30:45 +00:00
|
|
|
_localVideo: localVideo,
|
2022-07-05 21:37:06 +00:00
|
|
|
_multiStreamModeEnabled: getMultipleVideoSendingSupportFeatureFlag(state),
|
2018-07-05 16:49:49 +00:00
|
|
|
_overflowMenuVisible: overflowMenuVisible,
|
2021-12-14 11:39:01 +00:00
|
|
|
_overflowDrawer: overflowDrawer,
|
2021-04-21 13:48:05 +00:00
|
|
|
_participantsPaneOpen: getParticipantsPaneOpen(state),
|
2021-10-21 09:40:57 +00:00
|
|
|
_raisedHand: hasRaisedHand(localParticipant),
|
2021-08-31 11:00:27 +00:00
|
|
|
_reactionsEnabled: isReactionsEnabled(state),
|
2021-07-09 12:36:19 +00:00
|
|
|
_screenSharing: isScreenVideoShared(state),
|
2021-08-31 11:00:27 +00:00
|
|
|
_tileViewEnabled: shouldDisplayTileView(state),
|
2021-08-20 08:53:11 +00:00
|
|
|
_toolbarButtons: toolbarButtons,
|
2021-08-31 11:00:27 +00:00
|
|
|
_virtualSource: state['features/virtual-background'].virtualSource,
|
2022-09-30 14:50:45 +00:00
|
|
|
_visible: isToolboxVisible(state),
|
2022-10-06 13:01:45 +00:00
|
|
|
_whiteboardEnabled: isWhiteboardButtonVisible(state)
|
2017-02-16 23:02:40 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2021-11-15 08:37:54 +00:00
|
|
|
export default translate(connect(_mapStateToProps)(withStyles(styles)(Toolbox)));
|