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

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