2018-04-09 05:03:26 +00:00
|
|
|
// @flow
|
2017-02-16 23:02:40 +00:00
|
|
|
|
|
|
|
import React, { Component } from 'react';
|
|
|
|
|
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';
|
2021-03-10 15:39:35 +00:00
|
|
|
import { getToolbarButtons } from '../../../base/config';
|
2019-07-28 15:36:11 +00:00
|
|
|
import { openDialog, toggleDialog } from '../../../base/dialog';
|
2021-03-12 12:19:04 +00:00
|
|
|
import { isMobileBrowser } from '../../../base/environment/utils';
|
2018-05-10 23:01:55 +00:00
|
|
|
import { translate } from '../../../base/i18n';
|
2019-08-30 16:39:06 +00:00
|
|
|
import {
|
|
|
|
IconChat,
|
2020-07-23 08:16:40 +00:00
|
|
|
IconCodeBlock,
|
2021-02-23 11:09:22 +00:00
|
|
|
IconDeviceDocument,
|
2019-08-30 16:39:06 +00:00
|
|
|
IconExitFullScreen,
|
|
|
|
IconFeedback,
|
|
|
|
IconFullScreen,
|
2020-04-01 07:47:51 +00:00
|
|
|
IconInviteMore,
|
2019-08-30 16:39:06 +00:00
|
|
|
IconPresentation,
|
|
|
|
IconRaisedHand,
|
|
|
|
IconRec,
|
2021-03-03 14:37:38 +00:00
|
|
|
IconShareDesktop
|
2019-08-30 16:39:06 +00:00
|
|
|
} from '../../../base/icons';
|
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,
|
2018-06-15 18:10:22 +00:00
|
|
|
getParticipants,
|
2018-08-22 17:49:58 +00:00
|
|
|
participantUpdated
|
2018-05-10 23:01:55 +00:00
|
|
|
} from '../../../base/participants';
|
2021-03-10 15:39:35 +00:00
|
|
|
import { connect } from '../../../base/redux';
|
2020-07-24 12:14:33 +00:00
|
|
|
import { OverflowMenuItem } from '../../../base/toolbox/components';
|
2018-05-10 23:01:55 +00:00
|
|
|
import { getLocalVideoTrack, toggleScreensharing } from '../../../base/tracks';
|
2020-09-23 09:09:07 +00:00
|
|
|
import { isVpaasMeeting } from '../../../billing-counter/functions';
|
2021-03-23 12:06:43 +00:00
|
|
|
import { ChatCounter, toggleChat } from '../../../chat';
|
2021-03-18 12:09:22 +00:00
|
|
|
import { InviteMore } from '../../../conference';
|
2020-07-23 08:16:40 +00:00
|
|
|
import { EmbedMeetingDialog } from '../../../embed-meeting';
|
2019-10-08 12:27:35 +00:00
|
|
|
import { SharedDocumentButton } from '../../../etherpad';
|
2018-05-10 23:01:55 +00:00
|
|
|
import { openFeedbackDialog } from '../../../feedback';
|
2020-04-01 07:47:51 +00:00
|
|
|
import { beginAddPeople } from '../../../invite';
|
2018-05-10 23:01:55 +00:00
|
|
|
import { openKeyboardShortcutsDialog } from '../../../keyboard-shortcuts';
|
2021-02-23 11:09:22 +00:00
|
|
|
import { LocalRecordingInfoDialog } from '../../../local-recording';
|
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';
|
2020-04-01 07:47:51 +00:00
|
|
|
import { SecurityDialogButton } from '../../../security';
|
2018-06-20 20:19:53 +00:00
|
|
|
import {
|
|
|
|
SETTINGS_TABS,
|
|
|
|
SettingsButton,
|
|
|
|
openSettingsDialog
|
|
|
|
} from '../../../settings';
|
2021-03-03 14:37:38 +00:00
|
|
|
import { SharedVideoButton } from '../../../shared-video/components';
|
2018-05-10 23:01:55 +00:00
|
|
|
import { SpeakerStats } from '../../../speaker-stats';
|
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';
|
2018-04-11 20:04:40 +00:00
|
|
|
import {
|
|
|
|
OverflowMenuVideoQualityItem,
|
|
|
|
VideoQualityDialog
|
2018-05-10 23:01:55 +00:00
|
|
|
} from '../../../video-quality';
|
2021-02-18 15:52:47 +00:00
|
|
|
import { VideoBackgroundButton } from '../../../virtual-background';
|
|
|
|
import { checkBlurSupport } from '../../../virtual-background/functions';
|
2018-04-20 11:24:14 +00:00
|
|
|
import {
|
|
|
|
setFullScreen,
|
|
|
|
setOverflowMenuVisible,
|
2021-01-15 11:43:09 +00:00
|
|
|
setToolbarHovered,
|
|
|
|
setToolboxVisible
|
2018-05-10 23:01:55 +00:00
|
|
|
} from '../../actions';
|
2021-02-23 11:09:22 +00:00
|
|
|
import { getToolbarAdditionalButtons, 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-11-10 14:49:38 +00:00
|
|
|
import MuteEveryoneButton from '../MuteEveryoneButton';
|
2021-03-22 09:49:25 +00:00
|
|
|
import MuteEveryonesVideoButton from '../MuteEveryonesVideoButton';
|
2020-05-20 10:57:03 +00:00
|
|
|
|
|
|
|
import AudioSettingsButton from './AudioSettingsButton';
|
2018-04-09 05:03:26 +00:00
|
|
|
import OverflowMenuButton from './OverflowMenuButton';
|
|
|
|
import OverflowMenuProfileItem from './OverflowMenuProfileItem';
|
2021-03-17 08:44:18 +00:00
|
|
|
import ToggleCameraButton from './ToggleCameraButton';
|
2018-04-10 03:27:19 +00:00
|
|
|
import ToolbarButton from './ToolbarButton';
|
2020-03-30 14:17:18 +00:00
|
|
|
import VideoSettingsButton from './VideoSettingsButton';
|
2018-04-09 05:03:26 +00:00
|
|
|
|
2021-03-03 14:37:38 +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 = {
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 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,
|
|
|
|
|
|
|
|
/**
|
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,
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Whether or not call feedback can be sent.
|
|
|
|
*/
|
|
|
|
_feedbackConfigured: boolean,
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Whether or not the app is currently in full screen.
|
|
|
|
*/
|
|
|
|
_fullScreen: 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-11-05 17:35:03 +00:00
|
|
|
* Whether or not the tile view is enabled.
|
2018-05-14 16:22:38 +00:00
|
|
|
*/
|
2020-11-05 17:35:03 +00:00
|
|
|
_tileViewEnabled: boolean,
|
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,
|
|
|
|
|
2018-07-05 16:49:49 +00:00
|
|
|
/**
|
|
|
|
* The subsection of Redux state for local recording
|
|
|
|
*/
|
|
|
|
_localRecState: Object,
|
|
|
|
|
2020-04-01 07:47:51 +00:00
|
|
|
/**
|
|
|
|
* The value for how the conference is locked (or undefined if not locked)
|
|
|
|
* as defined by room-lock constants.
|
|
|
|
*/
|
|
|
|
_locked: boolean,
|
|
|
|
|
2018-04-20 11:24:14 +00:00
|
|
|
/**
|
|
|
|
* Whether or not the overflow menu is visible.
|
|
|
|
*/
|
|
|
|
_overflowMenuVisible: boolean,
|
|
|
|
|
2018-04-09 05:03:26 +00:00
|
|
|
/**
|
|
|
|
* Whether or not the local participant's hand is raised.
|
|
|
|
*/
|
|
|
|
_raisedHand: boolean,
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Whether or not the local participant is screensharing.
|
|
|
|
*/
|
|
|
|
_screensharing: boolean,
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Whether or not the local participant is sharing a YouTube video.
|
|
|
|
*/
|
|
|
|
_sharingVideo: boolean,
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Flag showing whether toolbar is visible.
|
|
|
|
*/
|
|
|
|
_visible: boolean,
|
|
|
|
|
2018-04-20 11:56:24 +00:00
|
|
|
/**
|
2021-03-10 15:39:35 +00:00
|
|
|
* Array with the buttons which this Toolbox should display.
|
2018-04-20 11:56:24 +00:00
|
|
|
*/
|
2021-03-10 15:39:35 +00:00
|
|
|
_visibleButtons: Array<string>,
|
2018-04-20 11:56:24 +00:00
|
|
|
|
2018-04-09 05:03:26 +00:00
|
|
|
/**
|
|
|
|
* Invoked to active other features of the app.
|
|
|
|
*/
|
|
|
|
dispatch: Function,
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Invoked to obtain translated strings.
|
|
|
|
*/
|
|
|
|
t: Function
|
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
|
|
|
|
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
|
|
|
*
|
|
|
|
* @extends Component
|
2017-02-16 23:02:40 +00:00
|
|
|
*/
|
2021-03-23 12:06:43 +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);
|
|
|
|
this._onShortcutToggleRaiseHand = this._onShortcutToggleRaiseHand.bind(this);
|
|
|
|
this._onShortcutToggleScreenshare = this._onShortcutToggleScreenshare.bind(this);
|
|
|
|
this._onShortcutToggleVideoQuality = this._onShortcutToggleVideoQuality.bind(this);
|
|
|
|
this._onToolbarOpenFeedback = this._onToolbarOpenFeedback.bind(this);
|
2018-04-09 05:03:26 +00:00
|
|
|
this._onToolbarOpenInvite = this._onToolbarOpenInvite.bind(this);
|
2019-10-11 14:51:42 +00:00
|
|
|
this._onToolbarOpenKeyboardShortcuts = this._onToolbarOpenKeyboardShortcuts.bind(this);
|
|
|
|
this._onToolbarOpenSpeakerStats = this._onToolbarOpenSpeakerStats.bind(this);
|
2020-07-23 08:16:40 +00:00
|
|
|
this._onToolbarOpenEmbedMeeting = this._onToolbarOpenEmbedMeeting.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);
|
|
|
|
this._onToolbarToggleProfile = this._onToolbarToggleProfile.bind(this);
|
|
|
|
this._onToolbarToggleRaiseHand = this._onToolbarToggleRaiseHand.bind(this);
|
|
|
|
this._onToolbarToggleScreenshare = this._onToolbarToggleScreenshare.bind(this);
|
|
|
|
this._onToolbarOpenLocalRecordingInfoDialog = this._onToolbarOpenLocalRecordingInfoDialog.bind(this);
|
2019-11-22 16:15:39 +00:00
|
|
|
this._onShortcutToggleTileView = this._onShortcutToggleTileView.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() {
|
|
|
|
const KEYBOARD_SHORTCUTS = [
|
2019-07-28 15:36:11 +00:00
|
|
|
this._shouldShowButton('videoquality') && {
|
|
|
|
character: 'A',
|
|
|
|
exec: this._onShortcutToggleVideoQuality,
|
2020-12-08 14:01:16 +00:00
|
|
|
helpDescription: 'toolbar.callQuality'
|
2019-07-28 15:36:11 +00:00
|
|
|
},
|
2018-04-09 05:03:26 +00:00
|
|
|
this._shouldShowButton('chat') && {
|
|
|
|
character: 'C',
|
|
|
|
exec: this._onShortcutToggleChat,
|
|
|
|
helpDescription: 'keyboardShortcuts.toggleChat'
|
|
|
|
},
|
|
|
|
this._shouldShowButton('desktop') && {
|
|
|
|
character: 'D',
|
|
|
|
exec: this._onShortcutToggleScreenshare,
|
|
|
|
helpDescription: 'keyboardShortcuts.toggleScreensharing'
|
|
|
|
},
|
|
|
|
this._shouldShowButton('raisehand') && {
|
|
|
|
character: 'R',
|
|
|
|
exec: this._onShortcutToggleRaiseHand,
|
|
|
|
helpDescription: 'keyboardShortcuts.raiseHand'
|
|
|
|
},
|
|
|
|
this._shouldShowButton('fullscreen') && {
|
|
|
|
character: 'S',
|
|
|
|
exec: this._onShortcutToggleFullScreen,
|
|
|
|
helpDescription: 'keyboardShortcuts.fullScreen'
|
2019-11-22 16:15:39 +00:00
|
|
|
},
|
|
|
|
this._shouldShowButton('tileview') && {
|
|
|
|
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);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Update the visibility of the {@code OverflowMenuButton}.
|
|
|
|
*
|
|
|
|
* @inheritdoc
|
|
|
|
*/
|
2018-10-29 02:09:50 +00:00
|
|
|
componentDidUpdate(prevProps) {
|
2018-04-09 05:03:26 +00:00
|
|
|
// Ensure the dialog is closed when the toolbox becomes hidden.
|
2018-10-29 02:09:50 +00:00
|
|
|
if (prevProps._overflowMenuVisible && !this.props._visible) {
|
2018-04-09 05:03:26 +00:00
|
|
|
this._onSetOverflowVisible(false);
|
|
|
|
}
|
|
|
|
|
2018-10-29 02:09:50 +00:00
|
|
|
if (prevProps._overflowMenuVisible
|
|
|
|
&& !prevProps._dialog
|
|
|
|
&& this.props._dialog) {
|
2018-04-09 05:03:26 +00:00
|
|
|
this._onSetOverflowVisible(false);
|
|
|
|
this.props.dispatch(setToolbarHovered(false));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 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));
|
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() {
|
2020-03-11 09:45:42 +00:00
|
|
|
const { _chatOpen, _visible, _visibleButtons } = this.props;
|
2018-04-09 05:03:26 +00:00
|
|
|
const rootClassNames = `new-toolbox ${_visible ? 'visible' : ''} ${
|
2021-03-10 15:39:35 +00:00
|
|
|
_visibleButtons.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 }
|
|
|
|
id = 'new-toolbox'
|
2021-01-15 11:43:09 +00:00
|
|
|
onFocus = { this._onTabIn }
|
2018-04-09 05:03:26 +00:00
|
|
|
onMouseOut = { this._onMouseOut }
|
|
|
|
onMouseOver = { this._onMouseOver }>
|
2019-02-20 23:35:19 +00:00
|
|
|
{ this._renderToolboxContent() }
|
2017-02-16 23:02:40 +00:00
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
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));
|
|
|
|
}
|
|
|
|
|
2017-02-16 23:02:40 +00:00
|
|
|
/**
|
2018-04-09 05:03:26 +00:00
|
|
|
* Callback invoked to display {@code FeedbackDialog}.
|
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
|
|
|
_doOpenFeedback() {
|
|
|
|
const { _conference } = this.props;
|
2017-02-16 23:02:40 +00:00
|
|
|
|
2018-04-09 05:03:26 +00:00
|
|
|
this.props.dispatch(openFeedbackDialog(_conference));
|
|
|
|
}
|
|
|
|
|
2020-07-23 08:16:40 +00:00
|
|
|
/**
|
|
|
|
* Callback invoked to display {@code FeedbackDialog}.
|
|
|
|
*
|
|
|
|
* @private
|
|
|
|
* @returns {void}
|
|
|
|
*/
|
|
|
|
_doOpenEmbedMeeting() {
|
|
|
|
this.props.dispatch(openDialog(EmbedMeetingDialog));
|
|
|
|
}
|
|
|
|
|
2018-04-09 05:03:26 +00:00
|
|
|
/**
|
|
|
|
* Dispatches an action to display {@code KeyboardShortcuts}.
|
|
|
|
*
|
|
|
|
* @private
|
|
|
|
* @returns {void}
|
|
|
|
*/
|
|
|
|
_doOpenKeyboardShorcuts() {
|
|
|
|
this.props.dispatch(openKeyboardShortcutsDialog());
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Callback invoked to display {@code SpeakerStats}.
|
|
|
|
*
|
|
|
|
* @private
|
|
|
|
* @returns {void}
|
|
|
|
*/
|
|
|
|
_doOpenSpeakerStats() {
|
|
|
|
this.props.dispatch(openDialog(SpeakerStats, {
|
|
|
|
conference: this.props._conference
|
|
|
|
}));
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
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 show or hide the profile edit panel.
|
|
|
|
*
|
|
|
|
* @private
|
|
|
|
* @returns {void}
|
|
|
|
*/
|
|
|
|
_doToggleProfile() {
|
2018-06-20 20:19:53 +00:00
|
|
|
this.props.dispatch(openSettingsDialog(SETTINGS_TABS.PROFILE));
|
2018-04-09 05:03:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Dispatches an action to toggle the local participant's raised hand state.
|
|
|
|
*
|
|
|
|
* @private
|
|
|
|
* @returns {void}
|
|
|
|
*/
|
|
|
|
_doToggleRaiseHand() {
|
|
|
|
const { _localParticipantID, _raisedHand } = this.props;
|
2021-01-06 14:49:10 +00:00
|
|
|
const newRaisedStatus = !_raisedHand;
|
2018-04-09 05:03:26 +00:00
|
|
|
|
|
|
|
this.props.dispatch(participantUpdated({
|
Associate remote participant w/ JitsiConference (_UPDATED)
The commit message of "Associate remote participant w/ JitsiConference
(_JOINED)" explains the motivation for this commit.
Practically, _JOINED and _LEFT combined with "Remove remote participants
who are no longer of interest" should alleviate the problem with
multiplying remote participants to an acceptable level of annoyance.
Technically though, a remote participant cannot be identified by an ID
only. The ID is (somewhat) "unique" in the context of a single
JitsiConference instance. So in order to not have to scratch our heads
over an obscure corner, racing case, it's better to always identify
remote participants by the pair id-conference. Unfortunately, that's a
bit of a high order given the existing source code. So I've implemented
the cases which are the easiest so that new source code written with
participantUpdated is more likely to identify a remote participant with
the pair id-conference.
Additionally, the commit "Reduce direct read access to the
features/base/participants redux state" brings more control back to the
functions of the feature base/participants so that one day we can (if we
choose to) do something like, for example:
If getParticipants is called with a conference, it returns the
participants from features/base/participants who are associated with the
specified conference. If no conference is specified in the function
call, then default to the conference which is the primary focus of the
app at the time of the function call. Added to the above, this should
allow us to further reduce the cases in which we're identifying remote
participants by id only and get us even closer to a more "predictable"
behavior in corner, racing cases.
2018-05-22 21:47:43 +00:00
|
|
|
// XXX Only the local participant is allowed to update without
|
|
|
|
// stating the JitsiConference instance (i.e. participant property
|
|
|
|
// `conference` for a remote participant) because the local
|
|
|
|
// participant is uniquely identified by the very fact that there is
|
|
|
|
// only one local participant.
|
|
|
|
|
2018-04-09 05:03:26 +00:00
|
|
|
id: _localParticipantID,
|
|
|
|
local: true,
|
2021-01-06 14:49:10 +00:00
|
|
|
raisedHand: newRaisedStatus
|
2018-04-09 05:03:26 +00:00
|
|
|
}));
|
2021-01-06 14:49:10 +00:00
|
|
|
|
|
|
|
APP.API.notifyRaiseHandUpdated(_localParticipantID, newRaisedStatus);
|
2018-04-09 05:03:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Dispatches an action to toggle screensharing.
|
|
|
|
*
|
|
|
|
* @private
|
|
|
|
* @returns {void}
|
|
|
|
*/
|
|
|
|
_doToggleScreenshare() {
|
|
|
|
if (this.props._desktopSharingEnabled) {
|
|
|
|
this.props.dispatch(toggleScreensharing());
|
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());
|
|
|
|
}
|
|
|
|
|
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() {
|
|
|
|
this.props.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));
|
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
|
|
|
|
}));
|
|
|
|
|
|
|
|
this._doToggleChat();
|
|
|
|
}
|
|
|
|
|
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() {
|
|
|
|
sendAnalytics(createToolbarEvent(
|
|
|
|
'screen.sharing',
|
|
|
|
{
|
|
|
|
enable: !this.props._screensharing
|
|
|
|
}));
|
|
|
|
|
|
|
|
this._doToggleScreenshare();
|
|
|
|
}
|
|
|
|
|
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) {
|
|
|
|
this.props.dispatch(setToolboxVisible(true));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-04-09 05:03:26 +00:00
|
|
|
_onToolbarOpenFeedback: () => void;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Creates an analytics toolbar event and dispatches an action for toggling
|
|
|
|
* display of feedback.
|
|
|
|
*
|
|
|
|
* @private
|
|
|
|
* @returns {void}
|
|
|
|
*/
|
|
|
|
_onToolbarOpenFeedback() {
|
|
|
|
sendAnalytics(createToolbarEvent('feedback'));
|
|
|
|
|
|
|
|
this._doOpenFeedback();
|
|
|
|
}
|
|
|
|
|
|
|
|
_onToolbarOpenInvite: () => void;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Creates an analytics toolbar event and dispatches an action for opening
|
|
|
|
* the modal for inviting people directly into the conference.
|
|
|
|
*
|
|
|
|
* @private
|
|
|
|
* @returns {void}
|
|
|
|
*/
|
|
|
|
_onToolbarOpenInvite() {
|
|
|
|
sendAnalytics(createToolbarEvent('invite'));
|
2018-05-01 04:43:47 +00:00
|
|
|
this.props.dispatch(beginAddPeople());
|
2018-04-09 05:03:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
_onToolbarOpenKeyboardShortcuts: () => void;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Creates an analytics toolbar event and dispatches an action for opening
|
|
|
|
* the modal for showing available keyboard shortcuts.
|
|
|
|
*
|
|
|
|
* @private
|
|
|
|
* @returns {void}
|
|
|
|
*/
|
|
|
|
_onToolbarOpenKeyboardShortcuts() {
|
|
|
|
sendAnalytics(createToolbarEvent('shortcuts'));
|
|
|
|
|
|
|
|
this._doOpenKeyboardShorcuts();
|
|
|
|
}
|
|
|
|
|
2020-07-23 08:16:40 +00:00
|
|
|
_onToolbarOpenEmbedMeeting: () => void;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Creates an analytics toolbar event and dispatches an action for opening
|
|
|
|
* the embed meeting modal.
|
|
|
|
*
|
|
|
|
* @private
|
|
|
|
* @returns {void}
|
|
|
|
*/
|
|
|
|
_onToolbarOpenEmbedMeeting() {
|
|
|
|
sendAnalytics(createToolbarEvent('embed.meeting'));
|
|
|
|
|
|
|
|
this._doOpenEmbedMeeting();
|
|
|
|
}
|
|
|
|
|
2018-04-09 05:03:26 +00:00
|
|
|
_onToolbarOpenSpeakerStats: () => void;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Creates an analytics toolbar event and dispatches an action for opening
|
|
|
|
* the speaker stats modal.
|
|
|
|
*
|
|
|
|
* @private
|
|
|
|
* @returns {void}
|
|
|
|
*/
|
|
|
|
_onToolbarOpenSpeakerStats() {
|
|
|
|
sendAnalytics(createToolbarEvent('speaker.stats'));
|
|
|
|
|
|
|
|
this._doOpenSpeakerStats();
|
|
|
|
}
|
|
|
|
|
|
|
|
_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();
|
|
|
|
}
|
|
|
|
|
|
|
|
_onToolbarToggleProfile: () => void;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Creates an analytics toolbar event and dispatches an action for showing
|
|
|
|
* or hiding the profile edit panel.
|
|
|
|
*
|
|
|
|
* @private
|
|
|
|
* @returns {void}
|
|
|
|
*/
|
|
|
|
_onToolbarToggleProfile() {
|
|
|
|
sendAnalytics(createToolbarEvent('profile'));
|
|
|
|
|
|
|
|
this._doToggleProfile();
|
|
|
|
}
|
|
|
|
|
|
|
|
_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();
|
|
|
|
}
|
|
|
|
|
|
|
|
_onToolbarToggleScreenshare: () => void;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Creates an analytics toolbar event and dispatches an action for toggling
|
|
|
|
* screensharing.
|
|
|
|
*
|
|
|
|
* @private
|
|
|
|
* @returns {void}
|
|
|
|
*/
|
|
|
|
_onToolbarToggleScreenshare() {
|
|
|
|
if (!this.props._desktopSharingEnabled) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
sendAnalytics(createShortcutEvent(
|
|
|
|
'toggle.screen.sharing',
|
|
|
|
ACTION_SHORTCUT_TRIGGERED,
|
|
|
|
{ enable: !this.props._screensharing }));
|
|
|
|
|
2021-02-23 11:09:22 +00:00
|
|
|
this._closeOverflowMenuIfOpen();
|
2018-04-09 05:03:26 +00:00
|
|
|
this._doToggleScreenshare();
|
|
|
|
}
|
|
|
|
|
2018-07-18 22:12:25 +00:00
|
|
|
_onToolbarOpenLocalRecordingInfoDialog: () => void;
|
2018-06-19 16:43:33 +00:00
|
|
|
|
|
|
|
/**
|
2018-07-18 22:12:25 +00:00
|
|
|
* Opens the {@code LocalRecordingInfoDialog}.
|
2018-06-19 16:43:33 +00:00
|
|
|
*
|
|
|
|
* @private
|
|
|
|
* @returns {void}
|
|
|
|
*/
|
2018-07-18 22:12:25 +00:00
|
|
|
_onToolbarOpenLocalRecordingInfoDialog() {
|
|
|
|
sendAnalytics(createToolbarEvent('local.recording'));
|
|
|
|
|
2018-07-18 00:30:54 +00:00
|
|
|
this.props.dispatch(openDialog(LocalRecordingInfoDialog));
|
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;
|
|
|
|
|
2017-02-16 23:02:40 +00:00
|
|
|
return (
|
2021-02-23 11:09:22 +00:00
|
|
|
(_desktopSharingEnabled
|
|
|
|
|| _desktopSharingDisabledTooltipKey)
|
|
|
|
&& this._shouldShowButton('desktop')
|
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
|
|
|
|
&& !this.props._isMobile
|
|
|
|
&& this._shouldShowButton('embedmeeting');
|
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() {
|
2020-11-05 17:35:03 +00:00
|
|
|
return !this.props._isProfileDisabled && this._shouldShowButton('profile');
|
2019-03-05 14:26:45 +00:00
|
|
|
}
|
|
|
|
|
2018-04-09 05:03:26 +00:00
|
|
|
/**
|
|
|
|
* Renders the list elements of the overflow menu.
|
|
|
|
*
|
|
|
|
* @private
|
2021-02-23 11:09:22 +00:00
|
|
|
* @param {Array<React$Element>} additionalButtons - Additional buttons to be displayed.
|
|
|
|
* @returns {Array<React$Element>}
|
2018-04-09 05:03:26 +00:00
|
|
|
*/
|
2021-02-23 11:09:22 +00:00
|
|
|
_renderOverflowMenuContent(additionalButtons: Array<React$Element<any>>) {
|
2018-04-09 05:03:26 +00:00
|
|
|
const {
|
|
|
|
_feedbackConfigured,
|
|
|
|
_fullScreen,
|
2021-03-12 12:19:04 +00:00
|
|
|
_isMobile,
|
2019-07-08 09:42:39 +00:00
|
|
|
_screensharing,
|
2018-04-09 05:03:26 +00:00
|
|
|
t
|
|
|
|
} = this.props;
|
|
|
|
|
2021-02-23 11:09:22 +00:00
|
|
|
const group1 = [
|
|
|
|
...additionalButtons,
|
|
|
|
|
2021-03-17 08:44:18 +00:00
|
|
|
this._shouldShowButton('toggle-camera')
|
|
|
|
&& <ToggleCameraButton
|
|
|
|
key = 'toggle-camera'
|
|
|
|
showLabel = { true } />,
|
2018-04-10 06:06:01 +00:00
|
|
|
this._shouldShowButton('videoquality')
|
2018-04-11 20:04:40 +00:00
|
|
|
&& <OverflowMenuVideoQualityItem
|
2018-04-10 06:06:01 +00:00
|
|
|
key = 'videoquality'
|
2018-04-11 20:04:40 +00:00
|
|
|
onClick = { this._onToolbarOpenVideoQuality } />,
|
2018-04-10 06:06:01 +00:00
|
|
|
this._shouldShowButton('fullscreen')
|
2021-03-12 12:19:04 +00:00
|
|
|
&& !_isMobile
|
2018-04-10 06:06:01 +00:00
|
|
|
&& <OverflowMenuItem
|
2019-10-11 14:51:42 +00:00
|
|
|
accessibilityLabel = { t('toolbar.accessibilityLabel.fullScreen') }
|
|
|
|
icon = { _fullScreen ? IconExitFullScreen : IconFullScreen }
|
2018-04-10 06:06:01 +00:00
|
|
|
key = 'fullscreen'
|
|
|
|
onClick = { this._onToolbarToggleFullScreen }
|
2019-10-11 14:51:42 +00:00
|
|
|
text = { _fullScreen ? t('toolbar.exitFullScreen') : t('toolbar.enterFullScreen') } />,
|
2021-02-23 11:09:22 +00:00
|
|
|
this._shouldShowButton('security')
|
|
|
|
&& <SecurityDialogButton
|
|
|
|
key = 'security'
|
|
|
|
showLabel = { true } />,
|
|
|
|
this._shouldShowButton('closedcaptions')
|
|
|
|
&& <ClosedCaptionButton
|
|
|
|
key = 'closed-captions'
|
|
|
|
showLabel = { true } />,
|
2021-01-13 09:55:38 +00:00
|
|
|
this._shouldShowButton('recording')
|
|
|
|
&& <RecordButton
|
|
|
|
key = 'record'
|
|
|
|
showLabel = { true } />,
|
2021-02-23 11:09:22 +00:00
|
|
|
this._shouldShowButton('localrecording')
|
|
|
|
&& <OverflowMenuItem
|
|
|
|
accessibilityLabel = { t('toolbar.accessibilityLabel.localRecording') }
|
|
|
|
icon = { IconRec }
|
|
|
|
key = 'localrecording'
|
|
|
|
onClick = { this._onToolbarOpenLocalRecordingInfoDialog }
|
|
|
|
text = { t('localRecording.dialogTitle') } />,
|
|
|
|
this._shouldShowButton('mute-everyone')
|
|
|
|
&& <MuteEveryoneButton
|
|
|
|
key = 'mute-everyone'
|
|
|
|
showLabel = { true } />,
|
2021-03-22 09:49:25 +00:00
|
|
|
this._shouldShowButton('mute-video-everyone')
|
|
|
|
&& <MuteEveryonesVideoButton
|
|
|
|
key = 'mute-everyones-video'
|
|
|
|
showLabel = { true } />,
|
2021-02-23 11:09:22 +00:00
|
|
|
this._shouldShowButton('livestreaming')
|
|
|
|
&& <LiveStreamButton
|
|
|
|
key = 'livestreaming'
|
|
|
|
showLabel = { true } />
|
|
|
|
];
|
|
|
|
|
|
|
|
const group2 = [
|
2018-04-09 05:03:26 +00:00
|
|
|
this._shouldShowButton('sharedvideo')
|
2021-03-03 14:37:38 +00:00
|
|
|
&& <SharedVideoButton
|
2018-04-09 05:03:26 +00:00
|
|
|
key = 'sharedvideo'
|
2021-03-03 14:37:38 +00:00
|
|
|
showLabel = { true } />,
|
2018-04-09 05:03:26 +00:00
|
|
|
this._shouldShowButton('etherpad')
|
2019-10-08 12:27:35 +00:00
|
|
|
&& <SharedDocumentButton
|
2018-04-09 05:03:26 +00:00
|
|
|
key = 'etherpad'
|
2019-10-08 12:27:35 +00:00
|
|
|
showLabel = { true } />,
|
2021-02-18 15:52:47 +00:00
|
|
|
(this._shouldShowButton('select-background') || this._shouldShowButton('videobackgroundblur'))
|
|
|
|
&& <VideoBackgroundButton
|
|
|
|
key = { 'select-background' }
|
2021-01-13 09:55:38 +00:00
|
|
|
showLabel = { true }
|
2021-02-25 12:21:03 +00:00
|
|
|
visible = { !_screensharing && checkBlurSupport() } />,
|
2018-04-09 05:03:26 +00:00
|
|
|
this._shouldShowButton('stats')
|
|
|
|
&& <OverflowMenuItem
|
2019-10-11 14:51:42 +00:00
|
|
|
accessibilityLabel = { t('toolbar.accessibilityLabel.speakerStats') }
|
2019-08-30 16:39:06 +00:00
|
|
|
icon = { IconPresentation }
|
2018-04-09 05:03:26 +00:00
|
|
|
key = 'stats'
|
|
|
|
onClick = { this._onToolbarOpenSpeakerStats }
|
2021-02-23 11:09:22 +00:00
|
|
|
text = { t('toolbar.speakerStats') } />
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
|
|
return [
|
|
|
|
this._isProfileVisible()
|
|
|
|
&& <OverflowMenuProfileItem
|
|
|
|
key = 'profile'
|
|
|
|
onClick = { this._onToolbarToggleProfile } />,
|
|
|
|
this._isProfileVisible()
|
|
|
|
&& <hr
|
|
|
|
className = 'overflow-menu-hr'
|
|
|
|
key = 'hr1' />,
|
|
|
|
|
|
|
|
...group1,
|
|
|
|
group1.some(Boolean)
|
|
|
|
&& <hr
|
|
|
|
className = 'overflow-menu-hr'
|
|
|
|
key = 'hr2' />,
|
|
|
|
|
|
|
|
...group2,
|
|
|
|
group2.some(Boolean)
|
|
|
|
&& <hr
|
|
|
|
className = 'overflow-menu-hr'
|
|
|
|
key = 'hr3' />,
|
|
|
|
|
|
|
|
this._shouldShowButton('settings')
|
|
|
|
&& <SettingsButton
|
|
|
|
key = 'settings'
|
|
|
|
showLabel = { true } />,
|
|
|
|
this._shouldShowButton('shortcuts')
|
2021-03-12 12:19:04 +00:00
|
|
|
&& !_isMobile
|
2021-02-23 11:09:22 +00:00
|
|
|
&& <OverflowMenuItem
|
|
|
|
accessibilityLabel = { t('toolbar.accessibilityLabel.shortcuts') }
|
|
|
|
icon = { IconDeviceDocument }
|
|
|
|
key = 'shortcuts'
|
|
|
|
onClick = { this._onToolbarOpenKeyboardShortcuts }
|
|
|
|
text = { t('toolbar.shortcuts') } />,
|
2020-09-23 09:09:07 +00:00
|
|
|
this._isEmbedMeetingVisible()
|
2020-07-23 08:16:40 +00:00
|
|
|
&& <OverflowMenuItem
|
|
|
|
accessibilityLabel = { t('toolbar.accessibilityLabel.embedMeeting') }
|
|
|
|
icon = { IconCodeBlock }
|
|
|
|
key = 'embed'
|
|
|
|
onClick = { this._onToolbarOpenEmbedMeeting }
|
|
|
|
text = { t('toolbar.embedMeeting') } />,
|
2018-04-09 05:03:26 +00:00
|
|
|
this._shouldShowButton('feedback')
|
|
|
|
&& _feedbackConfigured
|
|
|
|
&& <OverflowMenuItem
|
2019-10-11 14:51:42 +00:00
|
|
|
accessibilityLabel = { t('toolbar.accessibilityLabel.feedback') }
|
2019-08-30 16:39:06 +00:00
|
|
|
icon = { IconFeedback }
|
2018-04-09 05:03:26 +00:00
|
|
|
key = 'feedback'
|
|
|
|
onClick = { this._onToolbarOpenFeedback }
|
|
|
|
text = { t('toolbar.feedback') } />,
|
2019-10-16 11:11:02 +00:00
|
|
|
this._shouldShowButton('download')
|
|
|
|
&& <DownloadButton
|
|
|
|
key = 'download'
|
|
|
|
showLabel = { true } />,
|
2019-10-11 14:51:42 +00:00
|
|
|
this._shouldShowButton('help')
|
|
|
|
&& <HelpButton
|
|
|
|
key = 'help'
|
|
|
|
showLabel = { true } />
|
2018-04-09 05:03:26 +00:00
|
|
|
];
|
|
|
|
}
|
|
|
|
|
2019-03-05 14:26:45 +00:00
|
|
|
/**
|
2021-03-16 15:59:33 +00:00
|
|
|
* Returns the buttons to be displayed in main or the overflow menu.
|
2019-03-05 14:26:45 +00:00
|
|
|
*
|
2021-02-23 11:09:22 +00:00
|
|
|
* @param {Set} buttons - A set containing the buttons to be displayed
|
|
|
|
* in the toolbar beside the main audio/video & hanugup.
|
|
|
|
* @returns {Object}
|
2019-03-05 14:26:45 +00:00
|
|
|
*/
|
2021-02-23 11:09:22 +00:00
|
|
|
_getAdditionalButtons(buttons) {
|
2019-03-05 14:26:45 +00:00
|
|
|
const {
|
|
|
|
_chatOpen,
|
2021-02-23 11:09:22 +00:00
|
|
|
_desktopSharingEnabled,
|
|
|
|
_desktopSharingDisabledTooltipKey,
|
2019-03-05 14:26:45 +00:00
|
|
|
_raisedHand,
|
2021-02-23 11:09:22 +00:00
|
|
|
_screensharing,
|
2019-03-05 14:26:45 +00:00
|
|
|
t
|
|
|
|
} = this.props;
|
|
|
|
|
2021-02-23 11:09:22 +00:00
|
|
|
const overflowMenuAdditionalButtons = [];
|
|
|
|
const mainMenuAdditionalButtons = [];
|
|
|
|
|
|
|
|
if (this._showDesktopSharingButton()) {
|
|
|
|
buttons.has('desktop')
|
|
|
|
? mainMenuAdditionalButtons.push(<ToolbarButton
|
|
|
|
accessibilityLabel = { t('toolbar.accessibilityLabel.shareYourScreen') }
|
|
|
|
disabled = { !_desktopSharingEnabled }
|
|
|
|
icon = { IconShareDesktop }
|
|
|
|
key = 'desktop'
|
|
|
|
onClick = { this._onToolbarToggleScreenshare }
|
|
|
|
toggled = { _screensharing }
|
|
|
|
tooltip = { t(_desktopSharingEnabled
|
|
|
|
? 'dialog.shareYourScreen' : _desktopSharingDisabledTooltipKey) } />)
|
|
|
|
: overflowMenuAdditionalButtons.push(<OverflowMenuItem
|
|
|
|
accessibilityLabel = { t('toolbar.accessibilityLabel.shareYourScreen') }
|
|
|
|
icon = { IconShareDesktop }
|
|
|
|
iconId = 'share-desktop'
|
|
|
|
key = 'desktop'
|
|
|
|
onClick = { this._onToolbarToggleScreenshare }
|
|
|
|
text = { t(`toolbar.${_screensharing ? 'stopScreenSharing' : 'startScreenSharing'}`) } />);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (this._shouldShowButton('chat')) {
|
|
|
|
buttons.has('chat')
|
2021-03-16 12:25:30 +00:00
|
|
|
? mainMenuAdditionalButtons.push(<div
|
|
|
|
className = 'toolbar-button-with-badge'
|
|
|
|
key = 'chatcontainer'>
|
2021-02-23 11:09:22 +00:00
|
|
|
<ToolbarButton
|
|
|
|
accessibilityLabel = { t('toolbar.accessibilityLabel.chat') }
|
2019-08-30 16:39:06 +00:00
|
|
|
icon = { IconChat }
|
2019-03-05 14:26:45 +00:00
|
|
|
key = 'chat'
|
|
|
|
onClick = { this._onToolbarToggleChat }
|
2021-02-23 11:09:22 +00:00
|
|
|
toggled = { _chatOpen }
|
|
|
|
tooltip = { t('toolbar.chat') } />
|
|
|
|
<ChatCounter />
|
|
|
|
</div>) : overflowMenuAdditionalButtons.push(<OverflowMenuItem
|
|
|
|
accessibilityLabel = { t('toolbar.accessibilityLabel.chat') }
|
|
|
|
icon = { IconChat }
|
|
|
|
key = 'chat'
|
|
|
|
onClick = { this._onToolbarToggleChat }
|
|
|
|
text = { t(`toolbar.${_chatOpen ? 'closeChat' : 'openChat'}`) } />);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (this._shouldShowButton('raisehand')) {
|
|
|
|
buttons.has('raisehand')
|
|
|
|
? mainMenuAdditionalButtons.push(<ToolbarButton
|
|
|
|
accessibilityLabel = { t('toolbar.accessibilityLabel.raiseHand') }
|
|
|
|
icon = { IconRaisedHand }
|
|
|
|
key = 'raisehand'
|
|
|
|
onClick = { this._onToolbarToggleRaiseHand }
|
|
|
|
toggled = { _raisedHand }
|
|
|
|
tooltip = { t(`toolbar.${_raisedHand ? 'lowerYourHand' : 'raiseYourHand'}`) } />)
|
|
|
|
: overflowMenuAdditionalButtons.push(<OverflowMenuItem
|
|
|
|
accessibilityLabel = { t('toolbar.accessibilityLabel.raiseHand') }
|
|
|
|
icon = { IconRaisedHand }
|
|
|
|
key = 'raisehand'
|
|
|
|
onClick = { this._onToolbarToggleRaiseHand }
|
|
|
|
text = { t(`toolbar.${_raisedHand ? 'lowerYourHand' : 'raiseYourHand'}`) } />);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (this._shouldShowButton('tileview')) {
|
|
|
|
buttons.has('tileview')
|
|
|
|
? mainMenuAdditionalButtons.push(
|
|
|
|
<TileViewButton
|
|
|
|
key = 'tileview'
|
2021-03-15 07:49:17 +00:00
|
|
|
showLabel = { false } />)
|
2021-02-23 11:09:22 +00:00
|
|
|
: overflowMenuAdditionalButtons.push(
|
|
|
|
<TileViewButton
|
|
|
|
key = 'tileview'
|
|
|
|
showLabel = { true } />);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (this._shouldShowButton('invite')) {
|
|
|
|
buttons.has('invite')
|
|
|
|
? mainMenuAdditionalButtons.push(
|
|
|
|
<ToolbarButton
|
|
|
|
accessibilityLabel = { t('toolbar.accessibilityLabel.invite') }
|
|
|
|
icon = { IconInviteMore }
|
|
|
|
key = 'invite'
|
|
|
|
onClick = { this._onToolbarOpenInvite }
|
|
|
|
tooltip = { t('toolbar.invite') } />)
|
|
|
|
: overflowMenuAdditionalButtons.push(
|
2019-03-05 14:26:45 +00:00
|
|
|
<OverflowMenuItem
|
2019-10-11 14:51:42 +00:00
|
|
|
accessibilityLabel = { t('toolbar.accessibilityLabel.invite') }
|
2020-04-01 07:47:51 +00:00
|
|
|
icon = { IconInviteMore }
|
2019-03-05 14:26:45 +00:00
|
|
|
key = 'invite'
|
|
|
|
onClick = { this._onToolbarOpenInvite }
|
|
|
|
text = { t('toolbar.invite') } />
|
|
|
|
);
|
2021-02-23 11:09:22 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return {
|
|
|
|
mainMenuAdditionalButtons,
|
|
|
|
overflowMenuAdditionalButtons
|
|
|
|
};
|
2019-03-05 14:26:45 +00:00
|
|
|
}
|
|
|
|
|
2020-03-30 14:17:18 +00:00
|
|
|
/**
|
|
|
|
* Renders the Audio controlling button.
|
|
|
|
*
|
|
|
|
* @returns {ReactElement}
|
|
|
|
*/
|
|
|
|
_renderAudioButton() {
|
|
|
|
return this._shouldShowButton('microphone')
|
2020-04-01 18:07:43 +00:00
|
|
|
? <AudioSettingsButton
|
|
|
|
key = 'asb'
|
|
|
|
visible = { true } />
|
2020-03-30 14:17:18 +00:00
|
|
|
: null;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Renders the Video controlling button.
|
|
|
|
*
|
|
|
|
* @returns {ReactElement}
|
|
|
|
*/
|
|
|
|
_renderVideoButton() {
|
|
|
|
return this._shouldShowButton('camera')
|
2020-04-01 18:07:43 +00:00
|
|
|
? <VideoSettingsButton
|
|
|
|
key = 'vsb'
|
|
|
|
visible = { true } />
|
2020-03-30 14:17:18 +00:00
|
|
|
: null;
|
|
|
|
}
|
|
|
|
|
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-23 12:06:43 +00:00
|
|
|
_clientWidth,
|
2021-03-12 12:19:04 +00:00
|
|
|
_isMobile,
|
2019-02-20 23:35:19 +00:00
|
|
|
_overflowMenuVisible,
|
|
|
|
t
|
|
|
|
} = this.props;
|
2020-04-01 07:47:51 +00:00
|
|
|
|
2021-03-23 12:06:43 +00:00
|
|
|
const buttonSet = getToolbarAdditionalButtons(_clientWidth, _isMobile);
|
2021-02-23 11:09:22 +00:00
|
|
|
const toolbarAccLabel = 'toolbar.accessibilityLabel.moreActionsMenu';
|
|
|
|
const showOverflowMenuButton = buttonSet.has('overflow');
|
2021-03-12 12:19:04 +00:00
|
|
|
const containerClassName = `toolbox-content${_isMobile ? ' toolbox-content-mobile' : ''}`;
|
2021-02-23 11:09:22 +00:00
|
|
|
let overflowMenuAdditionalButtons = [];
|
|
|
|
let mainMenuAdditionalButtons = [];
|
2019-03-05 14:26:45 +00:00
|
|
|
|
2021-03-12 12:19:04 +00:00
|
|
|
|
2021-02-23 11:09:22 +00:00
|
|
|
if (showOverflowMenuButton) {
|
|
|
|
({ overflowMenuAdditionalButtons, mainMenuAdditionalButtons } = this._getAdditionalButtons(buttonSet));
|
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-03-18 12:09:22 +00:00
|
|
|
<div className = 'toolbox-content-wrapper'>
|
|
|
|
<InviteMore />
|
|
|
|
<div className = 'toolbox-content-items'>
|
|
|
|
{ this._renderAudioButton() }
|
|
|
|
{ this._renderVideoButton() }
|
|
|
|
{ mainMenuAdditionalButtons }
|
|
|
|
{ showOverflowMenuButton && <OverflowMenuButton
|
|
|
|
isOpen = { _overflowMenuVisible }
|
|
|
|
onVisibilityChange = { this._onSetOverflowVisible }>
|
|
|
|
<ul
|
|
|
|
aria-label = { t(toolbarAccLabel) }
|
|
|
|
className = 'overflow-menu'>
|
|
|
|
{ this._renderOverflowMenuContent(overflowMenuAdditionalButtons) }
|
|
|
|
</ul>
|
|
|
|
</OverflowMenuButton>}
|
|
|
|
<HangupButton
|
|
|
|
customClass = 'hangup-button'
|
|
|
|
visible = { this._shouldShowButton('hangup') } />
|
|
|
|
</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
|
|
|
}
|
|
|
|
|
2018-04-09 05:03:26 +00:00
|
|
|
_shouldShowButton: (string) => boolean;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns if a button name has been explicitly configured to be displayed.
|
|
|
|
*
|
|
|
|
* @param {string} buttonName - The name of the button, as expected in
|
2018-08-08 20:35:40 +00:00
|
|
|
* {@link interfaceConfig}.
|
2018-04-09 05:03:26 +00:00
|
|
|
* @private
|
|
|
|
* @returns {boolean} True if the button should be displayed.
|
|
|
|
*/
|
|
|
|
_shouldShowButton(buttonName) {
|
2021-03-10 15:39:35 +00:00
|
|
|
return this.props._visibleButtons.includes(buttonName);
|
2018-04-09 05:03:26 +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.
|
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
|
|
|
*/
|
2018-04-09 05:03:26 +00:00
|
|
|
function _mapStateToProps(state) {
|
2020-04-01 07:47:51 +00:00
|
|
|
const { conference, locked } = 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 {
|
|
|
|
callStatsID,
|
2020-04-01 07:47:51 +00:00
|
|
|
enableFeaturesBasedOnToken
|
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,
|
2019-03-12 17:45:53 +00:00
|
|
|
overflowMenuVisible
|
2017-04-01 05:52:40 +00:00
|
|
|
} = state['features/toolbox'];
|
2018-04-09 05:03:26 +00:00
|
|
|
const localParticipant = getLocalParticipant(state);
|
2018-07-05 16:49:49 +00:00
|
|
|
const localRecordingStates = state['features/local-recording'];
|
2018-04-09 05:03:26 +00:00
|
|
|
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) {
|
2018-06-15 18:10:22 +00:00
|
|
|
// we enable desktop sharing if any participant already have this
|
|
|
|
// feature enabled
|
|
|
|
desktopSharingEnabled = getParticipants(state)
|
|
|
|
.find(({ features = {} }) =>
|
|
|
|
String(features['screen-sharing']) === 'true') !== undefined;
|
2020-11-05 18:00:16 +00:00
|
|
|
desktopSharingDisabledTooltipKey = 'dialog.shareYourScreenDisabled';
|
2018-06-15 18:10:22 +00:00
|
|
|
}
|
|
|
|
|
2017-02-16 23:02:40 +00:00
|
|
|
return {
|
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,
|
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),
|
|
|
|
_feedbackConfigured: Boolean(callStatsID),
|
2020-11-05 17:35:03 +00:00
|
|
|
_isProfileDisabled: Boolean(state['features/base/config'].disableProfile),
|
2021-03-12 12:19:04 +00:00
|
|
|
_isMobile: isMobileBrowser(),
|
2020-09-23 09:09:07 +00:00
|
|
|
_isVpaasMeeting: isVpaasMeeting(state),
|
2018-04-09 05:03:26 +00:00
|
|
|
_fullScreen: fullScreen,
|
2020-07-23 13:12:25 +00:00
|
|
|
_tileViewEnabled: shouldDisplayTileView(state),
|
2018-04-09 05:03:26 +00:00
|
|
|
_localParticipantID: localParticipant.id,
|
2018-06-19 16:43:33 +00:00
|
|
|
_localRecState: localRecordingStates,
|
2020-04-01 07:47:51 +00:00
|
|
|
_locked: locked,
|
2018-07-05 16:49:49 +00:00
|
|
|
_overflowMenuVisible: overflowMenuVisible,
|
2018-04-09 05:03:26 +00:00
|
|
|
_raisedHand: localParticipant.raisedHand,
|
|
|
|
_screensharing: localVideo && localVideo.videoType === 'desktop',
|
2019-03-12 17:45:53 +00:00
|
|
|
_visible: isToolboxVisible(state),
|
2021-03-10 15:39:35 +00:00
|
|
|
_visibleButtons: getToolbarButtons(state)
|
2017-02-16 23:02:40 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2018-04-09 05:03:26 +00:00
|
|
|
export default translate(connect(_mapStateToProps)(Toolbox));
|