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 42KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459
  1. // @flow
  2. import { withStyles } from '@material-ui/core/styles';
  3. import clsx from 'clsx';
  4. import React, { Component, Fragment } from 'react';
  5. import { batch } from 'react-redux';
  6. import keyboardShortcut from '../../../../../modules/keyboardshortcut/keyboardshortcut';
  7. import {
  8. ACTION_SHORTCUT_TRIGGERED,
  9. createShortcutEvent,
  10. createToolbarEvent,
  11. sendAnalytics
  12. } from '../../../analytics';
  13. import { 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 { LocalRecordingButton } from '../../../local-recording';
  38. import {
  39. close as closeParticipantsPane,
  40. open as openParticipantsPane
  41. } from '../../../participants-pane/actions';
  42. import { ParticipantsPaneButton } from '../../../participants-pane/components/web';
  43. import { getParticipantsPaneOpen } from '../../../participants-pane/functions';
  44. import { addReactionToBuffer } from '../../../reactions/actions.any';
  45. import { toggleReactionsMenuVisibility } from '../../../reactions/actions.web';
  46. import { ReactionsMenuButton } from '../../../reactions/components';
  47. import { REACTIONS, REACTIONS_MENU_HEIGHT } from '../../../reactions/constants';
  48. import { isReactionsEnabled } from '../../../reactions/functions.any';
  49. import {
  50. LiveStreamButton,
  51. RecordButton
  52. } from '../../../recording';
  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, DRAWER_MAX_HEIGHT, 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 MuteEveryoneButton from '../MuteEveryoneButton';
  86. import MuteEveryonesVideoButton from '../MuteEveryonesVideoButton';
  87. import AudioSettingsButton from './AudioSettingsButton';
  88. import FullscreenButton from './FullscreenButton';
  89. import LinkToSalesforceButton from './LinkToSalesforceButton';
  90. import OverflowMenuButton from './OverflowMenuButton';
  91. import ProfileButton from './ProfileButton';
  92. import Separator from './Separator';
  93. import ShareDesktopButton from './ShareDesktopButton';
  94. import ToggleCameraButton from './ToggleCameraButton';
  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 the overflow menu is displayed in a drawer drawer.
  183. */
  184. _overflowDrawer: boolean,
  185. /**
  186. * Whether or not the overflow menu is visible.
  187. */
  188. _overflowMenuVisible: boolean,
  189. /**
  190. * Whether or not the participants pane is open.
  191. */
  192. _participantsPaneOpen: boolean,
  193. /**
  194. * Whether or not the local participant's hand is raised.
  195. */
  196. _raisedHand: boolean,
  197. /**
  198. * Whether or not reactions feature is enabled.
  199. */
  200. _reactionsEnabled: boolean,
  201. /**
  202. * Whether or not the local participant is screenSharing.
  203. */
  204. _screenSharing: boolean,
  205. /**
  206. * Whether or not the local participant is sharing a YouTube video.
  207. */
  208. _sharingVideo: boolean,
  209. /**
  210. * Whether or not the tile view is enabled.
  211. */
  212. _tileViewEnabled: boolean,
  213. /**
  214. * The enabled buttons.
  215. */
  216. _toolbarButtons: Array<string>,
  217. /**
  218. * Flag showing whether toolbar is visible.
  219. */
  220. _visible: boolean,
  221. /**
  222. * Returns the selected virtual source object.
  223. */
  224. _virtualSource: Object,
  225. /**
  226. * An object containing the CSS classes.
  227. */
  228. classes: Object,
  229. /**
  230. * Invoked to active other features of the app.
  231. */
  232. dispatch: Function,
  233. /**
  234. * Invoked to obtain translated strings.
  235. */
  236. t: Function,
  237. /**
  238. * Explicitly passed array with the buttons which this Toolbox should display.
  239. */
  240. toolbarButtons: Array<string>,
  241. };
  242. declare var APP: Object;
  243. const styles = theme => {
  244. return {
  245. overflowMenu: {
  246. fontSize: 14,
  247. listStyleType: 'none',
  248. padding: '8px 0',
  249. backgroundColor: theme.palette.ui03
  250. },
  251. overflowMenuDrawer: {
  252. overflowY: 'auto',
  253. height: `calc(${DRAWER_MAX_HEIGHT} - ${REACTIONS_MENU_HEIGHT}px - 16px)`
  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. _virtualSource,
  510. dispatch
  511. } = this.props;
  512. if (_backgroundType === VIRTUAL_BACKGROUND_TYPE.DESKTOP_SHARE) {
  513. const noneOptions = {
  514. enabled: false,
  515. backgroundType: VIRTUAL_BACKGROUND_TYPE.NONE,
  516. selectedThumbnail: VIRTUAL_BACKGROUND_TYPE.NONE,
  517. backgroundEffectEnabled: false
  518. };
  519. _virtualSource.dispose();
  520. dispatch(toggleBackgroundEffect(noneOptions, _localVideo));
  521. return;
  522. }
  523. if (_desktopSharingEnabled && !_desktopSharingButtonDisabled) {
  524. dispatch(startScreenShareFlow());
  525. }
  526. }
  527. /**
  528. * Dispatches an action to toggle the video quality dialog.
  529. *
  530. * @private
  531. * @returns {void}
  532. */
  533. _doToggleVideoQuality() {
  534. this.props.dispatch(toggleDialog(VideoQualityDialog));
  535. }
  536. /**
  537. * Dispaches an action to toggle tile view.
  538. *
  539. * @private
  540. * @returns {void}
  541. */
  542. _doToggleTileView() {
  543. this.props.dispatch(toggleTileView());
  544. }
  545. /**
  546. * Returns all buttons that could be rendered.
  547. *
  548. * @param {Object} state - The redux state.
  549. * @returns {Object} The button maps mainMenuButtons and overflowMenuButtons.
  550. */
  551. _getAllButtons() {
  552. const {
  553. _feedbackConfigured,
  554. _isIosMobile,
  555. _isMobile,
  556. _hasSalesforce,
  557. _screenSharing
  558. } = this.props;
  559. const microphone = {
  560. key: 'microphone',
  561. Content: AudioSettingsButton,
  562. group: 0
  563. };
  564. const camera = {
  565. key: 'camera',
  566. Content: VideoSettingsButton,
  567. group: 0
  568. };
  569. const profile = this._isProfileVisible() && {
  570. key: 'profile',
  571. Content: ProfileButton,
  572. group: 1
  573. };
  574. const chat = {
  575. key: 'chat',
  576. Content: ChatButton,
  577. handleClick: this._onToolbarToggleChat,
  578. group: 2
  579. };
  580. const desktop = this._showDesktopSharingButton() && {
  581. key: 'desktop',
  582. Content: ShareDesktopButton,
  583. handleClick: this._onToolbarToggleScreenshare,
  584. group: 2
  585. };
  586. const raisehand = {
  587. key: 'raisehand',
  588. Content: ReactionsMenuButton,
  589. handleClick: this._onToolbarToggleRaiseHand,
  590. group: 2
  591. };
  592. const participants = {
  593. key: 'participants-pane',
  594. Content: ParticipantsPaneButton,
  595. handleClick: this._onToolbarToggleParticipantsPane,
  596. group: 2
  597. };
  598. const invite = {
  599. key: 'invite',
  600. Content: InviteButton,
  601. group: 2
  602. };
  603. const tileview = {
  604. key: 'tileview',
  605. Content: TileViewButton,
  606. group: 2
  607. };
  608. const toggleCamera = {
  609. key: 'toggle-camera',
  610. Content: ToggleCameraButton,
  611. group: 2
  612. };
  613. const videoQuality = {
  614. key: 'videoquality',
  615. Content: VideoQualityButton,
  616. handleClick: this._onToolbarOpenVideoQuality,
  617. group: 2
  618. };
  619. const fullscreen = !_isIosMobile && {
  620. key: 'fullscreen',
  621. Content: FullscreenButton,
  622. handleClick: this._onToolbarToggleFullScreen,
  623. group: 2
  624. };
  625. const security = {
  626. key: 'security',
  627. alias: 'info',
  628. Content: SecurityDialogButton,
  629. group: 2
  630. };
  631. const cc = {
  632. key: 'closedcaptions',
  633. Content: ClosedCaptionButton,
  634. group: 2
  635. };
  636. const recording = {
  637. key: 'recording',
  638. Content: RecordButton,
  639. group: 2
  640. };
  641. const localRecording = {
  642. key: 'localrecording',
  643. Content: LocalRecordingButton,
  644. group: 2
  645. };
  646. const livestreaming = {
  647. key: 'livestreaming',
  648. Content: LiveStreamButton,
  649. group: 2
  650. };
  651. const linkToSalesforce = _hasSalesforce && {
  652. key: 'linktosalesforce',
  653. Content: LinkToSalesforceButton,
  654. group: 2
  655. };
  656. const muteEveryone = {
  657. key: 'mute-everyone',
  658. Content: MuteEveryoneButton,
  659. group: 2
  660. };
  661. const muteVideoEveryone = {
  662. key: 'mute-video-everyone',
  663. Content: MuteEveryonesVideoButton,
  664. group: 2
  665. };
  666. const shareVideo = {
  667. key: 'sharedvideo',
  668. Content: SharedVideoButton,
  669. group: 3
  670. };
  671. const shareAudio = this._showAudioSharingButton() && {
  672. key: 'shareaudio',
  673. Content: ShareAudioButton,
  674. group: 3
  675. };
  676. const etherpad = {
  677. key: 'etherpad',
  678. Content: SharedDocumentButton,
  679. group: 3
  680. };
  681. const virtualBackground = !_screenSharing && {
  682. key: 'select-background',
  683. Content: VideoBackgroundButton,
  684. group: 3
  685. };
  686. const speakerStats = {
  687. key: 'stats',
  688. Content: SpeakerStatsButton,
  689. group: 3
  690. };
  691. const settings = {
  692. key: 'settings',
  693. Content: SettingsButton,
  694. group: 4
  695. };
  696. const shortcuts = !_isMobile && keyboardShortcut.getEnabled() && {
  697. key: 'shortcuts',
  698. Content: KeyboardShortcutsButton,
  699. group: 4
  700. };
  701. const embed = this._isEmbedMeetingVisible() && {
  702. key: 'embedmeeting',
  703. Content: EmbedMeetingButton,
  704. group: 4
  705. };
  706. const feedback = _feedbackConfigured && {
  707. key: 'feedback',
  708. Content: FeedbackButton,
  709. group: 4
  710. };
  711. const download = {
  712. key: 'download',
  713. Content: DownloadButton,
  714. group: 4
  715. };
  716. const help = {
  717. key: 'help',
  718. Content: HelpButton,
  719. group: 4
  720. };
  721. return {
  722. microphone,
  723. camera,
  724. profile,
  725. desktop,
  726. chat,
  727. raisehand,
  728. participants,
  729. invite,
  730. tileview,
  731. toggleCamera,
  732. videoQuality,
  733. fullscreen,
  734. security,
  735. cc,
  736. recording,
  737. localRecording,
  738. livestreaming,
  739. linkToSalesforce,
  740. muteEveryone,
  741. muteVideoEveryone,
  742. shareVideo,
  743. shareAudio,
  744. etherpad,
  745. virtualBackground,
  746. speakerStats,
  747. settings,
  748. shortcuts,
  749. embed,
  750. feedback,
  751. download,
  752. help
  753. };
  754. }
  755. /**
  756. * Sets the notify click mode for the buttons.
  757. *
  758. * @param {Object} buttons - The list of toolbar buttons.
  759. * @returns {void}
  760. */
  761. _setButtonsNotifyClickMode(buttons) {
  762. if (typeof APP === 'undefined' || !this.props._buttonsWithNotifyClick?.length) {
  763. return;
  764. }
  765. Object.values(buttons).forEach((button: any) => {
  766. if (typeof button === 'object') {
  767. const notify = this.props._buttonsWithNotifyClick.find(
  768. (btn: string | Object) =>
  769. (typeof btn === 'string' && btn === button.key)
  770. || (typeof btn === 'object' && btn.key === button.key)
  771. );
  772. if (notify) {
  773. const notifyMode = typeof notify === 'string' || notify.preventExecution
  774. ? NOTIFY_CLICK_MODE.PREVENT_AND_NOTIFY
  775. : NOTIFY_CLICK_MODE.ONLY_NOTIFY;
  776. button.notifyMode = notifyMode;
  777. }
  778. }
  779. });
  780. }
  781. /**
  782. * Returns all buttons that need to be rendered.
  783. *
  784. * @param {Object} state - The redux state.
  785. * @returns {Object} The visible buttons arrays .
  786. */
  787. _getVisibleButtons() {
  788. const {
  789. _clientWidth,
  790. _toolbarButtons
  791. } = this.props;
  792. const buttons = this._getAllButtons();
  793. this._setButtonsNotifyClickMode(buttons);
  794. const isHangupVisible = isToolbarButtonEnabled('hangup', _toolbarButtons);
  795. const { order } = THRESHOLDS.find(({ width }) => _clientWidth > width)
  796. || THRESHOLDS[THRESHOLDS.length - 1];
  797. let sliceIndex = order.length + 2;
  798. const keys = Object.keys(buttons);
  799. const filtered = [
  800. ...order.map(key => buttons[key]),
  801. ...Object.values(buttons).filter((button, index) => !order.includes(keys[index]))
  802. ].filter(Boolean).filter(({ key, alias = NOT_APPLICABLE }) =>
  803. isToolbarButtonEnabled(key, _toolbarButtons) || isToolbarButtonEnabled(alias, _toolbarButtons));
  804. if (isHangupVisible) {
  805. sliceIndex -= 1;
  806. }
  807. // This implies that the overflow button will be displayed, so save some space for it.
  808. if (sliceIndex < filtered.length) {
  809. sliceIndex -= 1;
  810. }
  811. return {
  812. mainMenuButtons: filtered.slice(0, sliceIndex),
  813. overflowMenuButtons: filtered.slice(sliceIndex)
  814. };
  815. }
  816. _onMouseOut: () => void;
  817. /**
  818. * Dispatches an action signaling the toolbar is not being hovered.
  819. *
  820. * @private
  821. * @returns {void}
  822. */
  823. _onMouseOut() {
  824. const { _overflowMenuVisible, dispatch } = this.props;
  825. !_overflowMenuVisible && dispatch(setToolbarHovered(false));
  826. }
  827. _onMouseOver: () => void;
  828. /**
  829. * Dispatches an action signaling the toolbar is being hovered.
  830. *
  831. * @private
  832. * @returns {void}
  833. */
  834. _onMouseOver() {
  835. this.props.dispatch(setToolbarHovered(true));
  836. }
  837. _onSetOverflowVisible: (boolean) => void;
  838. /**
  839. * Sets the visibility of the overflow menu.
  840. *
  841. * @param {boolean} visible - Whether or not the overflow menu should be
  842. * displayed.
  843. * @private
  844. * @returns {void}
  845. */
  846. _onSetOverflowVisible(visible) {
  847. this.props.dispatch(setOverflowMenuVisible(visible));
  848. this.props.dispatch(setToolbarHovered(visible));
  849. }
  850. _onShortcutToggleChat: () => void;
  851. /**
  852. * Creates an analytics keyboard shortcut event and dispatches an action for
  853. * toggling the display of chat.
  854. *
  855. * @private
  856. * @returns {void}
  857. */
  858. _onShortcutToggleChat() {
  859. sendAnalytics(createShortcutEvent(
  860. 'toggle.chat',
  861. {
  862. enable: !this.props._chatOpen
  863. }));
  864. // Checks if there was any text selected by the user.
  865. // Used for when we press simultaneously keys for copying
  866. // text messages from the chat board
  867. if (window.getSelection().toString() !== '') {
  868. return false;
  869. }
  870. this._doToggleChat();
  871. }
  872. _onShortcutToggleParticipantsPane: () => void;
  873. /**
  874. * Creates an analytics keyboard shortcut event and dispatches an action for
  875. * toggling the display of the participants pane.
  876. *
  877. * @private
  878. * @returns {void}
  879. */
  880. _onShortcutToggleParticipantsPane() {
  881. sendAnalytics(createShortcutEvent(
  882. 'toggle.participants-pane',
  883. {
  884. enable: !this.props._participantsPaneOpen
  885. }));
  886. this._onToolbarToggleParticipantsPane();
  887. }
  888. _onShortcutToggleVideoQuality: () => void;
  889. /**
  890. * Creates an analytics keyboard shortcut event and dispatches an action for
  891. * toggling the display of Video Quality.
  892. *
  893. * @private
  894. * @returns {void}
  895. */
  896. _onShortcutToggleVideoQuality() {
  897. sendAnalytics(createShortcutEvent('video.quality'));
  898. this._doToggleVideoQuality();
  899. }
  900. _onShortcutToggleTileView: () => void;
  901. /**
  902. * Dispatches an action for toggling the tile view.
  903. *
  904. * @private
  905. * @returns {void}
  906. */
  907. _onShortcutToggleTileView() {
  908. sendAnalytics(createShortcutEvent(
  909. 'toggle.tileview',
  910. {
  911. enable: !this.props._tileViewEnabled
  912. }));
  913. this._doToggleTileView();
  914. }
  915. _onShortcutToggleFullScreen: () => void;
  916. /**
  917. * Creates an analytics keyboard shortcut event and dispatches an action for
  918. * toggling full screen mode.
  919. *
  920. * @private
  921. * @returns {void}
  922. */
  923. _onShortcutToggleFullScreen() {
  924. sendAnalytics(createShortcutEvent(
  925. 'toggle.fullscreen',
  926. {
  927. enable: !this.props._fullScreen
  928. }));
  929. this._doToggleFullScreen();
  930. }
  931. _onShortcutToggleRaiseHand: () => void;
  932. /**
  933. * Creates an analytics keyboard shortcut event and dispatches an action for
  934. * toggling raise hand.
  935. *
  936. * @private
  937. * @returns {void}
  938. */
  939. _onShortcutToggleRaiseHand() {
  940. sendAnalytics(createShortcutEvent(
  941. 'toggle.raise.hand',
  942. ACTION_SHORTCUT_TRIGGERED,
  943. { enable: !this.props._raisedHand }));
  944. this._doToggleRaiseHand();
  945. }
  946. _onShortcutToggleScreenshare: () => void;
  947. /**
  948. * Creates an analytics keyboard shortcut event and dispatches an action for
  949. * toggling screensharing.
  950. *
  951. * @private
  952. * @returns {void}
  953. */
  954. _onShortcutToggleScreenshare() {
  955. // Ignore the shortcut if the button is disabled.
  956. if (this.props._desktopSharingButtonDisabled) {
  957. return;
  958. }
  959. sendAnalytics(createShortcutEvent(
  960. 'toggle.screen.sharing',
  961. ACTION_SHORTCUT_TRIGGERED,
  962. {
  963. enable: !this.props._screenSharing
  964. }));
  965. this._doToggleScreenshare();
  966. }
  967. _onTabIn: () => void;
  968. /**
  969. * Toggle the toolbar visibility when tabbing into it.
  970. *
  971. * @returns {void}
  972. */
  973. _onTabIn() {
  974. if (!this.props._visible) {
  975. this.props.dispatch(showToolbox());
  976. }
  977. }
  978. _onToolbarToggleParticipantsPane: () => void;
  979. /**
  980. * Dispatches an action for toggling the participants pane.
  981. *
  982. * @private
  983. * @returns {void}
  984. */
  985. _onToolbarToggleParticipantsPane() {
  986. const { dispatch, _participantsPaneOpen } = this.props;
  987. if (_participantsPaneOpen) {
  988. dispatch(closeParticipantsPane());
  989. } else {
  990. dispatch(openParticipantsPane());
  991. }
  992. }
  993. _onToolbarOpenVideoQuality: () => void;
  994. /**
  995. * Creates an analytics toolbar event and dispatches an action for toggling
  996. * open the video quality dialog.
  997. *
  998. * @private
  999. * @returns {void}
  1000. */
  1001. _onToolbarOpenVideoQuality() {
  1002. sendAnalytics(createToolbarEvent('video.quality'));
  1003. this._doOpenVideoQuality();
  1004. }
  1005. _onToolbarToggleChat: () => void;
  1006. /**
  1007. * Creates an analytics toolbar event and dispatches an action for toggling
  1008. * the display of chat.
  1009. *
  1010. * @private
  1011. * @returns {void}
  1012. */
  1013. _onToolbarToggleChat() {
  1014. sendAnalytics(createToolbarEvent(
  1015. 'toggle.chat',
  1016. {
  1017. enable: !this.props._chatOpen
  1018. }));
  1019. this._closeOverflowMenuIfOpen();
  1020. this._doToggleChat();
  1021. }
  1022. _onToolbarToggleFullScreen: () => void;
  1023. /**
  1024. * Creates an analytics toolbar event and dispatches an action for toggling
  1025. * full screen mode.
  1026. *
  1027. * @private
  1028. * @returns {void}
  1029. */
  1030. _onToolbarToggleFullScreen() {
  1031. sendAnalytics(createToolbarEvent(
  1032. 'toggle.fullscreen',
  1033. {
  1034. enable: !this.props._fullScreen
  1035. }));
  1036. this._closeOverflowMenuIfOpen();
  1037. this._doToggleFullScreen();
  1038. }
  1039. _onToolbarToggleRaiseHand: () => void;
  1040. /**
  1041. * Creates an analytics toolbar event and dispatches an action for toggling
  1042. * raise hand.
  1043. *
  1044. * @private
  1045. * @returns {void}
  1046. */
  1047. _onToolbarToggleRaiseHand() {
  1048. sendAnalytics(createToolbarEvent(
  1049. 'raise.hand',
  1050. { enable: !this.props._raisedHand }));
  1051. this._doToggleRaiseHand();
  1052. }
  1053. _onToolbarToggleScreenshare: () => void;
  1054. /**
  1055. * Creates an analytics toolbar event and dispatches an action for toggling
  1056. * screensharing.
  1057. *
  1058. * @private
  1059. * @returns {void}
  1060. */
  1061. _onToolbarToggleScreenshare() {
  1062. sendAnalytics(createToolbarEvent(
  1063. 'toggle.screen.sharing',
  1064. ACTION_SHORTCUT_TRIGGERED,
  1065. { enable: !this.props._screenSharing }));
  1066. this._closeOverflowMenuIfOpen();
  1067. this._doToggleScreenshare();
  1068. }
  1069. /**
  1070. * Returns true if the audio sharing button should be visible and
  1071. * false otherwise.
  1072. *
  1073. * @returns {boolean}
  1074. */
  1075. _showAudioSharingButton() {
  1076. const {
  1077. _desktopSharingEnabled
  1078. } = this.props;
  1079. return _desktopSharingEnabled && isScreenAudioSupported();
  1080. }
  1081. /**
  1082. * Returns true if the desktop sharing button should be visible and
  1083. * false otherwise.
  1084. *
  1085. * @returns {boolean}
  1086. */
  1087. _showDesktopSharingButton() {
  1088. const {
  1089. _desktopSharingEnabled,
  1090. _desktopSharingDisabledTooltipKey
  1091. } = this.props;
  1092. return _desktopSharingEnabled || _desktopSharingDisabledTooltipKey;
  1093. }
  1094. /**
  1095. * Returns true if the embed meeting button is visible and false otherwise.
  1096. *
  1097. * @returns {boolean}
  1098. */
  1099. _isEmbedMeetingVisible() {
  1100. return !this.props._isVpaasMeeting
  1101. && !this.props._isMobile;
  1102. }
  1103. /**
  1104. * Returns true if the profile button is visible and false otherwise.
  1105. *
  1106. * @returns {boolean}
  1107. */
  1108. _isProfileVisible() {
  1109. return !this.props._isProfileDisabled;
  1110. }
  1111. /**
  1112. * Renders the toolbox content.
  1113. *
  1114. * @returns {ReactElement}
  1115. */
  1116. _renderToolboxContent() {
  1117. const {
  1118. _isMobile,
  1119. _overflowDrawer,
  1120. _overflowMenuVisible,
  1121. _reactionsEnabled,
  1122. _toolbarButtons,
  1123. classes,
  1124. t
  1125. } = this.props;
  1126. const toolbarAccLabel = 'toolbar.accessibilityLabel.moreActionsMenu';
  1127. const containerClassName = `toolbox-content${_isMobile ? ' toolbox-content-mobile' : ''}`;
  1128. const { mainMenuButtons, overflowMenuButtons } = this._getVisibleButtons();
  1129. return (
  1130. <div className = { containerClassName }>
  1131. <div
  1132. className = 'toolbox-content-wrapper'
  1133. onFocus = { this._onTabIn }
  1134. { ...(_isMobile ? {} : {
  1135. onMouseOut: this._onMouseOut,
  1136. onMouseOver: this._onMouseOver
  1137. }) }>
  1138. <div className = 'toolbox-content-items'>
  1139. {mainMenuButtons.map(({ Content, key, ...rest }) => Content !== Separator && (
  1140. <Content
  1141. { ...rest }
  1142. buttonKey = { key }
  1143. key = { key } />))}
  1144. {Boolean(overflowMenuButtons.length) && (
  1145. <OverflowMenuButton
  1146. ariaControls = 'overflow-menu'
  1147. isOpen = { _overflowMenuVisible }
  1148. key = 'overflow-menu'
  1149. onVisibilityChange = { this._onSetOverflowVisible }
  1150. showMobileReactions = {
  1151. _reactionsEnabled && overflowMenuButtons.find(({ key }) => key === 'raisehand')
  1152. }>
  1153. <ul
  1154. aria-label = { t(toolbarAccLabel) }
  1155. className = { clsx(classes.overflowMenu,
  1156. _overflowDrawer && classes.overflowMenuDrawer)
  1157. }
  1158. id = 'overflow-menu'
  1159. onKeyDown = { this._onEscKey }
  1160. role = 'menu'>
  1161. {overflowMenuButtons.map(({ group, key, Content, ...rest }, index, arr) => {
  1162. const showSeparator = index > 0 && arr[index - 1].group !== group;
  1163. return (key !== 'raisehand' || !_reactionsEnabled)
  1164. && <Fragment key = { `f${key}` }>
  1165. {showSeparator && <Separator key = { `hr${group}` } />}
  1166. <Content
  1167. { ...rest }
  1168. buttonKey = { key }
  1169. key = { key }
  1170. showLabel = { true } />
  1171. </Fragment>
  1172. ;
  1173. })}
  1174. </ul>
  1175. </OverflowMenuButton>
  1176. )}
  1177. <HangupButton
  1178. customClass = 'hangup-button'
  1179. key = 'hangup-button'
  1180. visible = { isToolbarButtonEnabled('hangup', _toolbarButtons) } />
  1181. </div>
  1182. </div>
  1183. </div>
  1184. );
  1185. }
  1186. }
  1187. /**
  1188. * Maps (parts of) the redux state to {@link Toolbox}'s React {@code Component}
  1189. * props.
  1190. *
  1191. * @param {Object} state - The redux store/state.
  1192. * @param {Object} ownProps - The props explicitly passed.
  1193. * @private
  1194. * @returns {{}}
  1195. */
  1196. function _mapStateToProps(state, ownProps) {
  1197. const { conference } = state['features/base/conference'];
  1198. let desktopSharingEnabled = JitsiMeetJS.isDesktopSharingEnabled();
  1199. const {
  1200. buttonsWithNotifyClick,
  1201. callStatsID,
  1202. disableProfile,
  1203. enableFeaturesBasedOnToken,
  1204. iAmRecorder,
  1205. iAmSipGateway,
  1206. salesforceUrl
  1207. } = state['features/base/config'];
  1208. const {
  1209. fullScreen,
  1210. overflowMenuVisible,
  1211. overflowDrawer
  1212. } = state['features/toolbox'];
  1213. const localParticipant = getLocalParticipant(state);
  1214. const localVideo = getLocalVideoTrack(state['features/base/tracks']);
  1215. const { clientWidth } = state['features/base/responsive-ui'];
  1216. let desktopSharingDisabledTooltipKey;
  1217. if (enableFeaturesBasedOnToken) {
  1218. if (desktopSharingEnabled) {
  1219. // we enable desktop sharing if any participant already have this
  1220. // feature enabled and if the user supports it.
  1221. desktopSharingEnabled = haveParticipantWithScreenSharingFeature(state);
  1222. desktopSharingDisabledTooltipKey = 'dialog.shareYourScreenDisabled';
  1223. }
  1224. }
  1225. let { toolbarButtons } = ownProps;
  1226. const stateToolbarButtons = getToolbarButtons(state);
  1227. if (toolbarButtons) {
  1228. toolbarButtons = toolbarButtons.filter(name => isToolbarButtonEnabled(name, stateToolbarButtons));
  1229. } else {
  1230. toolbarButtons = stateToolbarButtons;
  1231. }
  1232. return {
  1233. _backgroundType: state['features/virtual-background'].backgroundType,
  1234. _buttonsWithNotifyClick: buttonsWithNotifyClick,
  1235. _chatOpen: state['features/chat'].isOpen,
  1236. _clientWidth: clientWidth,
  1237. _conference: conference,
  1238. _desktopSharingEnabled: desktopSharingEnabled,
  1239. _desktopSharingButtonDisabled: isDesktopShareButtonDisabled(state),
  1240. _desktopSharingDisabledTooltipKey: desktopSharingDisabledTooltipKey,
  1241. _dialog: Boolean(state['features/base/dialog'].component),
  1242. _disabled: Boolean(iAmRecorder || iAmSipGateway),
  1243. _feedbackConfigured: Boolean(callStatsID),
  1244. _fullScreen: fullScreen,
  1245. _gifsEnabled: isGifEnabled(state),
  1246. _isProfileDisabled: Boolean(disableProfile),
  1247. _isIosMobile: isIosMobileBrowser(),
  1248. _isMobile: isMobileBrowser(),
  1249. _isVpaasMeeting: isVpaasMeeting(state),
  1250. _hasSalesforce: Boolean(salesforceUrl),
  1251. _localParticipantID: localParticipant?.id,
  1252. _localVideo: localVideo,
  1253. _overflowMenuVisible: overflowMenuVisible,
  1254. _overflowDrawer: overflowDrawer,
  1255. _participantsPaneOpen: getParticipantsPaneOpen(state),
  1256. _raisedHand: hasRaisedHand(localParticipant),
  1257. _reactionsEnabled: isReactionsEnabled(state),
  1258. _screenSharing: isScreenVideoShared(state),
  1259. _tileViewEnabled: shouldDisplayTileView(state),
  1260. _toolbarButtons: toolbarButtons,
  1261. _virtualSource: state['features/virtual-background'].virtualSource,
  1262. _visible: isToolboxVisible(state)
  1263. };
  1264. }
  1265. export default translate(connect(_mapStateToProps)(withStyles(styles)(Toolbox)));