2018-04-09 05:03:26 +00:00
|
|
|
// @flow
|
2017-02-16 23:02:40 +00:00
|
|
|
|
2021-11-15 08:37:54 +00:00
|
|
|
import { withStyles } from '@material-ui/core/styles';
|
2022-04-05 12:19:03 +00:00
|
|
|
import React, { Component } from 'react';
|
2022-03-11 13:00:49 +00:00
|
|
|
import { batch } from 'react-redux';
|
2017-02-16 23:02:40 +00:00
|
|
|
|
2021-06-10 12:48:44 +00:00
|
|
|
import keyboardShortcut from '../../../../../modules/keyboardshortcut/keyboardshortcut';
|
2017-04-04 11:53:10 +00:00
|
|
|
import {
|
2018-04-09 05:03:26 +00:00
|
|
|
ACTION_SHORTCUT_TRIGGERED,
|
|
|
|
createShortcutEvent,
|
|
|
|
createToolbarEvent,
|
|
|
|
sendAnalytics
|
2018-05-10 23:01:55 +00:00
|
|
|
} from '../../../analytics';
|
2022-04-05 12:19:03 +00:00
|
|
|
import { ContextMenu, ContextMenuItemGroup } from '../../../base/components';
|
2021-11-29 09:33:38 +00:00
|
|
|
import { getToolbarButtons } from '../../../base/config';
|
|
|
|
import { isToolbarButtonEnabled } from '../../../base/config/functions.web';
|
2019-07-28 15:36:11 +00:00
|
|
|
import { openDialog, toggleDialog } from '../../../base/dialog';
|
2021-11-17 11:55:10 +00:00
|
|
|
import { isIosMobileBrowser, isMobileBrowser } from '../../../base/environment/utils';
|
2018-05-10 23:01:55 +00:00
|
|
|
import { translate } from '../../../base/i18n';
|
2020-11-03 09:44:41 +00:00
|
|
|
import JitsiMeetJS from '../../../base/lib-jitsi-meet';
|
2017-02-16 23:02:40 +00:00
|
|
|
import {
|
2018-04-09 05:03:26 +00:00
|
|
|
getLocalParticipant,
|
2021-10-21 09:40:57 +00:00
|
|
|
hasRaisedHand,
|
2021-07-09 12:36:19 +00:00
|
|
|
haveParticipantWithScreenSharingFeature,
|
2021-06-23 11:23:44 +00:00
|
|
|
raiseHand
|
2018-05-10 23:01:55 +00:00
|
|
|
} from '../../../base/participants';
|
2021-03-10 15:39:35 +00:00
|
|
|
import { connect } from '../../../base/redux';
|
2021-07-07 08:07:30 +00:00
|
|
|
import { getLocalVideoTrack } from '../../../base/tracks';
|
2021-07-08 13:42:07 +00:00
|
|
|
import { toggleChat } from '../../../chat';
|
|
|
|
import { ChatButton } from '../../../chat/components';
|
|
|
|
import { EmbedMeetingButton } from '../../../embed-meeting';
|
2019-10-08 12:27:35 +00:00
|
|
|
import { SharedDocumentButton } from '../../../etherpad';
|
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';
|
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';
|
2021-07-08 13:42:07 +00:00
|
|
|
import { KeyboardShortcutsButton } from '../../../keyboard-shortcuts';
|
2021-04-21 13:48:05 +00:00
|
|
|
import {
|
|
|
|
close as closeParticipantsPane,
|
|
|
|
open as openParticipantsPane
|
|
|
|
} from '../../../participants-pane/actions';
|
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';
|
2021-07-13 06:50:08 +00:00
|
|
|
import { ReactionsMenuButton } from '../../../reactions/components';
|
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
|
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 {
|
|
|
|
isScreenAudioSupported,
|
|
|
|
isScreenVideoShared,
|
|
|
|
ShareAudioButton,
|
|
|
|
startScreenShareFlow
|
|
|
|
} from '../../../screen-share/';
|
2021-12-10 16:23:27 +00:00
|
|
|
import SecurityDialogButton from '../../../security/components/security-dialog/web/SecurityDialogButton';
|
2021-07-08 13:42:07 +00:00
|
|
|
import { SettingsButton } from '../../../settings';
|
2021-03-03 14:37:38 +00:00
|
|
|
import { SharedVideoButton } from '../../../shared-video/components';
|
2021-11-10 17:49:53 +00:00
|
|
|
import { SpeakerStatsButton } from '../../../speaker-stats/components/web';
|
2020-05-20 10:57:03 +00:00
|
|
|
import {
|
|
|
|
ClosedCaptionButton
|
|
|
|
} 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
|
|
|
|
} from '../../../video-layout';
|
2021-07-08 13:42:07 +00:00
|
|
|
import { VideoQualityDialog, VideoQualityButton } from '../../../video-quality/components';
|
2021-11-10 17:49:53 +00:00
|
|
|
import { VideoBackgroundButton, toggleBackgroundEffect } from '../../../virtual-background';
|
2021-05-26 11:53:14 +00:00
|
|
|
import { VIRTUAL_BACKGROUND_TYPE } from '../../../virtual-background/constants';
|
2018-04-20 11:24:14 +00:00
|
|
|
import {
|
|
|
|
setFullScreen,
|
|
|
|
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-04-05 12:19:03 +00:00
|
|
|
import { THRESHOLDS, NOT_APPLICABLE, NOTIFY_CLICK_MODE } from '../../constants';
|
2022-01-05 20:27:42 +00:00
|
|
|
import { isDesktopShareButtonDisabled, isToolboxVisible } from '../../functions';
|
2020-05-20 10:57:03 +00:00
|
|
|
import DownloadButton from '../DownloadButton';
|
2018-05-10 23:01:55 +00:00
|
|
|
import HangupButton from '../HangupButton';
|
2019-10-11 18:09:50 +00:00
|
|
|
import HelpButton from '../HelpButton';
|
2020-05-20 10:57:03 +00:00
|
|
|
|
|
|
|
import AudioSettingsButton from './AudioSettingsButton';
|
2022-05-23 12:42:25 +00:00
|
|
|
import DockIframeButton from './DockIframeButton';
|
2021-07-08 13:42:07 +00:00
|
|
|
import FullscreenButton from './FullscreenButton';
|
2022-03-08 09:10:30 +00:00
|
|
|
import LinkToSalesforceButton from './LinkToSalesforceButton';
|
2018-04-09 05:03:26 +00:00
|
|
|
import OverflowMenuButton from './OverflowMenuButton';
|
2021-07-08 13:42:07 +00:00
|
|
|
import ProfileButton from './ProfileButton';
|
|
|
|
import Separator from './Separator';
|
|
|
|
import ShareDesktopButton from './ShareDesktopButton';
|
2021-07-22 08:39:13 +00:00
|
|
|
import ToggleCameraButton from './ToggleCameraButton';
|
2022-05-23 12:42:25 +00:00
|
|
|
import UndockIframeButton from './UndockIframeButton';
|
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}.
|
|
|
|
*/
|
2018-04-09 05:03:26 +00:00
|
|
|
type Props = {
|
|
|
|
|
2021-05-14 07:10:46 +00:00
|
|
|
/**
|
|
|
|
* String showing if the virtual background type is desktop-share.
|
|
|
|
*/
|
|
|
|
_backgroundType: String,
|
|
|
|
|
2021-09-14 07:07:20 +00:00
|
|
|
/**
|
|
|
|
* Toolbar buttons which have their click exposed through the API.
|
|
|
|
*/
|
2022-01-04 11:21:00 +00:00
|
|
|
_buttonsWithNotifyClick: Array<string | Object>,
|
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.
|
|
|
|
*/
|
|
|
|
_chatOpen: boolean,
|
|
|
|
|
2021-03-23 12:06:43 +00:00
|
|
|
/**
|
|
|
|
* The width of the client.
|
|
|
|
*/
|
|
|
|
_clientWidth: number,
|
|
|
|
|
2018-04-09 05:03:26 +00:00
|
|
|
/**
|
|
|
|
* The {@code JitsiConference} for the current conference.
|
|
|
|
*/
|
|
|
|
_conference: Object,
|
|
|
|
|
2022-01-05 20:27:42 +00:00
|
|
|
/**
|
|
|
|
* Whether or not screensharing button is disabled.
|
|
|
|
*/
|
|
|
|
_desktopSharingButtonDisabled: boolean,
|
|
|
|
|
2018-04-09 05:03:26 +00:00
|
|
|
/**
|
2018-06-15 18:10:22 +00:00
|
|
|
* The tooltip key to use when screensharing is disabled. Or undefined
|
|
|
|
* if non to be shown and the button to be hidden.
|
2018-04-09 05:03:26 +00:00
|
|
|
*/
|
2018-06-15 18:10:22 +00:00
|
|
|
_desktopSharingDisabledTooltipKey: boolean,
|
2018-04-09 05:03:26 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Whether or not screensharing is initialized.
|
|
|
|
*/
|
|
|
|
_desktopSharingEnabled: boolean,
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Whether or not a dialog is displayed.
|
|
|
|
*/
|
|
|
|
_dialog: boolean,
|
|
|
|
|
2022-02-04 10:06:07 +00:00
|
|
|
/**
|
|
|
|
* Whether or not the toolbox is disabled. It is for recorders.
|
|
|
|
*/
|
|
|
|
_disabled: boolean,
|
|
|
|
|
2018-04-09 05:03:26 +00:00
|
|
|
/**
|
|
|
|
* Whether or not call feedback can be sent.
|
|
|
|
*/
|
|
|
|
_feedbackConfigured: boolean,
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Whether or not the app is currently in full screen.
|
|
|
|
*/
|
|
|
|
_fullScreen: boolean,
|
|
|
|
|
2022-03-11 13:00:49 +00:00
|
|
|
/**
|
|
|
|
* Whether or not the GIFs feature is enabled.
|
|
|
|
*/
|
|
|
|
_gifsEnabled: boolean,
|
|
|
|
|
2022-03-08 09:10:30 +00:00
|
|
|
/**
|
|
|
|
* Whether the app has Salesforce integration.
|
|
|
|
*/
|
|
|
|
_hasSalesforce: boolean,
|
|
|
|
|
2021-11-17 11:55:10 +00:00
|
|
|
/**
|
|
|
|
* Whether or not the app is running in an ios mobile browser.
|
|
|
|
*/
|
|
|
|
_isIosMobile: boolean,
|
|
|
|
|
2021-03-12 12:19:04 +00:00
|
|
|
/**
|
|
|
|
* Whether or not the app is running in mobile browser.
|
|
|
|
*/
|
|
|
|
_isMobile: boolean,
|
|
|
|
|
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
|
|
|
*/
|
2020-11-05 17:35:03 +00:00
|
|
|
_isProfileDisabled: boolean,
|
2019-11-22 16:15:39 +00:00
|
|
|
|
2018-05-14 16:22:38 +00:00
|
|
|
|
2020-09-23 09:09:07 +00:00
|
|
|
/**
|
|
|
|
* Whether or not the current meeting belongs to a JaaS user.
|
|
|
|
*/
|
|
|
|
_isVpaasMeeting: boolean,
|
|
|
|
|
2018-04-09 05:03:26 +00:00
|
|
|
/**
|
|
|
|
* The ID of the local participant.
|
|
|
|
*/
|
|
|
|
_localParticipantID: String,
|
|
|
|
|
2021-05-24 12:30:45 +00:00
|
|
|
/**
|
|
|
|
* The JitsiLocalTrack to display.
|
|
|
|
*/
|
|
|
|
_localVideo: Object,
|
|
|
|
|
2021-12-14 11:39:01 +00:00
|
|
|
/**
|
|
|
|
*Whether or not the overflow menu is displayed in a drawer drawer.
|
|
|
|
*/
|
|
|
|
_overflowDrawer: boolean,
|
|
|
|
|
2018-04-20 11:24:14 +00:00
|
|
|
/**
|
|
|
|
* Whether or not the overflow menu is visible.
|
|
|
|
*/
|
|
|
|
_overflowMenuVisible: boolean,
|
|
|
|
|
2021-04-21 13:48:05 +00:00
|
|
|
/**
|
|
|
|
* Whether or not the participants pane is open.
|
|
|
|
*/
|
|
|
|
_participantsPaneOpen: boolean,
|
|
|
|
|
2018-04-09 05:03:26 +00:00
|
|
|
/**
|
|
|
|
* Whether or not the local participant's hand is raised.
|
|
|
|
*/
|
|
|
|
_raisedHand: boolean,
|
|
|
|
|
2021-08-31 11:00:27 +00:00
|
|
|
/**
|
|
|
|
* Whether or not reactions feature is enabled.
|
|
|
|
*/
|
|
|
|
_reactionsEnabled: boolean,
|
|
|
|
|
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
|
|
|
*/
|
2021-07-09 12:36:19 +00:00
|
|
|
_screenSharing: boolean,
|
2018-04-09 05:03:26 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Whether or not the local participant is sharing a YouTube video.
|
|
|
|
*/
|
|
|
|
_sharingVideo: boolean,
|
|
|
|
|
2021-08-31 11:00:27 +00:00
|
|
|
/**
|
|
|
|
* Whether or not the tile view is enabled.
|
|
|
|
*/
|
|
|
|
_tileViewEnabled: boolean,
|
|
|
|
|
2021-07-09 12:36:19 +00:00
|
|
|
/**
|
|
|
|
* The enabled buttons.
|
|
|
|
*/
|
|
|
|
_toolbarButtons: Array<string>,
|
|
|
|
|
2018-04-09 05:03:26 +00:00
|
|
|
/**
|
|
|
|
* Flag showing whether toolbar is visible.
|
|
|
|
*/
|
|
|
|
_visible: boolean,
|
|
|
|
|
2021-05-24 12:30:45 +00:00
|
|
|
/**
|
|
|
|
* Returns the selected virtual source object.
|
|
|
|
*/
|
2021-07-22 10:17:42 +00:00
|
|
|
_virtualSource: Object,
|
|
|
|
|
2021-11-15 08:37:54 +00:00
|
|
|
/**
|
|
|
|
* An object containing the CSS classes.
|
|
|
|
*/
|
|
|
|
classes: Object,
|
|
|
|
|
2018-04-09 05:03:26 +00:00
|
|
|
/**
|
|
|
|
* Invoked to active other features of the app.
|
|
|
|
*/
|
|
|
|
dispatch: Function,
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Invoked to obtain translated strings.
|
|
|
|
*/
|
2021-08-20 08:53:11 +00:00
|
|
|
t: Function,
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Explicitly passed array with the buttons which this Toolbox should display.
|
|
|
|
*/
|
|
|
|
toolbarButtons: Array<string>,
|
2021-09-02 11:42:39 +00:00
|
|
|
|
2018-05-11 02:10:26 +00:00
|
|
|
};
|
2018-04-09 05:03:26 +00:00
|
|
|
|
2017-02-16 23:02:40 +00:00
|
|
|
declare var APP: Object;
|
2020-02-25 15:09:52 +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: {
|
|
|
|
position: 'relative',
|
|
|
|
right: 'auto',
|
|
|
|
maxHeight: 'inherit',
|
|
|
|
margin: 0
|
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
|
|
|
*/
|
2021-09-21 17:30:24 +00:00
|
|
|
class Toolbox extends Component<Props> {
|
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
|
|
|
*
|
2018-04-09 05:03:26 +00:00
|
|
|
* @param {Props} props - The read-only React {@code Component} props with
|
|
|
|
* which the new instance is to be initialized.
|
2017-02-16 23:02:40 +00:00
|
|
|
*/
|
2018-04-09 05:03:26 +00:00
|
|
|
constructor(props: Props) {
|
|
|
|
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);
|
|
|
|
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);
|
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-03-11 13:00:49 +00:00
|
|
|
const { _toolbarButtons, t, dispatch, _reactionsEnabled, _gifsEnabled } = 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'
|
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
|
|
|
|
*/
|
2018-10-29 02:09:50 +00:00
|
|
|
componentDidUpdate(prevProps) {
|
2021-09-21 17:30:24 +00:00
|
|
|
const { _dialog, 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
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 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
|
|
|
_onEscKey: (KeyboardEvent) => void;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Key handler for overflow menu.
|
|
|
|
*
|
|
|
|
* @param {KeyboardEvent} e - Esc key click to close the popup.
|
|
|
|
* @returns {void}
|
|
|
|
*/
|
|
|
|
_onEscKey(e) {
|
|
|
|
if (e.key === 'Escape') {
|
|
|
|
e.stopPropagation();
|
|
|
|
this._closeOverflowMenuIfOpen();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
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 {
|
|
|
|
_backgroundType,
|
2022-01-05 20:27:42 +00:00
|
|
|
_desktopSharingButtonDisabled,
|
2021-07-08 13:42:07 +00:00
|
|
|
_desktopSharingEnabled,
|
|
|
|
_localVideo,
|
2022-03-15 17:24:49 +00:00
|
|
|
_screenSharing,
|
2021-07-08 13:42:07 +00:00
|
|
|
_virtualSource,
|
|
|
|
dispatch
|
|
|
|
} = this.props;
|
|
|
|
|
|
|
|
if (_backgroundType === VIRTUAL_BACKGROUND_TYPE.DESKTOP_SHARE) {
|
|
|
|
const noneOptions = {
|
|
|
|
enabled: false,
|
|
|
|
backgroundType: VIRTUAL_BACKGROUND_TYPE.NONE,
|
|
|
|
selectedThumbnail: VIRTUAL_BACKGROUND_TYPE.NONE,
|
|
|
|
backgroundEffectEnabled: false
|
|
|
|
};
|
|
|
|
|
|
|
|
_virtualSource.dispose();
|
|
|
|
|
|
|
|
dispatch(toggleBackgroundEffect(noneOptions, _localVideo));
|
|
|
|
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
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,
|
2021-11-17 11:55:10 +00:00
|
|
|
_isIosMobile,
|
2021-07-08 13:42:07 +00:00
|
|
|
_isMobile,
|
2022-03-08 09:10:30 +00:00
|
|
|
_hasSalesforce,
|
2021-09-21 17:30:24 +00:00
|
|
|
_screenSharing
|
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
|
|
|
|
};
|
|
|
|
|
|
|
|
const etherpad = {
|
|
|
|
key: 'etherpad',
|
|
|
|
Content: SharedDocumentButton,
|
|
|
|
group: 3
|
|
|
|
};
|
|
|
|
|
2021-08-20 08:53:11 +00:00
|
|
|
const virtualBackground = !_screenSharing && {
|
2021-07-08 13:42:07 +00:00
|
|
|
key: 'select-background',
|
|
|
|
Content: VideoBackgroundButton,
|
|
|
|
group: 3
|
|
|
|
};
|
|
|
|
|
2022-05-23 12:42:25 +00:00
|
|
|
const dockIframe = {
|
|
|
|
key: 'dock-iframe',
|
|
|
|
Content: DockIframeButton,
|
|
|
|
group: 3
|
|
|
|
};
|
|
|
|
|
|
|
|
const undockIframe = {
|
|
|
|
key: 'undock-iframe',
|
|
|
|
Content: UndockIframeButton,
|
|
|
|
group: 3
|
|
|
|
};
|
|
|
|
|
2021-07-08 13:42:07 +00:00
|
|
|
const speakerStats = {
|
|
|
|
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,
|
|
|
|
etherpad,
|
|
|
|
virtualBackground,
|
2022-05-23 12:42:25 +00:00
|
|
|
dockIframe,
|
|
|
|
undockIframe,
|
2021-07-08 13:42:07 +00:00
|
|
|
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.
|
|
|
|
*/
|
|
|
|
_getButtonNotifyMode(btnName) {
|
|
|
|
const notify = this.props._buttonsWithNotifyClick?.find(
|
|
|
|
(btn: string | Object) =>
|
|
|
|
(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-01-04 11:21:00 +00:00
|
|
|
_setButtonsNotifyClickMode(buttons) {
|
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,
|
2021-07-09 12:36:19 +00:00
|
|
|
_toolbarButtons
|
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 = [
|
|
|
|
...order.map(key => buttons[key]),
|
|
|
|
...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 }) =>
|
|
|
|
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
|
|
|
_onMouseOut: () => void;
|
2017-02-16 23:02:40 +00:00
|
|
|
|
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
|
|
|
_onMouseOver: () => void;
|
|
|
|
|
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));
|
|
|
|
}
|
|
|
|
|
2019-03-05 14:26:45 +00:00
|
|
|
|
2018-04-09 05:03:26 +00:00
|
|
|
_onSetOverflowVisible: (boolean) => void;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Sets the visibility of the overflow menu.
|
|
|
|
*
|
|
|
|
* @param {boolean} visible - Whether or not the overflow menu should be
|
|
|
|
* displayed.
|
|
|
|
* @private
|
|
|
|
* @returns {void}
|
|
|
|
*/
|
|
|
|
_onSetOverflowVisible(visible) {
|
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
|
|
|
}
|
|
|
|
|
|
|
|
_onShortcutToggleChat: () => void;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Creates an analytics keyboard shortcut event and dispatches an action for
|
|
|
|
* toggling the display of chat.
|
|
|
|
*
|
|
|
|
* @private
|
|
|
|
* @returns {void}
|
|
|
|
*/
|
|
|
|
_onShortcutToggleChat() {
|
|
|
|
sendAnalytics(createShortcutEvent(
|
|
|
|
'toggle.chat',
|
|
|
|
{
|
|
|
|
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
|
|
|
|
if (window.getSelection().toString() !== '') {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2018-04-09 05:03:26 +00:00
|
|
|
this._doToggleChat();
|
|
|
|
}
|
|
|
|
|
2021-04-21 13:48:05 +00:00
|
|
|
_onShortcutToggleParticipantsPane: () => void;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 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',
|
|
|
|
{
|
|
|
|
enable: !this.props._participantsPaneOpen
|
|
|
|
}));
|
|
|
|
|
|
|
|
this._onToolbarToggleParticipantsPane();
|
|
|
|
}
|
|
|
|
|
2019-07-28 15:36:11 +00:00
|
|
|
_onShortcutToggleVideoQuality: () => void;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 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
|
|
|
_onShortcutToggleTileView: () => void;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Dispatches an action for toggling the tile view.
|
|
|
|
*
|
|
|
|
* @private
|
|
|
|
* @returns {void}
|
|
|
|
*/
|
|
|
|
_onShortcutToggleTileView() {
|
|
|
|
sendAnalytics(createShortcutEvent(
|
|
|
|
'toggle.tileview',
|
|
|
|
{
|
|
|
|
enable: !this.props._tileViewEnabled
|
|
|
|
}));
|
|
|
|
|
|
|
|
this._doToggleTileView();
|
|
|
|
}
|
|
|
|
|
2018-04-09 05:03:26 +00:00
|
|
|
_onShortcutToggleFullScreen: () => void;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Creates an analytics keyboard shortcut event and dispatches an action for
|
|
|
|
* toggling full screen mode.
|
|
|
|
*
|
|
|
|
* @private
|
|
|
|
* @returns {void}
|
|
|
|
*/
|
|
|
|
_onShortcutToggleFullScreen() {
|
|
|
|
sendAnalytics(createShortcutEvent(
|
|
|
|
'toggle.fullscreen',
|
|
|
|
{
|
|
|
|
enable: !this.props._fullScreen
|
|
|
|
}));
|
|
|
|
|
|
|
|
this._doToggleFullScreen();
|
|
|
|
}
|
|
|
|
|
|
|
|
_onShortcutToggleRaiseHand: () => void;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 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();
|
|
|
|
}
|
|
|
|
|
|
|
|
_onShortcutToggleScreenshare: () => void;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 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
|
|
|
}
|
|
|
|
|
2021-01-15 11:43:09 +00:00
|
|
|
_onTabIn: () => void;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 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
|
|
|
}
|
|
|
|
}
|
2021-04-21 13:48:05 +00:00
|
|
|
_onToolbarToggleParticipantsPane: () => void;
|
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
|
|
|
}
|
|
|
|
|
|
|
|
_onToolbarOpenVideoQuality: () => void;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 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();
|
|
|
|
}
|
|
|
|
|
|
|
|
_onToolbarToggleChat: () => void;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 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();
|
|
|
|
}
|
|
|
|
|
|
|
|
_onToolbarToggleFullScreen: () => void;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 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
|
|
|
_onToolbarToggleRaiseHand: () => void;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 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
|
|
|
_onToolbarToggleScreenshare: () => void;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 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',
|
|
|
|
ACTION_SHORTCUT_TRIGGERED,
|
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() {
|
2019-03-05 14:26:45 +00:00
|
|
|
const {
|
|
|
|
_desktopSharingEnabled,
|
|
|
|
_desktopSharingDisabledTooltipKey
|
|
|
|
} = this.props;
|
|
|
|
|
2021-07-08 13:42:07 +00:00
|
|
|
return _desktopSharingEnabled || _desktopSharingDisabledTooltipKey;
|
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 {
|
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;
|
|
|
|
}, []).map(buttonGroup => (
|
|
|
|
<ContextMenuItemGroup key = { `group-${buttonGroup[0].group}` }>
|
|
|
|
{buttonGroup.map(({ key, Content, ...rest }) => (
|
|
|
|
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>
|
|
|
|
)}
|
|
|
|
|
2021-03-18 12:09:22 +00:00
|
|
|
<HangupButton
|
2022-04-19 10:26:07 +00:00
|
|
|
buttonKey = 'hangup'
|
2021-03-18 12:09:22 +00:00
|
|
|
customClass = 'hangup-button'
|
2021-05-19 23:23:40 +00:00
|
|
|
key = 'hangup-button'
|
2022-04-19 10:26:07 +00:00
|
|
|
notifyMode = { this._getButtonNotifyMode('hangup') }
|
2021-07-09 12:36:19 +00:00
|
|
|
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
|
|
|
*/
|
2021-08-20 08:53:11 +00:00
|
|
|
function _mapStateToProps(state, ownProps) {
|
2021-07-08 13:42:07 +00:00
|
|
|
const { conference } = state['features/base/conference'];
|
2020-11-03 09:44:41 +00:00
|
|
|
let desktopSharingEnabled = JitsiMeetJS.isDesktopSharingEnabled();
|
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,
|
|
|
|
enableFeaturesBasedOnToken,
|
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,
|
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'];
|
2017-02-16 23:02:40 +00:00
|
|
|
|
2018-06-15 18:10:22 +00:00
|
|
|
let desktopSharingDisabledTooltipKey;
|
|
|
|
|
2020-03-30 14:17:18 +00:00
|
|
|
if (enableFeaturesBasedOnToken) {
|
2021-07-09 12:36:19 +00:00
|
|
|
if (desktopSharingEnabled) {
|
|
|
|
// we enable desktop sharing if any participant already have this
|
|
|
|
// feature enabled and if the user supports it.
|
|
|
|
desktopSharingEnabled = haveParticipantWithScreenSharingFeature(state);
|
|
|
|
desktopSharingDisabledTooltipKey = 'dialog.shareYourScreenDisabled';
|
|
|
|
}
|
2018-06-15 18:10:22 +00:00
|
|
|
}
|
|
|
|
|
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,
|
|
|
|
_desktopSharingEnabled: desktopSharingEnabled,
|
2022-01-05 20:27:42 +00:00
|
|
|
_desktopSharingButtonDisabled: isDesktopShareButtonDisabled(state),
|
2018-06-15 18:10:22 +00:00
|
|
|
_desktopSharingDisabledTooltipKey: desktopSharingDisabledTooltipKey,
|
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),
|
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(),
|
2020-09-23 09:09:07 +00:00
|
|
|
_isVpaasMeeting: isVpaasMeeting(state),
|
2022-03-31 13:11:44 +00:00
|
|
|
_hasSalesforce: isSalesforceEnabled(state),
|
2021-07-09 12:36:19 +00:00
|
|
|
_localParticipantID: localParticipant?.id,
|
2021-05-24 12:30:45 +00:00
|
|
|
_localVideo: localVideo,
|
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,
|
|
|
|
_visible: isToolboxVisible(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)));
|