Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

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