You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Toolbox.js 43KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468
  1. // @flow
  2. import { withStyles } from '@material-ui/core/styles';
  3. import React, { Component } from 'react';
  4. import { batch } from 'react-redux';
  5. import keyboardShortcut from '../../../../../modules/keyboardshortcut/keyboardshortcut';
  6. import {
  7. ACTION_SHORTCUT_TRIGGERED,
  8. createShortcutEvent,
  9. createToolbarEvent,
  10. sendAnalytics
  11. } from '../../../analytics';
  12. import { ContextMenu, ContextMenuItemGroup } from '../../../base/components';
  13. import { getMultipleVideoSendingSupportFeatureFlag, getToolbarButtons } from '../../../base/config';
  14. import { isToolbarButtonEnabled } from '../../../base/config/functions.web';
  15. import { openDialog, toggleDialog } from '../../../base/dialog';
  16. import { isIosMobileBrowser, isMobileBrowser } from '../../../base/environment/utils';
  17. import { translate } from '../../../base/i18n';
  18. import JitsiMeetJS from '../../../base/lib-jitsi-meet';
  19. import {
  20. getLocalParticipant,
  21. hasRaisedHand,
  22. haveParticipantWithScreenSharingFeature,
  23. raiseHand
  24. } from '../../../base/participants';
  25. import { connect } from '../../../base/redux';
  26. import { getLocalVideoTrack } from '../../../base/tracks';
  27. import { toggleChat } from '../../../chat';
  28. import { ChatButton } from '../../../chat/components';
  29. import { EmbedMeetingButton } from '../../../embed-meeting';
  30. import { SharedDocumentButton } from '../../../etherpad';
  31. import { FeedbackButton } from '../../../feedback';
  32. import { setGifMenuVisibility } from '../../../gifs/actions';
  33. import { isGifEnabled } from '../../../gifs/functions';
  34. import { InviteButton } from '../../../invite/components/add-people-dialog';
  35. import { isVpaasMeeting } from '../../../jaas/functions';
  36. import { KeyboardShortcutsButton } from '../../../keyboard-shortcuts';
  37. import {
  38. close as closeParticipantsPane,
  39. open as openParticipantsPane
  40. } from '../../../participants-pane/actions';
  41. import { ParticipantsPaneButton } from '../../../participants-pane/components/web';
  42. import { getParticipantsPaneOpen } from '../../../participants-pane/functions';
  43. import { addReactionToBuffer } from '../../../reactions/actions.any';
  44. import { toggleReactionsMenuVisibility } from '../../../reactions/actions.web';
  45. import { ReactionsMenuButton } from '../../../reactions/components';
  46. import { REACTIONS } from '../../../reactions/constants';
  47. import { isReactionsEnabled } from '../../../reactions/functions.any';
  48. import {
  49. LiveStreamButton,
  50. RecordButton
  51. } from '../../../recording';
  52. import { isSalesforceEnabled } from '../../../salesforce/functions';
  53. import {
  54. isScreenAudioSupported,
  55. isScreenVideoShared,
  56. ShareAudioButton,
  57. startScreenShareFlow
  58. } from '../../../screen-share/';
  59. import SecurityDialogButton from '../../../security/components/security-dialog/web/SecurityDialogButton';
  60. import { SettingsButton } from '../../../settings';
  61. import { SharedVideoButton } from '../../../shared-video/components';
  62. import { SpeakerStatsButton } from '../../../speaker-stats/components/web';
  63. import {
  64. ClosedCaptionButton
  65. } from '../../../subtitles';
  66. import {
  67. TileViewButton,
  68. shouldDisplayTileView,
  69. toggleTileView
  70. } from '../../../video-layout';
  71. import { VideoQualityDialog, VideoQualityButton } from '../../../video-quality/components';
  72. import { VideoBackgroundButton, toggleBackgroundEffect } from '../../../virtual-background';
  73. import { VIRTUAL_BACKGROUND_TYPE } from '../../../virtual-background/constants';
  74. import {
  75. setFullScreen,
  76. setOverflowMenuVisible,
  77. setToolbarHovered,
  78. showToolbox
  79. } from '../../actions';
  80. import { THRESHOLDS, NOT_APPLICABLE, NOTIFY_CLICK_MODE } from '../../constants';
  81. import { isDesktopShareButtonDisabled, isToolboxVisible } from '../../functions';
  82. import DownloadButton from '../DownloadButton';
  83. import HangupButton from '../HangupButton';
  84. import HelpButton from '../HelpButton';
  85. import AudioSettingsButton from './AudioSettingsButton';
  86. import DockIframeButton from './DockIframeButton';
  87. import FullscreenButton from './FullscreenButton';
  88. import LinkToSalesforceButton from './LinkToSalesforceButton';
  89. import OverflowMenuButton from './OverflowMenuButton';
  90. import ProfileButton from './ProfileButton';
  91. import Separator from './Separator';
  92. import ShareDesktopButton from './ShareDesktopButton';
  93. import ToggleCameraButton from './ToggleCameraButton';
  94. import UndockIframeButton from './UndockIframeButton';
  95. import VideoSettingsButton from './VideoSettingsButton';
  96. /**
  97. * The type of the React {@code Component} props of {@link Toolbox}.
  98. */
  99. type Props = {
  100. /**
  101. * String showing if the virtual background type is desktop-share.
  102. */
  103. _backgroundType: String,
  104. /**
  105. * Toolbar buttons which have their click exposed through the API.
  106. */
  107. _buttonsWithNotifyClick: Array<string | Object>,
  108. /**
  109. * Whether or not the chat feature is currently displayed.
  110. */
  111. _chatOpen: boolean,
  112. /**
  113. * The width of the client.
  114. */
  115. _clientWidth: number,
  116. /**
  117. * The {@code JitsiConference} for the current conference.
  118. */
  119. _conference: Object,
  120. /**
  121. * Whether or not screensharing button is disabled.
  122. */
  123. _desktopSharingButtonDisabled: boolean,
  124. /**
  125. * The tooltip key to use when screensharing is disabled. Or undefined
  126. * if non to be shown and the button to be hidden.
  127. */
  128. _desktopSharingDisabledTooltipKey: boolean,
  129. /**
  130. * Whether or not screensharing is initialized.
  131. */
  132. _desktopSharingEnabled: boolean,
  133. /**
  134. * Whether or not a dialog is displayed.
  135. */
  136. _dialog: boolean,
  137. /**
  138. * Whether or not the toolbox is disabled. It is for recorders.
  139. */
  140. _disabled: boolean,
  141. /**
  142. * Whether or not call feedback can be sent.
  143. */
  144. _feedbackConfigured: boolean,
  145. /**
  146. * Whether or not the app is currently in full screen.
  147. */
  148. _fullScreen: boolean,
  149. /**
  150. * Whether or not the GIFs feature is enabled.
  151. */
  152. _gifsEnabled: boolean,
  153. /**
  154. * Whether the app has Salesforce integration.
  155. */
  156. _hasSalesforce: boolean,
  157. /**
  158. * Whether or not the app is running in an ios mobile browser.
  159. */
  160. _isIosMobile: boolean,
  161. /**
  162. * Whether or not the app is running in mobile browser.
  163. */
  164. _isMobile: boolean,
  165. /**
  166. * Whether or not the profile is disabled.
  167. */
  168. _isProfileDisabled: boolean,
  169. /**
  170. * Whether or not the current meeting belongs to a JaaS user.
  171. */
  172. _isVpaasMeeting: boolean,
  173. /**
  174. * The ID of the local participant.
  175. */
  176. _localParticipantID: String,
  177. /**
  178. * The JitsiLocalTrack to display.
  179. */
  180. _localVideo: Object,
  181. /**
  182. * Whether or not multi-stream send support is enabled.
  183. */
  184. _multiStreamModeEnabled: boolean,
  185. /**
  186. * Whether or not the overflow menu is displayed in a drawer drawer.
  187. */
  188. _overflowDrawer: boolean,
  189. /**
  190. * Whether or not the overflow menu is visible.
  191. */
  192. _overflowMenuVisible: boolean,
  193. /**
  194. * Whether or not the participants pane is open.
  195. */
  196. _participantsPaneOpen: boolean,
  197. /**
  198. * Whether or not the local participant's hand is raised.
  199. */
  200. _raisedHand: boolean,
  201. /**
  202. * Whether or not reactions feature is enabled.
  203. */
  204. _reactionsEnabled: boolean,
  205. /**
  206. * Whether or not the local participant is screenSharing.
  207. */
  208. _screenSharing: boolean,
  209. /**
  210. * Whether or not the local participant is sharing a YouTube video.
  211. */
  212. _sharingVideo: boolean,
  213. /**
  214. * Whether or not the tile view is enabled.
  215. */
  216. _tileViewEnabled: boolean,
  217. /**
  218. * The enabled buttons.
  219. */
  220. _toolbarButtons: Array<string>,
  221. /**
  222. * Flag showing whether toolbar is visible.
  223. */
  224. _visible: boolean,
  225. /**
  226. * Returns the selected virtual source object.
  227. */
  228. _virtualSource: Object,
  229. /**
  230. * An object containing the CSS classes.
  231. */
  232. classes: Object,
  233. /**
  234. * Invoked to active other features of the app.
  235. */
  236. dispatch: Function,
  237. /**
  238. * Invoked to obtain translated strings.
  239. */
  240. t: Function,
  241. /**
  242. * Explicitly passed array with the buttons which this Toolbox should display.
  243. */
  244. toolbarButtons: Array<string>,
  245. };
  246. declare var APP: Object;
  247. const styles = () => {
  248. return {
  249. contextMenu: {
  250. position: 'relative',
  251. right: 'auto',
  252. maxHeight: 'inherit',
  253. margin: 0
  254. }
  255. };
  256. };
  257. /**
  258. * Implements the conference toolbox on React/Web.
  259. *
  260. * @augments Component
  261. */
  262. class Toolbox extends Component<Props> {
  263. /**
  264. * Initializes a new {@code Toolbox} instance.
  265. *
  266. * @param {Props} props - The read-only React {@code Component} props with
  267. * which the new instance is to be initialized.
  268. */
  269. constructor(props: Props) {
  270. super(props);
  271. // Bind event handlers so they are only bound once per instance.
  272. this._onMouseOut = this._onMouseOut.bind(this);
  273. this._onMouseOver = this._onMouseOver.bind(this);
  274. this._onSetOverflowVisible = this._onSetOverflowVisible.bind(this);
  275. this._onTabIn = this._onTabIn.bind(this);
  276. this._onShortcutToggleChat = this._onShortcutToggleChat.bind(this);
  277. this._onShortcutToggleFullScreen = this._onShortcutToggleFullScreen.bind(this);
  278. this._onShortcutToggleParticipantsPane = this._onShortcutToggleParticipantsPane.bind(this);
  279. this._onShortcutToggleRaiseHand = this._onShortcutToggleRaiseHand.bind(this);
  280. this._onShortcutToggleScreenshare = this._onShortcutToggleScreenshare.bind(this);
  281. this._onShortcutToggleVideoQuality = this._onShortcutToggleVideoQuality.bind(this);
  282. this._onToolbarToggleParticipantsPane = this._onToolbarToggleParticipantsPane.bind(this);
  283. this._onToolbarOpenVideoQuality = this._onToolbarOpenVideoQuality.bind(this);
  284. this._onToolbarToggleChat = this._onToolbarToggleChat.bind(this);
  285. this._onToolbarToggleFullScreen = this._onToolbarToggleFullScreen.bind(this);
  286. this._onToolbarToggleRaiseHand = this._onToolbarToggleRaiseHand.bind(this);
  287. this._onToolbarToggleScreenshare = this._onToolbarToggleScreenshare.bind(this);
  288. this._onShortcutToggleTileView = this._onShortcutToggleTileView.bind(this);
  289. this._onEscKey = this._onEscKey.bind(this);
  290. }
  291. /**
  292. * Sets keyboard shortcuts for to trigger ToolbarButtons actions.
  293. *
  294. * @inheritdoc
  295. * @returns {void}
  296. */
  297. componentDidMount() {
  298. const { _toolbarButtons, t, dispatch, _reactionsEnabled, _gifsEnabled } = this.props;
  299. const KEYBOARD_SHORTCUTS = [
  300. isToolbarButtonEnabled('videoquality', _toolbarButtons) && {
  301. character: 'A',
  302. exec: this._onShortcutToggleVideoQuality,
  303. helpDescription: 'toolbar.callQuality'
  304. },
  305. isToolbarButtonEnabled('chat', _toolbarButtons) && {
  306. character: 'C',
  307. exec: this._onShortcutToggleChat,
  308. helpDescription: 'keyboardShortcuts.toggleChat'
  309. },
  310. isToolbarButtonEnabled('desktop', _toolbarButtons) && {
  311. character: 'D',
  312. exec: this._onShortcutToggleScreenshare,
  313. helpDescription: 'keyboardShortcuts.toggleScreensharing'
  314. },
  315. isToolbarButtonEnabled('participants-pane', _toolbarButtons) && {
  316. character: 'P',
  317. exec: this._onShortcutToggleParticipantsPane,
  318. helpDescription: 'keyboardShortcuts.toggleParticipantsPane'
  319. },
  320. isToolbarButtonEnabled('raisehand', _toolbarButtons) && {
  321. character: 'R',
  322. exec: this._onShortcutToggleRaiseHand,
  323. helpDescription: 'keyboardShortcuts.raiseHand'
  324. },
  325. isToolbarButtonEnabled('fullscreen', _toolbarButtons) && {
  326. character: 'S',
  327. exec: this._onShortcutToggleFullScreen,
  328. helpDescription: 'keyboardShortcuts.fullScreen'
  329. },
  330. isToolbarButtonEnabled('tileview', _toolbarButtons) && {
  331. character: 'W',
  332. exec: this._onShortcutToggleTileView,
  333. helpDescription: 'toolbar.tileViewToggle'
  334. }
  335. ];
  336. KEYBOARD_SHORTCUTS.forEach(shortcut => {
  337. if (typeof shortcut === 'object') {
  338. APP.keyboardshortcut.registerShortcut(
  339. shortcut.character,
  340. null,
  341. shortcut.exec,
  342. shortcut.helpDescription);
  343. }
  344. });
  345. if (_reactionsEnabled) {
  346. const REACTION_SHORTCUTS = Object.keys(REACTIONS).map(key => {
  347. const onShortcutSendReaction = () => {
  348. dispatch(addReactionToBuffer(key));
  349. sendAnalytics(createShortcutEvent(
  350. `reaction.${key}`
  351. ));
  352. };
  353. return {
  354. character: REACTIONS[key].shortcutChar,
  355. exec: onShortcutSendReaction,
  356. helpDescription: t(`toolbar.reaction${key.charAt(0).toUpperCase()}${key.slice(1)}`),
  357. altKey: true
  358. };
  359. });
  360. REACTION_SHORTCUTS.forEach(shortcut => {
  361. APP.keyboardshortcut.registerShortcut(
  362. shortcut.character,
  363. null,
  364. shortcut.exec,
  365. shortcut.helpDescription,
  366. shortcut.altKey);
  367. });
  368. if (_gifsEnabled) {
  369. const onGifShortcut = () => {
  370. batch(() => {
  371. dispatch(toggleReactionsMenuVisibility());
  372. dispatch(setGifMenuVisibility(true));
  373. });
  374. };
  375. APP.keyboardshortcut.registerShortcut(
  376. 'G',
  377. null,
  378. onGifShortcut,
  379. t('keyboardShortcuts.giphyMenu')
  380. );
  381. }
  382. }
  383. }
  384. /**
  385. * Update the visibility of the {@code OverflowMenuButton}.
  386. *
  387. * @inheritdoc
  388. */
  389. componentDidUpdate(prevProps) {
  390. const { _dialog, dispatch } = this.props;
  391. if (prevProps._overflowMenuVisible
  392. && !prevProps._dialog
  393. && _dialog) {
  394. this._onSetOverflowVisible(false);
  395. dispatch(setToolbarHovered(false));
  396. }
  397. }
  398. /**
  399. * Removes keyboard shortcuts registered by this component.
  400. *
  401. * @inheritdoc
  402. * @returns {void}
  403. */
  404. componentWillUnmount() {
  405. [ 'A', 'C', 'D', 'R', 'S' ].forEach(letter =>
  406. APP.keyboardshortcut.unregisterShortcut(letter));
  407. if (this.props._reactionsEnabled) {
  408. Object.keys(REACTIONS).map(key => REACTIONS[key].shortcutChar)
  409. .forEach(letter =>
  410. APP.keyboardshortcut.unregisterShortcut(letter, true));
  411. }
  412. }
  413. /**
  414. * Implements React's {@link Component#render()}.
  415. *
  416. * @inheritdoc
  417. * @returns {ReactElement}
  418. */
  419. render() {
  420. if (this.props._disabled) {
  421. return null;
  422. }
  423. const { _chatOpen, _visible, _toolbarButtons } = this.props;
  424. const rootClassNames = `new-toolbox ${_visible ? 'visible' : ''} ${
  425. _toolbarButtons.length ? '' : 'no-buttons'} ${_chatOpen ? 'shift-right' : ''}`;
  426. return (
  427. <div
  428. className = { rootClassNames }
  429. id = 'new-toolbox'>
  430. { this._renderToolboxContent() }
  431. </div>
  432. );
  433. }
  434. _onEscKey: (KeyboardEvent) => void;
  435. /**
  436. * Key handler for overflow menu.
  437. *
  438. * @param {KeyboardEvent} e - Esc key click to close the popup.
  439. * @returns {void}
  440. */
  441. _onEscKey(e) {
  442. if (e.key === 'Escape') {
  443. e.stopPropagation();
  444. this._closeOverflowMenuIfOpen();
  445. }
  446. }
  447. /**
  448. * Closes the overflow menu if opened.
  449. *
  450. * @private
  451. * @returns {void}
  452. */
  453. _closeOverflowMenuIfOpen() {
  454. const { dispatch, _overflowMenuVisible } = this.props;
  455. _overflowMenuVisible && dispatch(setOverflowMenuVisible(false));
  456. }
  457. /**
  458. * Dispatches an action to open the video quality dialog.
  459. *
  460. * @private
  461. * @returns {void}
  462. */
  463. _doOpenVideoQuality() {
  464. this.props.dispatch(openDialog(VideoQualityDialog));
  465. }
  466. /**
  467. * Dispatches an action to toggle the display of chat.
  468. *
  469. * @private
  470. * @returns {void}
  471. */
  472. _doToggleChat() {
  473. this.props.dispatch(toggleChat());
  474. }
  475. /**
  476. * Dispatches an action to toggle screensharing.
  477. *
  478. * @private
  479. * @returns {void}
  480. */
  481. _doToggleFullScreen() {
  482. const fullScreen = !this.props._fullScreen;
  483. this.props.dispatch(setFullScreen(fullScreen));
  484. }
  485. /**
  486. * Dispatches an action to toggle the local participant's raised hand state.
  487. *
  488. * @private
  489. * @returns {void}
  490. */
  491. _doToggleRaiseHand() {
  492. const { _raisedHand } = this.props;
  493. this.props.dispatch(raiseHand(!_raisedHand));
  494. }
  495. /**
  496. * Dispatches an action to toggle screensharing.
  497. *
  498. * @private
  499. * @param {boolean} enabled - The state to toggle screen sharing to.
  500. * @param {boolean} audioOnly - Only share system audio.
  501. * @returns {void}
  502. */
  503. _doToggleScreenshare() {
  504. const {
  505. _backgroundType,
  506. _desktopSharingButtonDisabled,
  507. _desktopSharingEnabled,
  508. _localVideo,
  509. _screenSharing,
  510. _virtualSource,
  511. dispatch
  512. } = this.props;
  513. if (_backgroundType === VIRTUAL_BACKGROUND_TYPE.DESKTOP_SHARE) {
  514. const noneOptions = {
  515. enabled: false,
  516. backgroundType: VIRTUAL_BACKGROUND_TYPE.NONE,
  517. selectedThumbnail: VIRTUAL_BACKGROUND_TYPE.NONE,
  518. backgroundEffectEnabled: false
  519. };
  520. _virtualSource.dispose();
  521. dispatch(toggleBackgroundEffect(noneOptions, _localVideo));
  522. return;
  523. }
  524. if (_desktopSharingEnabled && !_desktopSharingButtonDisabled) {
  525. dispatch(startScreenShareFlow(!_screenSharing));
  526. }
  527. }
  528. /**
  529. * Dispatches an action to toggle the video quality dialog.
  530. *
  531. * @private
  532. * @returns {void}
  533. */
  534. _doToggleVideoQuality() {
  535. this.props.dispatch(toggleDialog(VideoQualityDialog));
  536. }
  537. /**
  538. * Dispaches an action to toggle tile view.
  539. *
  540. * @private
  541. * @returns {void}
  542. */
  543. _doToggleTileView() {
  544. this.props.dispatch(toggleTileView());
  545. }
  546. /**
  547. * Returns all buttons that could be rendered.
  548. *
  549. * @param {Object} state - The redux state.
  550. * @returns {Object} The button maps mainMenuButtons and overflowMenuButtons.
  551. */
  552. _getAllButtons() {
  553. const {
  554. _feedbackConfigured,
  555. _isIosMobile,
  556. _isMobile,
  557. _hasSalesforce,
  558. _multiStreamModeEnabled,
  559. _screenSharing
  560. } = this.props;
  561. const microphone = {
  562. key: 'microphone',
  563. Content: AudioSettingsButton,
  564. group: 0
  565. };
  566. const camera = {
  567. key: 'camera',
  568. Content: VideoSettingsButton,
  569. group: 0
  570. };
  571. const profile = this._isProfileVisible() && {
  572. key: 'profile',
  573. Content: ProfileButton,
  574. group: 1
  575. };
  576. const chat = {
  577. key: 'chat',
  578. Content: ChatButton,
  579. handleClick: this._onToolbarToggleChat,
  580. group: 2
  581. };
  582. const desktop = this._showDesktopSharingButton() && {
  583. key: 'desktop',
  584. Content: ShareDesktopButton,
  585. handleClick: this._onToolbarToggleScreenshare,
  586. group: 2
  587. };
  588. const raisehand = {
  589. key: 'raisehand',
  590. Content: ReactionsMenuButton,
  591. handleClick: this._onToolbarToggleRaiseHand,
  592. group: 2
  593. };
  594. const participants = {
  595. key: 'participants-pane',
  596. Content: ParticipantsPaneButton,
  597. handleClick: this._onToolbarToggleParticipantsPane,
  598. group: 2
  599. };
  600. const invite = {
  601. key: 'invite',
  602. Content: InviteButton,
  603. group: 2
  604. };
  605. const tileview = {
  606. key: 'tileview',
  607. Content: TileViewButton,
  608. group: 2
  609. };
  610. const toggleCamera = {
  611. key: 'toggle-camera',
  612. Content: ToggleCameraButton,
  613. group: 2
  614. };
  615. const videoQuality = {
  616. key: 'videoquality',
  617. Content: VideoQualityButton,
  618. handleClick: this._onToolbarOpenVideoQuality,
  619. group: 2
  620. };
  621. const fullscreen = !_isIosMobile && {
  622. key: 'fullscreen',
  623. Content: FullscreenButton,
  624. handleClick: this._onToolbarToggleFullScreen,
  625. group: 2
  626. };
  627. const security = {
  628. key: 'security',
  629. alias: 'info',
  630. Content: SecurityDialogButton,
  631. group: 2
  632. };
  633. const cc = {
  634. key: 'closedcaptions',
  635. Content: ClosedCaptionButton,
  636. group: 2
  637. };
  638. const recording = {
  639. key: 'recording',
  640. Content: RecordButton,
  641. group: 2
  642. };
  643. const livestreaming = {
  644. key: 'livestreaming',
  645. Content: LiveStreamButton,
  646. group: 2
  647. };
  648. const linkToSalesforce = _hasSalesforce && {
  649. key: 'linktosalesforce',
  650. Content: LinkToSalesforceButton,
  651. group: 2
  652. };
  653. const shareVideo = {
  654. key: 'sharedvideo',
  655. Content: SharedVideoButton,
  656. group: 3
  657. };
  658. const shareAudio = this._showAudioSharingButton() && {
  659. key: 'shareaudio',
  660. Content: ShareAudioButton,
  661. group: 3
  662. };
  663. const etherpad = {
  664. key: 'etherpad',
  665. Content: SharedDocumentButton,
  666. group: 3
  667. };
  668. const virtualBackground = (_multiStreamModeEnabled || !_screenSharing) && {
  669. key: 'select-background',
  670. Content: VideoBackgroundButton,
  671. group: 3
  672. };
  673. const dockIframe = {
  674. key: 'dock-iframe',
  675. Content: DockIframeButton,
  676. group: 3
  677. };
  678. const undockIframe = {
  679. key: 'undock-iframe',
  680. Content: UndockIframeButton,
  681. group: 3
  682. };
  683. const speakerStats = {
  684. key: 'stats',
  685. Content: SpeakerStatsButton,
  686. group: 3
  687. };
  688. const settings = {
  689. key: 'settings',
  690. Content: SettingsButton,
  691. group: 4
  692. };
  693. const shortcuts = !_isMobile && keyboardShortcut.getEnabled() && {
  694. key: 'shortcuts',
  695. Content: KeyboardShortcutsButton,
  696. group: 4
  697. };
  698. const embed = this._isEmbedMeetingVisible() && {
  699. key: 'embedmeeting',
  700. Content: EmbedMeetingButton,
  701. group: 4
  702. };
  703. const feedback = _feedbackConfigured && {
  704. key: 'feedback',
  705. Content: FeedbackButton,
  706. group: 4
  707. };
  708. const download = {
  709. key: 'download',
  710. Content: DownloadButton,
  711. group: 4
  712. };
  713. const help = {
  714. key: 'help',
  715. Content: HelpButton,
  716. group: 4
  717. };
  718. return {
  719. microphone,
  720. camera,
  721. profile,
  722. desktop,
  723. chat,
  724. raisehand,
  725. participants,
  726. invite,
  727. tileview,
  728. toggleCamera,
  729. videoQuality,
  730. fullscreen,
  731. security,
  732. cc,
  733. recording,
  734. livestreaming,
  735. linkToSalesforce,
  736. shareVideo,
  737. shareAudio,
  738. etherpad,
  739. virtualBackground,
  740. dockIframe,
  741. undockIframe,
  742. speakerStats,
  743. settings,
  744. shortcuts,
  745. embed,
  746. feedback,
  747. download,
  748. help
  749. };
  750. }
  751. /**
  752. * Returns the notify mode of the given toolbox button.
  753. *
  754. * @param {string} btnName - The toolbar button's name.
  755. * @returns {string|undefined} - The button's notify mode.
  756. */
  757. _getButtonNotifyMode(btnName) {
  758. const notify = this.props._buttonsWithNotifyClick?.find(
  759. (btn: string | Object) =>
  760. (typeof btn === 'string' && btn === btnName)
  761. || (typeof btn === 'object' && btn.key === btnName)
  762. );
  763. if (notify) {
  764. return typeof notify === 'string' || notify.preventExecution
  765. ? NOTIFY_CLICK_MODE.PREVENT_AND_NOTIFY
  766. : NOTIFY_CLICK_MODE.ONLY_NOTIFY;
  767. }
  768. }
  769. /**
  770. * Sets the notify click mode for the buttons.
  771. *
  772. * @param {Object} buttons - The list of toolbar buttons.
  773. * @returns {void}
  774. */
  775. _setButtonsNotifyClickMode(buttons) {
  776. if (typeof APP === 'undefined' || !this.props._buttonsWithNotifyClick?.length) {
  777. return;
  778. }
  779. Object.values(buttons).forEach((button: any) => {
  780. if (typeof button === 'object') {
  781. button.notifyMode = this._getButtonNotifyMode(button.key);
  782. }
  783. });
  784. }
  785. /**
  786. * Returns all buttons that need to be rendered.
  787. *
  788. * @param {Object} state - The redux state.
  789. * @returns {Object} The visible buttons arrays .
  790. */
  791. _getVisibleButtons() {
  792. const {
  793. _clientWidth,
  794. _toolbarButtons
  795. } = this.props;
  796. const buttons = this._getAllButtons();
  797. this._setButtonsNotifyClickMode(buttons);
  798. const isHangupVisible = isToolbarButtonEnabled('hangup', _toolbarButtons);
  799. const { order } = THRESHOLDS.find(({ width }) => _clientWidth > width)
  800. || THRESHOLDS[THRESHOLDS.length - 1];
  801. let sliceIndex = order.length + 2;
  802. const keys = Object.keys(buttons);
  803. const filtered = [
  804. ...order.map(key => buttons[key]),
  805. ...Object.values(buttons).filter((button, index) => !order.includes(keys[index]))
  806. ].filter(Boolean).filter(({ key, alias = NOT_APPLICABLE }) =>
  807. isToolbarButtonEnabled(key, _toolbarButtons) || isToolbarButtonEnabled(alias, _toolbarButtons));
  808. if (isHangupVisible) {
  809. sliceIndex -= 1;
  810. }
  811. // This implies that the overflow button will be displayed, so save some space for it.
  812. if (sliceIndex < filtered.length) {
  813. sliceIndex -= 1;
  814. }
  815. return {
  816. mainMenuButtons: filtered.slice(0, sliceIndex),
  817. overflowMenuButtons: filtered.slice(sliceIndex)
  818. };
  819. }
  820. _onMouseOut: () => void;
  821. /**
  822. * Dispatches an action signaling the toolbar is not being hovered.
  823. *
  824. * @private
  825. * @returns {void}
  826. */
  827. _onMouseOut() {
  828. const { _overflowMenuVisible, dispatch } = this.props;
  829. !_overflowMenuVisible && dispatch(setToolbarHovered(false));
  830. }
  831. _onMouseOver: () => void;
  832. /**
  833. * Dispatches an action signaling the toolbar is being hovered.
  834. *
  835. * @private
  836. * @returns {void}
  837. */
  838. _onMouseOver() {
  839. this.props.dispatch(setToolbarHovered(true));
  840. }
  841. _onSetOverflowVisible: (boolean) => void;
  842. /**
  843. * Sets the visibility of the overflow menu.
  844. *
  845. * @param {boolean} visible - Whether or not the overflow menu should be
  846. * displayed.
  847. * @private
  848. * @returns {void}
  849. */
  850. _onSetOverflowVisible(visible) {
  851. this.props.dispatch(setOverflowMenuVisible(visible));
  852. this.props.dispatch(setToolbarHovered(visible));
  853. }
  854. _onShortcutToggleChat: () => void;
  855. /**
  856. * Creates an analytics keyboard shortcut event and dispatches an action for
  857. * toggling the display of chat.
  858. *
  859. * @private
  860. * @returns {void}
  861. */
  862. _onShortcutToggleChat() {
  863. sendAnalytics(createShortcutEvent(
  864. 'toggle.chat',
  865. {
  866. enable: !this.props._chatOpen
  867. }));
  868. // Checks if there was any text selected by the user.
  869. // Used for when we press simultaneously keys for copying
  870. // text messages from the chat board
  871. if (window.getSelection().toString() !== '') {
  872. return false;
  873. }
  874. this._doToggleChat();
  875. }
  876. _onShortcutToggleParticipantsPane: () => void;
  877. /**
  878. * Creates an analytics keyboard shortcut event and dispatches an action for
  879. * toggling the display of the participants pane.
  880. *
  881. * @private
  882. * @returns {void}
  883. */
  884. _onShortcutToggleParticipantsPane() {
  885. sendAnalytics(createShortcutEvent(
  886. 'toggle.participants-pane',
  887. {
  888. enable: !this.props._participantsPaneOpen
  889. }));
  890. this._onToolbarToggleParticipantsPane();
  891. }
  892. _onShortcutToggleVideoQuality: () => void;
  893. /**
  894. * Creates an analytics keyboard shortcut event and dispatches an action for
  895. * toggling the display of Video Quality.
  896. *
  897. * @private
  898. * @returns {void}
  899. */
  900. _onShortcutToggleVideoQuality() {
  901. sendAnalytics(createShortcutEvent('video.quality'));
  902. this._doToggleVideoQuality();
  903. }
  904. _onShortcutToggleTileView: () => void;
  905. /**
  906. * Dispatches an action for toggling the tile view.
  907. *
  908. * @private
  909. * @returns {void}
  910. */
  911. _onShortcutToggleTileView() {
  912. sendAnalytics(createShortcutEvent(
  913. 'toggle.tileview',
  914. {
  915. enable: !this.props._tileViewEnabled
  916. }));
  917. this._doToggleTileView();
  918. }
  919. _onShortcutToggleFullScreen: () => void;
  920. /**
  921. * Creates an analytics keyboard shortcut event and dispatches an action for
  922. * toggling full screen mode.
  923. *
  924. * @private
  925. * @returns {void}
  926. */
  927. _onShortcutToggleFullScreen() {
  928. sendAnalytics(createShortcutEvent(
  929. 'toggle.fullscreen',
  930. {
  931. enable: !this.props._fullScreen
  932. }));
  933. this._doToggleFullScreen();
  934. }
  935. _onShortcutToggleRaiseHand: () => void;
  936. /**
  937. * Creates an analytics keyboard shortcut event and dispatches an action for
  938. * toggling raise hand.
  939. *
  940. * @private
  941. * @returns {void}
  942. */
  943. _onShortcutToggleRaiseHand() {
  944. sendAnalytics(createShortcutEvent(
  945. 'toggle.raise.hand',
  946. ACTION_SHORTCUT_TRIGGERED,
  947. { enable: !this.props._raisedHand }));
  948. this._doToggleRaiseHand();
  949. }
  950. _onShortcutToggleScreenshare: () => void;
  951. /**
  952. * Creates an analytics keyboard shortcut event and dispatches an action for
  953. * toggling screensharing.
  954. *
  955. * @private
  956. * @returns {void}
  957. */
  958. _onShortcutToggleScreenshare() {
  959. // Ignore the shortcut if the button is disabled.
  960. if (this.props._desktopSharingButtonDisabled) {
  961. return;
  962. }
  963. sendAnalytics(createShortcutEvent(
  964. 'toggle.screen.sharing',
  965. ACTION_SHORTCUT_TRIGGERED,
  966. {
  967. enable: !this.props._screenSharing
  968. }));
  969. this._doToggleScreenshare();
  970. }
  971. _onTabIn: () => void;
  972. /**
  973. * Toggle the toolbar visibility when tabbing into it.
  974. *
  975. * @returns {void}
  976. */
  977. _onTabIn() {
  978. if (!this.props._visible) {
  979. this.props.dispatch(showToolbox());
  980. }
  981. }
  982. _onToolbarToggleParticipantsPane: () => void;
  983. /**
  984. * Dispatches an action for toggling the participants pane.
  985. *
  986. * @private
  987. * @returns {void}
  988. */
  989. _onToolbarToggleParticipantsPane() {
  990. const { dispatch, _participantsPaneOpen } = this.props;
  991. if (_participantsPaneOpen) {
  992. dispatch(closeParticipantsPane());
  993. } else {
  994. dispatch(openParticipantsPane());
  995. }
  996. }
  997. _onToolbarOpenVideoQuality: () => void;
  998. /**
  999. * Creates an analytics toolbar event and dispatches an action for toggling
  1000. * open the video quality dialog.
  1001. *
  1002. * @private
  1003. * @returns {void}
  1004. */
  1005. _onToolbarOpenVideoQuality() {
  1006. sendAnalytics(createToolbarEvent('video.quality'));
  1007. this._doOpenVideoQuality();
  1008. }
  1009. _onToolbarToggleChat: () => void;
  1010. /**
  1011. * Creates an analytics toolbar event and dispatches an action for toggling
  1012. * the display of chat.
  1013. *
  1014. * @private
  1015. * @returns {void}
  1016. */
  1017. _onToolbarToggleChat() {
  1018. sendAnalytics(createToolbarEvent(
  1019. 'toggle.chat',
  1020. {
  1021. enable: !this.props._chatOpen
  1022. }));
  1023. this._closeOverflowMenuIfOpen();
  1024. this._doToggleChat();
  1025. }
  1026. _onToolbarToggleFullScreen: () => void;
  1027. /**
  1028. * Creates an analytics toolbar event and dispatches an action for toggling
  1029. * full screen mode.
  1030. *
  1031. * @private
  1032. * @returns {void}
  1033. */
  1034. _onToolbarToggleFullScreen() {
  1035. sendAnalytics(createToolbarEvent(
  1036. 'toggle.fullscreen',
  1037. {
  1038. enable: !this.props._fullScreen
  1039. }));
  1040. this._closeOverflowMenuIfOpen();
  1041. this._doToggleFullScreen();
  1042. }
  1043. _onToolbarToggleRaiseHand: () => void;
  1044. /**
  1045. * Creates an analytics toolbar event and dispatches an action for toggling
  1046. * raise hand.
  1047. *
  1048. * @private
  1049. * @returns {void}
  1050. */
  1051. _onToolbarToggleRaiseHand() {
  1052. sendAnalytics(createToolbarEvent(
  1053. 'raise.hand',
  1054. { enable: !this.props._raisedHand }));
  1055. this._doToggleRaiseHand();
  1056. }
  1057. _onToolbarToggleScreenshare: () => void;
  1058. /**
  1059. * Creates an analytics toolbar event and dispatches an action for toggling
  1060. * screensharing.
  1061. *
  1062. * @private
  1063. * @returns {void}
  1064. */
  1065. _onToolbarToggleScreenshare() {
  1066. sendAnalytics(createToolbarEvent(
  1067. 'toggle.screen.sharing',
  1068. ACTION_SHORTCUT_TRIGGERED,
  1069. { enable: !this.props._screenSharing }));
  1070. this._closeOverflowMenuIfOpen();
  1071. this._doToggleScreenshare();
  1072. }
  1073. /**
  1074. * Returns true if the audio sharing button should be visible and
  1075. * false otherwise.
  1076. *
  1077. * @returns {boolean}
  1078. */
  1079. _showAudioSharingButton() {
  1080. const {
  1081. _desktopSharingEnabled
  1082. } = this.props;
  1083. return _desktopSharingEnabled && isScreenAudioSupported();
  1084. }
  1085. /**
  1086. * Returns true if the desktop sharing button should be visible and
  1087. * false otherwise.
  1088. *
  1089. * @returns {boolean}
  1090. */
  1091. _showDesktopSharingButton() {
  1092. const {
  1093. _desktopSharingEnabled,
  1094. _desktopSharingDisabledTooltipKey
  1095. } = this.props;
  1096. return _desktopSharingEnabled || _desktopSharingDisabledTooltipKey;
  1097. }
  1098. /**
  1099. * Returns true if the embed meeting button is visible and false otherwise.
  1100. *
  1101. * @returns {boolean}
  1102. */
  1103. _isEmbedMeetingVisible() {
  1104. return !this.props._isVpaasMeeting
  1105. && !this.props._isMobile;
  1106. }
  1107. /**
  1108. * Returns true if the profile button is visible and false otherwise.
  1109. *
  1110. * @returns {boolean}
  1111. */
  1112. _isProfileVisible() {
  1113. return !this.props._isProfileDisabled;
  1114. }
  1115. /**
  1116. * Renders the toolbox content.
  1117. *
  1118. * @returns {ReactElement}
  1119. */
  1120. _renderToolboxContent() {
  1121. const {
  1122. _isMobile,
  1123. _overflowDrawer,
  1124. _overflowMenuVisible,
  1125. _reactionsEnabled,
  1126. _toolbarButtons,
  1127. classes,
  1128. t
  1129. } = this.props;
  1130. const toolbarAccLabel = 'toolbar.accessibilityLabel.moreActionsMenu';
  1131. const containerClassName = `toolbox-content${_isMobile ? ' toolbox-content-mobile' : ''}`;
  1132. const { mainMenuButtons, overflowMenuButtons } = this._getVisibleButtons();
  1133. return (
  1134. <div className = { containerClassName }>
  1135. <div
  1136. className = 'toolbox-content-wrapper'
  1137. onFocus = { this._onTabIn }
  1138. { ...(_isMobile ? {} : {
  1139. onMouseOut: this._onMouseOut,
  1140. onMouseOver: this._onMouseOver
  1141. }) }>
  1142. <div className = 'toolbox-content-items'>
  1143. {mainMenuButtons.map(({ Content, key, ...rest }) => Content !== Separator && (
  1144. <Content
  1145. { ...rest }
  1146. buttonKey = { key }
  1147. key = { key } />))}
  1148. {Boolean(overflowMenuButtons.length) && (
  1149. <OverflowMenuButton
  1150. ariaControls = 'overflow-menu'
  1151. isOpen = { _overflowMenuVisible }
  1152. key = 'overflow-menu'
  1153. onVisibilityChange = { this._onSetOverflowVisible }
  1154. showMobileReactions = {
  1155. _reactionsEnabled && overflowMenuButtons.find(({ key }) => key === 'raisehand')
  1156. }>
  1157. <ContextMenu
  1158. accessibilityLabel = { t(toolbarAccLabel) }
  1159. className = { classes.contextMenu }
  1160. hidden = { false }
  1161. inDrawer = { _overflowDrawer }
  1162. onKeyDown = { this._onEscKey }>
  1163. {overflowMenuButtons.reduce((acc, val) => {
  1164. if (acc.length) {
  1165. const prev = acc[acc.length - 1];
  1166. const group = prev[prev.length - 1].group;
  1167. if (group === val.group) {
  1168. prev.push(val);
  1169. } else {
  1170. acc.push([ val ]);
  1171. }
  1172. } else {
  1173. acc.push([ val ]);
  1174. }
  1175. return acc;
  1176. }, []).map(buttonGroup => (
  1177. <ContextMenuItemGroup key = { `group-${buttonGroup[0].group}` }>
  1178. {buttonGroup.map(({ key, Content, ...rest }) => (
  1179. key !== 'raisehand' || !_reactionsEnabled)
  1180. && <Content
  1181. { ...rest }
  1182. buttonKey = { key }
  1183. contextMenu = { true }
  1184. key = { key }
  1185. showLabel = { true } />)}
  1186. </ContextMenuItemGroup>))}
  1187. </ContextMenu>
  1188. </OverflowMenuButton>
  1189. )}
  1190. <HangupButton
  1191. buttonKey = 'hangup'
  1192. customClass = 'hangup-button'
  1193. key = 'hangup-button'
  1194. notifyMode = { this._getButtonNotifyMode('hangup') }
  1195. visible = { isToolbarButtonEnabled('hangup', _toolbarButtons) } />
  1196. </div>
  1197. </div>
  1198. </div>
  1199. );
  1200. }
  1201. }
  1202. /**
  1203. * Maps (parts of) the redux state to {@link Toolbox}'s React {@code Component}
  1204. * props.
  1205. *
  1206. * @param {Object} state - The redux store/state.
  1207. * @param {Object} ownProps - The props explicitly passed.
  1208. * @private
  1209. * @returns {{}}
  1210. */
  1211. function _mapStateToProps(state, ownProps) {
  1212. const { conference } = state['features/base/conference'];
  1213. let desktopSharingEnabled = JitsiMeetJS.isDesktopSharingEnabled();
  1214. const {
  1215. buttonsWithNotifyClick,
  1216. callStatsID,
  1217. disableProfile,
  1218. enableFeaturesBasedOnToken,
  1219. iAmRecorder,
  1220. iAmSipGateway
  1221. } = state['features/base/config'];
  1222. const {
  1223. fullScreen,
  1224. overflowMenuVisible,
  1225. overflowDrawer
  1226. } = state['features/toolbox'];
  1227. const localParticipant = getLocalParticipant(state);
  1228. const localVideo = getLocalVideoTrack(state['features/base/tracks']);
  1229. const { clientWidth } = state['features/base/responsive-ui'];
  1230. let desktopSharingDisabledTooltipKey;
  1231. if (enableFeaturesBasedOnToken) {
  1232. if (desktopSharingEnabled) {
  1233. // we enable desktop sharing if any participant already have this
  1234. // feature enabled and if the user supports it.
  1235. desktopSharingEnabled = haveParticipantWithScreenSharingFeature(state);
  1236. desktopSharingDisabledTooltipKey = 'dialog.shareYourScreenDisabled';
  1237. }
  1238. }
  1239. const toolbarButtons = ownProps.toolbarButtons || getToolbarButtons(state);
  1240. return {
  1241. _backgroundType: state['features/virtual-background'].backgroundType,
  1242. _buttonsWithNotifyClick: buttonsWithNotifyClick,
  1243. _chatOpen: state['features/chat'].isOpen,
  1244. _clientWidth: clientWidth,
  1245. _conference: conference,
  1246. _desktopSharingEnabled: desktopSharingEnabled,
  1247. _desktopSharingButtonDisabled: isDesktopShareButtonDisabled(state),
  1248. _desktopSharingDisabledTooltipKey: desktopSharingDisabledTooltipKey,
  1249. _dialog: Boolean(state['features/base/dialog'].component),
  1250. _disabled: Boolean(iAmRecorder || iAmSipGateway),
  1251. _feedbackConfigured: Boolean(callStatsID),
  1252. _fullScreen: fullScreen,
  1253. _gifsEnabled: isGifEnabled(state),
  1254. _isProfileDisabled: Boolean(disableProfile),
  1255. _isIosMobile: isIosMobileBrowser(),
  1256. _isMobile: isMobileBrowser(),
  1257. _isVpaasMeeting: isVpaasMeeting(state),
  1258. _hasSalesforce: isSalesforceEnabled(state),
  1259. _localParticipantID: localParticipant?.id,
  1260. _localVideo: localVideo,
  1261. _multiStreamModeEnabled: getMultipleVideoSendingSupportFeatureFlag(state),
  1262. _overflowMenuVisible: overflowMenuVisible,
  1263. _overflowDrawer: overflowDrawer,
  1264. _participantsPaneOpen: getParticipantsPaneOpen(state),
  1265. _raisedHand: hasRaisedHand(localParticipant),
  1266. _reactionsEnabled: isReactionsEnabled(state),
  1267. _screenSharing: isScreenVideoShared(state),
  1268. _tileViewEnabled: shouldDisplayTileView(state),
  1269. _toolbarButtons: toolbarButtons,
  1270. _virtualSource: state['features/virtual-background'].virtualSource,
  1271. _visible: isToolboxVisible(state)
  1272. };
  1273. }
  1274. export default translate(connect(_mapStateToProps)(withStyles(styles)(Toolbox)));