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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395
  1. // @flow
  2. import React, { Component } from 'react';
  3. import {
  4. ACTION_SHORTCUT_TRIGGERED,
  5. createShortcutEvent,
  6. createToolbarEvent,
  7. sendAnalytics
  8. } from '../../../analytics';
  9. import { getToolbarButtons } from '../../../base/config';
  10. import { isToolbarButtonEnabled } from '../../../base/config/functions.web';
  11. import { openDialog, toggleDialog } from '../../../base/dialog';
  12. import { isMobileBrowser } from '../../../base/environment/utils';
  13. import { translate } from '../../../base/i18n';
  14. import {
  15. IconChat,
  16. IconCodeBlock,
  17. IconDeviceDocument,
  18. IconExitFullScreen,
  19. IconFeedback,
  20. IconFullScreen,
  21. IconParticipants,
  22. IconPresentation,
  23. IconRaisedHand,
  24. IconRec,
  25. IconShareAudio,
  26. IconShareDesktop
  27. } from '../../../base/icons';
  28. import JitsiMeetJS from '../../../base/lib-jitsi-meet';
  29. import {
  30. getLocalParticipant,
  31. getParticipants,
  32. participantUpdated
  33. } from '../../../base/participants';
  34. import { connect } from '../../../base/redux';
  35. import { OverflowMenuItem } from '../../../base/toolbox/components';
  36. import { getLocalVideoTrack, toggleScreensharing } from '../../../base/tracks';
  37. import { isVpaasMeeting } from '../../../billing-counter/functions';
  38. import { ChatCounter, toggleChat } from '../../../chat';
  39. import { EmbedMeetingDialog } from '../../../embed-meeting';
  40. import { SharedDocumentButton } from '../../../etherpad';
  41. import { openFeedbackDialog } from '../../../feedback';
  42. import { openKeyboardShortcutsDialog } from '../../../keyboard-shortcuts';
  43. import { LocalRecordingInfoDialog } from '../../../local-recording';
  44. import {
  45. close as closeParticipantsPane,
  46. open as openParticipantsPane
  47. } from '../../../participants-pane/actions';
  48. import { getParticipantsPaneOpen } from '../../../participants-pane/functions';
  49. import {
  50. LiveStreamButton,
  51. RecordButton
  52. } from '../../../recording';
  53. import { isScreenAudioShared, isScreenAudioSupported } from '../../../screen-share/';
  54. import SecurityDialogButton from '../../../security/components/security-dialog/SecurityDialogButton';
  55. import {
  56. SETTINGS_TABS,
  57. SettingsButton,
  58. openSettingsDialog
  59. } from '../../../settings';
  60. import { SharedVideoButton } from '../../../shared-video/components';
  61. import { SpeakerStats } from '../../../speaker-stats';
  62. import {
  63. ClosedCaptionButton
  64. } from '../../../subtitles';
  65. import {
  66. TileViewButton,
  67. shouldDisplayTileView,
  68. toggleTileView
  69. } from '../../../video-layout';
  70. import {
  71. OverflowMenuVideoQualityItem,
  72. VideoQualityDialog
  73. } from '../../../video-quality';
  74. import { VideoBackgroundButton } from '../../../virtual-background';
  75. import { checkBlurSupport } from '../../../virtual-background/functions';
  76. import {
  77. setFullScreen,
  78. setOverflowMenuVisible,
  79. setToolbarHovered,
  80. showToolbox
  81. } from '../../actions';
  82. import { getToolbarAdditionalButtons, 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 OverflowMenuButton from './OverflowMenuButton';
  90. import OverflowMenuProfileItem from './OverflowMenuProfileItem';
  91. import ToggleCameraButton from './ToggleCameraButton';
  92. import ToolbarButton from './ToolbarButton';
  93. import VideoSettingsButton from './VideoSettingsButton';
  94. /**
  95. * The type of the React {@code Component} props of {@link Toolbox}.
  96. */
  97. type Props = {
  98. /**
  99. * Whether or not the chat feature is currently displayed.
  100. */
  101. _chatOpen: boolean,
  102. /**
  103. * The width of the client.
  104. */
  105. _clientWidth: number,
  106. /**
  107. * The {@code JitsiConference} for the current conference.
  108. */
  109. _conference: Object,
  110. /**
  111. * The tooltip key to use when screensharing is disabled. Or undefined
  112. * if non to be shown and the button to be hidden.
  113. */
  114. _desktopSharingDisabledTooltipKey: boolean,
  115. /**
  116. * Whether or not screensharing is initialized.
  117. */
  118. _desktopSharingEnabled: boolean,
  119. /**
  120. * Whether or not a dialog is displayed.
  121. */
  122. _dialog: boolean,
  123. /**
  124. * Whether or not call feedback can be sent.
  125. */
  126. _feedbackConfigured: boolean,
  127. /**
  128. * Whether or not the app is currently in full screen.
  129. */
  130. _fullScreen: boolean,
  131. /**
  132. * Whether or not the app is running in mobile browser.
  133. */
  134. _isMobile: boolean,
  135. /**
  136. * Whether or not the profile is disabled.
  137. */
  138. _isProfileDisabled: boolean,
  139. /**
  140. * Whether or not the tile view is enabled.
  141. */
  142. _tileViewEnabled: boolean,
  143. /**
  144. * Whether or not the current meeting belongs to a JaaS user.
  145. */
  146. _isVpaasMeeting: boolean,
  147. /**
  148. * The ID of the local participant.
  149. */
  150. _localParticipantID: String,
  151. /**
  152. * The subsection of Redux state for local recording
  153. */
  154. _localRecState: Object,
  155. /**
  156. * The value for how the conference is locked (or undefined if not locked)
  157. * as defined by room-lock constants.
  158. */
  159. _locked: boolean,
  160. /**
  161. * Whether or not the overflow menu is visible.
  162. */
  163. _overflowMenuVisible: boolean,
  164. /**
  165. * Whether or not the participants pane is open.
  166. */
  167. _participantsPaneOpen: boolean,
  168. /**
  169. * Whether or not the local participant's hand is raised.
  170. */
  171. _raisedHand: boolean,
  172. /**
  173. * Whether or not the local participant is screensharing.
  174. */
  175. _screensharing: boolean,
  176. /**
  177. * Whether or not the local participant is sharing a YouTube video.
  178. */
  179. _sharingVideo: boolean,
  180. /**
  181. * Flag showing whether toolbar is visible.
  182. */
  183. _visible: boolean,
  184. /**
  185. * Array with the buttons which this Toolbox should display.
  186. */
  187. _visibleButtons: Array<string>,
  188. /**
  189. * Handler to check if a button is enabled.
  190. */
  191. _shouldShowButton: Function,
  192. /**
  193. * Invoked to active other features of the app.
  194. */
  195. dispatch: Function,
  196. /**
  197. * Invoked to obtain translated strings.
  198. */
  199. t: Function
  200. };
  201. declare var APP: Object;
  202. /**
  203. * Implements the conference toolbox on React/Web.
  204. *
  205. * @extends Component
  206. */
  207. class Toolbox extends Component<Props> {
  208. /**
  209. * Initializes a new {@code Toolbox} instance.
  210. *
  211. * @param {Props} props - The read-only React {@code Component} props with
  212. * which the new instance is to be initialized.
  213. */
  214. constructor(props: Props) {
  215. super(props);
  216. // Bind event handlers so they are only bound once per instance.
  217. this._onMouseOut = this._onMouseOut.bind(this);
  218. this._onMouseOver = this._onMouseOver.bind(this);
  219. this._onSetOverflowVisible = this._onSetOverflowVisible.bind(this);
  220. this._onTabIn = this._onTabIn.bind(this);
  221. this._onShortcutToggleChat = this._onShortcutToggleChat.bind(this);
  222. this._onShortcutToggleFullScreen = this._onShortcutToggleFullScreen.bind(this);
  223. this._onShortcutToggleParticipantsPane = this._onShortcutToggleParticipantsPane.bind(this);
  224. this._onShortcutToggleRaiseHand = this._onShortcutToggleRaiseHand.bind(this);
  225. this._onShortcutToggleScreenshare = this._onShortcutToggleScreenshare.bind(this);
  226. this._onShortcutToggleVideoQuality = this._onShortcutToggleVideoQuality.bind(this);
  227. this._onToolbarOpenFeedback = this._onToolbarOpenFeedback.bind(this);
  228. this._onToolbarToggleParticipantsPane = this._onToolbarToggleParticipantsPane.bind(this);
  229. this._onToolbarOpenKeyboardShortcuts = this._onToolbarOpenKeyboardShortcuts.bind(this);
  230. this._onToolbarOpenSpeakerStats = this._onToolbarOpenSpeakerStats.bind(this);
  231. this._onToolbarOpenEmbedMeeting = this._onToolbarOpenEmbedMeeting.bind(this);
  232. this._onToolbarOpenVideoQuality = this._onToolbarOpenVideoQuality.bind(this);
  233. this._onToolbarToggleChat = this._onToolbarToggleChat.bind(this);
  234. this._onToolbarToggleFullScreen = this._onToolbarToggleFullScreen.bind(this);
  235. this._onToolbarToggleProfile = this._onToolbarToggleProfile.bind(this);
  236. this._onToolbarToggleRaiseHand = this._onToolbarToggleRaiseHand.bind(this);
  237. this._onToolbarToggleScreenshare = this._onToolbarToggleScreenshare.bind(this);
  238. this._onToolbarToggleShareAudio = this._onToolbarToggleShareAudio.bind(this);
  239. this._onToolbarOpenLocalRecordingInfoDialog = this._onToolbarOpenLocalRecordingInfoDialog.bind(this);
  240. this._onShortcutToggleTileView = this._onShortcutToggleTileView.bind(this);
  241. }
  242. /**
  243. * Sets keyboard shortcuts for to trigger ToolbarButtons actions.
  244. *
  245. * @inheritdoc
  246. * @returns {void}
  247. */
  248. componentDidMount() {
  249. const KEYBOARD_SHORTCUTS = [
  250. this.props._shouldShowButton('videoquality') && {
  251. character: 'A',
  252. exec: this._onShortcutToggleVideoQuality,
  253. helpDescription: 'toolbar.callQuality'
  254. },
  255. this.props._shouldShowButton('chat') && {
  256. character: 'C',
  257. exec: this._onShortcutToggleChat,
  258. helpDescription: 'keyboardShortcuts.toggleChat'
  259. },
  260. this.props._shouldShowButton('desktop') && {
  261. character: 'D',
  262. exec: this._onShortcutToggleScreenshare,
  263. helpDescription: 'keyboardShortcuts.toggleScreensharing'
  264. },
  265. this.props._shouldShowButton('participants-pane') && {
  266. character: 'P',
  267. exec: this._onShortcutToggleParticipantsPane,
  268. helpDescription: 'keyboardShortcuts.toggleParticipantsPane'
  269. },
  270. this.props._shouldShowButton('raisehand') && {
  271. character: 'R',
  272. exec: this._onShortcutToggleRaiseHand,
  273. helpDescription: 'keyboardShortcuts.raiseHand'
  274. },
  275. this.props._shouldShowButton('fullscreen') && {
  276. character: 'S',
  277. exec: this._onShortcutToggleFullScreen,
  278. helpDescription: 'keyboardShortcuts.fullScreen'
  279. },
  280. this.props._shouldShowButton('tileview') && {
  281. character: 'W',
  282. exec: this._onShortcutToggleTileView,
  283. helpDescription: 'toolbar.tileViewToggle'
  284. }
  285. ];
  286. KEYBOARD_SHORTCUTS.forEach(shortcut => {
  287. if (typeof shortcut === 'object') {
  288. APP.keyboardshortcut.registerShortcut(
  289. shortcut.character,
  290. null,
  291. shortcut.exec,
  292. shortcut.helpDescription);
  293. }
  294. });
  295. }
  296. /**
  297. * Update the visibility of the {@code OverflowMenuButton}.
  298. *
  299. * @inheritdoc
  300. */
  301. componentDidUpdate(prevProps) {
  302. // Ensure the dialog is closed when the toolbox becomes hidden.
  303. if (prevProps._overflowMenuVisible && !this.props._visible) {
  304. this._onSetOverflowVisible(false);
  305. }
  306. if (prevProps._overflowMenuVisible
  307. && !prevProps._dialog
  308. && this.props._dialog) {
  309. this._onSetOverflowVisible(false);
  310. this.props.dispatch(setToolbarHovered(false));
  311. }
  312. }
  313. /**
  314. * Removes keyboard shortcuts registered by this component.
  315. *
  316. * @inheritdoc
  317. * @returns {void}
  318. */
  319. componentWillUnmount() {
  320. [ 'A', 'C', 'D', 'R', 'S' ].forEach(letter =>
  321. APP.keyboardshortcut.unregisterShortcut(letter));
  322. }
  323. /**
  324. * Implements React's {@link Component#render()}.
  325. *
  326. * @inheritdoc
  327. * @returns {ReactElement}
  328. */
  329. render() {
  330. const { _chatOpen, _visible, _visibleButtons } = this.props;
  331. const rootClassNames = `new-toolbox ${_visible ? 'visible' : ''} ${
  332. _visibleButtons.length ? '' : 'no-buttons'} ${_chatOpen ? 'shift-right' : ''}`;
  333. return (
  334. <div
  335. className = { rootClassNames }
  336. id = 'new-toolbox'>
  337. { this._renderToolboxContent() }
  338. </div>
  339. );
  340. }
  341. /**
  342. * Closes the overflow menu if opened.
  343. *
  344. * @private
  345. * @returns {void}
  346. */
  347. _closeOverflowMenuIfOpen() {
  348. const { dispatch, _overflowMenuVisible } = this.props;
  349. _overflowMenuVisible && dispatch(setOverflowMenuVisible(false));
  350. }
  351. /**
  352. * Callback invoked to display {@code FeedbackDialog}.
  353. *
  354. * @private
  355. * @returns {void}
  356. */
  357. _doOpenFeedback() {
  358. const { _conference } = this.props;
  359. this.props.dispatch(openFeedbackDialog(_conference));
  360. }
  361. /**
  362. * Callback invoked to display {@code FeedbackDialog}.
  363. *
  364. * @private
  365. * @returns {void}
  366. */
  367. _doOpenEmbedMeeting() {
  368. this.props.dispatch(openDialog(EmbedMeetingDialog));
  369. }
  370. /**
  371. * Dispatches an action to display {@code KeyboardShortcuts}.
  372. *
  373. * @private
  374. * @returns {void}
  375. */
  376. _doOpenKeyboardShorcuts() {
  377. this.props.dispatch(openKeyboardShortcutsDialog());
  378. }
  379. /**
  380. * Callback invoked to display {@code SpeakerStats}.
  381. *
  382. * @private
  383. * @returns {void}
  384. */
  385. _doOpenSpeakerStats() {
  386. this.props.dispatch(openDialog(SpeakerStats, {
  387. conference: this.props._conference
  388. }));
  389. }
  390. /**
  391. * Dispatches an action to open the video quality dialog.
  392. *
  393. * @private
  394. * @returns {void}
  395. */
  396. _doOpenVideoQuality() {
  397. this.props.dispatch(openDialog(VideoQualityDialog));
  398. }
  399. /**
  400. * Dispatches an action to toggle the display of chat.
  401. *
  402. * @private
  403. * @returns {void}
  404. */
  405. _doToggleChat() {
  406. this.props.dispatch(toggleChat());
  407. }
  408. /**
  409. * Dispatches an action to toggle screensharing.
  410. *
  411. * @private
  412. * @returns {void}
  413. */
  414. _doToggleFullScreen() {
  415. const fullScreen = !this.props._fullScreen;
  416. this.props.dispatch(setFullScreen(fullScreen));
  417. }
  418. /**
  419. * Dispatches an action to show or hide the profile edit panel.
  420. *
  421. * @private
  422. * @returns {void}
  423. */
  424. _doToggleProfile() {
  425. this.props.dispatch(openSettingsDialog(SETTINGS_TABS.PROFILE));
  426. }
  427. /**
  428. * Dispatches an action to toggle the local participant's raised hand state.
  429. *
  430. * @private
  431. * @returns {void}
  432. */
  433. _doToggleRaiseHand() {
  434. const { _localParticipantID, _raisedHand } = this.props;
  435. const newRaisedStatus = !_raisedHand;
  436. this.props.dispatch(participantUpdated({
  437. // XXX Only the local participant is allowed to update without
  438. // stating the JitsiConference instance (i.e. participant property
  439. // `conference` for a remote participant) because the local
  440. // participant is uniquely identified by the very fact that there is
  441. // only one local participant.
  442. id: _localParticipantID,
  443. local: true,
  444. raisedHand: newRaisedStatus
  445. }));
  446. APP.API.notifyRaiseHandUpdated(_localParticipantID, newRaisedStatus);
  447. }
  448. /**
  449. * Dispatches an action to toggle screensharing.
  450. *
  451. * @private
  452. * @param {boolean} enabled - The state to toggle screen sharing to.
  453. * @param {boolean} audioOnly - Only share system audio.
  454. * @returns {void}
  455. */
  456. _doToggleScreenshare(enabled, audioOnly = false) {
  457. if (this.props._desktopSharingEnabled) {
  458. this.props.dispatch(toggleScreensharing(enabled, audioOnly));
  459. }
  460. }
  461. /**
  462. * Dispatches an action to toggle the video quality dialog.
  463. *
  464. * @private
  465. * @returns {void}
  466. */
  467. _doToggleVideoQuality() {
  468. this.props.dispatch(toggleDialog(VideoQualityDialog));
  469. }
  470. /**
  471. * Dispaches an action to toggle tile view.
  472. *
  473. * @private
  474. * @returns {void}
  475. */
  476. _doToggleTileView() {
  477. this.props.dispatch(toggleTileView());
  478. }
  479. _onMouseOut: () => void;
  480. /**
  481. * Dispatches an action signaling the toolbar is not being hovered.
  482. *
  483. * @private
  484. * @returns {void}
  485. */
  486. _onMouseOut() {
  487. this.props.dispatch(setToolbarHovered(false));
  488. }
  489. _onMouseOver: () => void;
  490. /**
  491. * Dispatches an action signaling the toolbar is being hovered.
  492. *
  493. * @private
  494. * @returns {void}
  495. */
  496. _onMouseOver() {
  497. this.props.dispatch(setToolbarHovered(true));
  498. }
  499. _onSetOverflowVisible: (boolean) => void;
  500. /**
  501. * Sets the visibility of the overflow menu.
  502. *
  503. * @param {boolean} visible - Whether or not the overflow menu should be
  504. * displayed.
  505. * @private
  506. * @returns {void}
  507. */
  508. _onSetOverflowVisible(visible) {
  509. this.props.dispatch(setOverflowMenuVisible(visible));
  510. }
  511. _onShortcutToggleChat: () => void;
  512. /**
  513. * Creates an analytics keyboard shortcut event and dispatches an action for
  514. * toggling the display of chat.
  515. *
  516. * @private
  517. * @returns {void}
  518. */
  519. _onShortcutToggleChat() {
  520. sendAnalytics(createShortcutEvent(
  521. 'toggle.chat',
  522. {
  523. enable: !this.props._chatOpen
  524. }));
  525. this._doToggleChat();
  526. }
  527. _onShortcutToggleParticipantsPane: () => void;
  528. /**
  529. * Creates an analytics keyboard shortcut event and dispatches an action for
  530. * toggling the display of the participants pane.
  531. *
  532. * @private
  533. * @returns {void}
  534. */
  535. _onShortcutToggleParticipantsPane() {
  536. sendAnalytics(createShortcutEvent(
  537. 'toggle.participants-pane',
  538. {
  539. enable: !this.props._participantsPaneOpen
  540. }));
  541. this._onToolbarToggleParticipantsPane();
  542. }
  543. _onShortcutToggleVideoQuality: () => void;
  544. /**
  545. * Creates an analytics keyboard shortcut event and dispatches an action for
  546. * toggling the display of Video Quality.
  547. *
  548. * @private
  549. * @returns {void}
  550. */
  551. _onShortcutToggleVideoQuality() {
  552. sendAnalytics(createShortcutEvent('video.quality'));
  553. this._doToggleVideoQuality();
  554. }
  555. _onShortcutToggleTileView: () => void;
  556. /**
  557. * Dispatches an action for toggling the tile view.
  558. *
  559. * @private
  560. * @returns {void}
  561. */
  562. _onShortcutToggleTileView() {
  563. sendAnalytics(createShortcutEvent(
  564. 'toggle.tileview',
  565. {
  566. enable: !this.props._tileViewEnabled
  567. }));
  568. this._doToggleTileView();
  569. }
  570. _onShortcutToggleFullScreen: () => void;
  571. /**
  572. * Creates an analytics keyboard shortcut event and dispatches an action for
  573. * toggling full screen mode.
  574. *
  575. * @private
  576. * @returns {void}
  577. */
  578. _onShortcutToggleFullScreen() {
  579. sendAnalytics(createShortcutEvent(
  580. 'toggle.fullscreen',
  581. {
  582. enable: !this.props._fullScreen
  583. }));
  584. this._doToggleFullScreen();
  585. }
  586. _onShortcutToggleRaiseHand: () => void;
  587. /**
  588. * Creates an analytics keyboard shortcut event and dispatches an action for
  589. * toggling raise hand.
  590. *
  591. * @private
  592. * @returns {void}
  593. */
  594. _onShortcutToggleRaiseHand() {
  595. sendAnalytics(createShortcutEvent(
  596. 'toggle.raise.hand',
  597. ACTION_SHORTCUT_TRIGGERED,
  598. { enable: !this.props._raisedHand }));
  599. this._doToggleRaiseHand();
  600. }
  601. _onShortcutToggleScreenshare: () => void;
  602. /**
  603. * Creates an analytics keyboard shortcut event and dispatches an action for
  604. * toggling screensharing.
  605. *
  606. * @private
  607. * @returns {void}
  608. */
  609. _onShortcutToggleScreenshare() {
  610. const enable = !this.props._screensharing;
  611. sendAnalytics(createToolbarEvent(
  612. 'screen.sharing',
  613. {
  614. enable
  615. }));
  616. this._doToggleScreenshare(enable);
  617. }
  618. _onTabIn: () => void;
  619. /**
  620. * Toggle the toolbar visibility when tabbing into it.
  621. *
  622. * @returns {void}
  623. */
  624. _onTabIn() {
  625. if (!this.props._visible) {
  626. this.props.dispatch(showToolbox());
  627. }
  628. }
  629. _onToolbarOpenFeedback: () => void;
  630. /**
  631. * Creates an analytics toolbar event and dispatches an action for toggling
  632. * display of feedback.
  633. *
  634. * @private
  635. * @returns {void}
  636. */
  637. _onToolbarOpenFeedback() {
  638. sendAnalytics(createToolbarEvent('feedback'));
  639. this._doOpenFeedback();
  640. }
  641. _onToolbarToggleParticipantsPane: () => void;
  642. /**
  643. * Dispatches an action for toggling the participants pane.
  644. *
  645. * @private
  646. * @returns {void}
  647. */
  648. _onToolbarToggleParticipantsPane() {
  649. const { dispatch, _participantsPaneOpen } = this.props;
  650. if (_participantsPaneOpen) {
  651. dispatch(closeParticipantsPane());
  652. } else {
  653. dispatch(openParticipantsPane());
  654. }
  655. }
  656. _onToolbarOpenKeyboardShortcuts: () => void;
  657. /**
  658. * Creates an analytics toolbar event and dispatches an action for opening
  659. * the modal for showing available keyboard shortcuts.
  660. *
  661. * @private
  662. * @returns {void}
  663. */
  664. _onToolbarOpenKeyboardShortcuts() {
  665. sendAnalytics(createToolbarEvent('shortcuts'));
  666. this._doOpenKeyboardShorcuts();
  667. }
  668. _onToolbarOpenEmbedMeeting: () => void;
  669. /**
  670. * Creates an analytics toolbar event and dispatches an action for opening
  671. * the embed meeting modal.
  672. *
  673. * @private
  674. * @returns {void}
  675. */
  676. _onToolbarOpenEmbedMeeting() {
  677. sendAnalytics(createToolbarEvent('embed.meeting'));
  678. this._doOpenEmbedMeeting();
  679. }
  680. _onToolbarOpenSpeakerStats: () => void;
  681. /**
  682. * Creates an analytics toolbar event and dispatches an action for opening
  683. * the speaker stats modal.
  684. *
  685. * @private
  686. * @returns {void}
  687. */
  688. _onToolbarOpenSpeakerStats() {
  689. sendAnalytics(createToolbarEvent('speaker.stats'));
  690. this._doOpenSpeakerStats();
  691. }
  692. _onToolbarOpenVideoQuality: () => void;
  693. /**
  694. * Creates an analytics toolbar event and dispatches an action for toggling
  695. * open the video quality dialog.
  696. *
  697. * @private
  698. * @returns {void}
  699. */
  700. _onToolbarOpenVideoQuality() {
  701. sendAnalytics(createToolbarEvent('video.quality'));
  702. this._doOpenVideoQuality();
  703. }
  704. _onToolbarToggleChat: () => void;
  705. /**
  706. * Creates an analytics toolbar event and dispatches an action for toggling
  707. * the display of chat.
  708. *
  709. * @private
  710. * @returns {void}
  711. */
  712. _onToolbarToggleChat() {
  713. sendAnalytics(createToolbarEvent(
  714. 'toggle.chat',
  715. {
  716. enable: !this.props._chatOpen
  717. }));
  718. this._closeOverflowMenuIfOpen();
  719. this._doToggleChat();
  720. }
  721. _onToolbarToggleFullScreen: () => void;
  722. /**
  723. * Creates an analytics toolbar event and dispatches an action for toggling
  724. * full screen mode.
  725. *
  726. * @private
  727. * @returns {void}
  728. */
  729. _onToolbarToggleFullScreen() {
  730. sendAnalytics(createToolbarEvent(
  731. 'toggle.fullscreen',
  732. {
  733. enable: !this.props._fullScreen
  734. }));
  735. this._closeOverflowMenuIfOpen();
  736. this._doToggleFullScreen();
  737. }
  738. _onToolbarToggleProfile: () => void;
  739. /**
  740. * Creates an analytics toolbar event and dispatches an action for showing
  741. * or hiding the profile edit panel.
  742. *
  743. * @private
  744. * @returns {void}
  745. */
  746. _onToolbarToggleProfile() {
  747. sendAnalytics(createToolbarEvent('profile'));
  748. this._doToggleProfile();
  749. }
  750. _onToolbarToggleRaiseHand: () => void;
  751. /**
  752. * Creates an analytics toolbar event and dispatches an action for toggling
  753. * raise hand.
  754. *
  755. * @private
  756. * @returns {void}
  757. */
  758. _onToolbarToggleRaiseHand() {
  759. sendAnalytics(createToolbarEvent(
  760. 'raise.hand',
  761. { enable: !this.props._raisedHand }));
  762. this._doToggleRaiseHand();
  763. }
  764. _onToolbarToggleScreenshare: () => void;
  765. /**
  766. * Creates an analytics toolbar event and dispatches an action for toggling
  767. * screensharing.
  768. *
  769. * @private
  770. * @returns {void}
  771. */
  772. _onToolbarToggleScreenshare() {
  773. if (!this.props._desktopSharingEnabled) {
  774. return;
  775. }
  776. const enable = !this.props._screensharing;
  777. sendAnalytics(createShortcutEvent(
  778. 'toggle.screen.sharing',
  779. ACTION_SHORTCUT_TRIGGERED,
  780. { enable }));
  781. this._closeOverflowMenuIfOpen();
  782. this._doToggleScreenshare(enable);
  783. }
  784. _onToolbarToggleShareAudio: () => void;
  785. /**
  786. * Handles toggle share audio action.
  787. *
  788. * @returns {void}
  789. */
  790. _onToolbarToggleShareAudio() {
  791. const enable = !this.props._screensharing;
  792. this._closeOverflowMenuIfOpen();
  793. this._doToggleScreenshare(enable, true);
  794. }
  795. _onToolbarOpenLocalRecordingInfoDialog: () => void;
  796. /**
  797. * Opens the {@code LocalRecordingInfoDialog}.
  798. *
  799. * @private
  800. * @returns {void}
  801. */
  802. _onToolbarOpenLocalRecordingInfoDialog() {
  803. sendAnalytics(createToolbarEvent('local.recording'));
  804. this.props.dispatch(openDialog(LocalRecordingInfoDialog));
  805. }
  806. /**
  807. * Returns true if the desktop sharing button should be visible and
  808. * false otherwise.
  809. *
  810. * @returns {boolean}
  811. */
  812. _showDesktopSharingButton() {
  813. const {
  814. _desktopSharingEnabled,
  815. _desktopSharingDisabledTooltipKey
  816. } = this.props;
  817. return (
  818. (_desktopSharingEnabled
  819. || _desktopSharingDisabledTooltipKey)
  820. && this.props._shouldShowButton('desktop')
  821. );
  822. }
  823. /**
  824. * Returns true if the embed meeting button is visible and false otherwise.
  825. *
  826. * @returns {boolean}
  827. */
  828. _isEmbedMeetingVisible() {
  829. return !this.props._isVpaasMeeting
  830. && !this.props._isMobile
  831. && this.props._shouldShowButton('embedmeeting');
  832. }
  833. /**
  834. * Returns true if the profile button is visible and false otherwise.
  835. *
  836. * @returns {boolean}
  837. */
  838. _isProfileVisible() {
  839. return !this.props._isProfileDisabled && this.props._shouldShowButton('profile');
  840. }
  841. /**
  842. * Renders the list elements of the overflow menu.
  843. *
  844. * @private
  845. * @param {Array<React$Element>} additionalButtons - Additional buttons to be displayed.
  846. * @returns {Array<React$Element>}
  847. */
  848. _renderOverflowMenuContent(additionalButtons: Array<React$Element<any>>) {
  849. const {
  850. _desktopSharingEnabled,
  851. _feedbackConfigured,
  852. _fullScreen,
  853. _isMobile,
  854. _screensharing,
  855. t
  856. } = this.props;
  857. const group1 = [
  858. ...additionalButtons,
  859. this.props._shouldShowButton('toggle-camera')
  860. && <ToggleCameraButton
  861. key = 'toggle-camera'
  862. showLabel = { true } />,
  863. this.props._shouldShowButton('videoquality')
  864. && <OverflowMenuVideoQualityItem
  865. key = 'videoquality'
  866. onClick = { this._onToolbarOpenVideoQuality } />,
  867. this.props._shouldShowButton('fullscreen')
  868. && !_isMobile
  869. && <OverflowMenuItem
  870. accessibilityLabel = { t('toolbar.accessibilityLabel.fullScreen') }
  871. icon = { _fullScreen ? IconExitFullScreen : IconFullScreen }
  872. key = 'fullscreen'
  873. onClick = { this._onToolbarToggleFullScreen }
  874. text = { _fullScreen ? t('toolbar.exitFullScreen') : t('toolbar.enterFullScreen') } />,
  875. (this.props._shouldShowButton('security') || this.props._shouldShowButton('info'))
  876. && <SecurityDialogButton
  877. key = 'security'
  878. showLabel = { true } />,
  879. this.props._shouldShowButton('closedcaptions')
  880. && <ClosedCaptionButton
  881. key = 'closed-captions'
  882. showLabel = { true } />,
  883. this.props._shouldShowButton('recording')
  884. && <RecordButton
  885. key = 'record'
  886. showLabel = { true } />,
  887. this.props._shouldShowButton('localrecording')
  888. && <OverflowMenuItem
  889. accessibilityLabel = { t('toolbar.accessibilityLabel.localRecording') }
  890. icon = { IconRec }
  891. key = 'localrecording'
  892. onClick = { this._onToolbarOpenLocalRecordingInfoDialog }
  893. text = { t('localRecording.dialogTitle') } />,
  894. this.props._shouldShowButton('mute-everyone')
  895. && <MuteEveryoneButton
  896. key = 'mute-everyone'
  897. showLabel = { true } />,
  898. this.props._shouldShowButton('mute-video-everyone')
  899. && <MuteEveryonesVideoButton
  900. key = 'mute-everyones-video'
  901. showLabel = { true } />,
  902. this.props._shouldShowButton('livestreaming')
  903. && <LiveStreamButton
  904. key = 'livestreaming'
  905. showLabel = { true } />
  906. ];
  907. const group2 = [
  908. this.props._shouldShowButton('sharedvideo')
  909. && <SharedVideoButton
  910. key = 'sharedvideo'
  911. showLabel = { true } />,
  912. this.props._shouldShowButton('shareaudio')
  913. && _desktopSharingEnabled
  914. && isScreenAudioSupported()
  915. && <OverflowMenuItem
  916. accessibilityLabel = { t('toolbar.accessibilityLabel.shareaudio') }
  917. icon = { IconShareAudio }
  918. key = 'shareaudio'
  919. onClick = { this._onToolbarToggleShareAudio }
  920. text = { t('toolbar.shareaudio') } />,
  921. this.props._shouldShowButton('etherpad')
  922. && <SharedDocumentButton
  923. key = 'etherpad'
  924. showLabel = { true } />,
  925. (this.props._shouldShowButton('select-background') || this.props._shouldShowButton('videobackgroundblur'))
  926. && <VideoBackgroundButton
  927. key = { 'select-background' }
  928. showLabel = { true }
  929. visible = { !_screensharing && checkBlurSupport() } />,
  930. this.props._shouldShowButton('stats')
  931. && <OverflowMenuItem
  932. accessibilityLabel = { t('toolbar.accessibilityLabel.speakerStats') }
  933. icon = { IconPresentation }
  934. key = 'stats'
  935. onClick = { this._onToolbarOpenSpeakerStats }
  936. text = { t('toolbar.speakerStats') } />
  937. ];
  938. return [
  939. this._isProfileVisible()
  940. && <OverflowMenuProfileItem
  941. key = 'profile'
  942. onClick = { this._onToolbarToggleProfile } />,
  943. this._isProfileVisible()
  944. && <hr
  945. className = 'overflow-menu-hr'
  946. key = 'hr1' />,
  947. ...group1,
  948. group1.some(Boolean)
  949. && <hr
  950. className = 'overflow-menu-hr'
  951. key = 'hr2' />,
  952. ...group2,
  953. group2.some(Boolean)
  954. && <hr
  955. className = 'overflow-menu-hr'
  956. key = 'hr3' />,
  957. this.props._shouldShowButton('settings')
  958. && <SettingsButton
  959. key = 'settings'
  960. showLabel = { true } />,
  961. this.props._shouldShowButton('shortcuts')
  962. && !_isMobile
  963. && <OverflowMenuItem
  964. accessibilityLabel = { t('toolbar.accessibilityLabel.shortcuts') }
  965. icon = { IconDeviceDocument }
  966. key = 'shortcuts'
  967. onClick = { this._onToolbarOpenKeyboardShortcuts }
  968. text = { t('toolbar.shortcuts') } />,
  969. this._isEmbedMeetingVisible()
  970. && <OverflowMenuItem
  971. accessibilityLabel = { t('toolbar.accessibilityLabel.embedMeeting') }
  972. icon = { IconCodeBlock }
  973. key = 'embed'
  974. onClick = { this._onToolbarOpenEmbedMeeting }
  975. text = { t('toolbar.embedMeeting') } />,
  976. this.props._shouldShowButton('feedback')
  977. && _feedbackConfigured
  978. && <OverflowMenuItem
  979. accessibilityLabel = { t('toolbar.accessibilityLabel.feedback') }
  980. icon = { IconFeedback }
  981. key = 'feedback'
  982. onClick = { this._onToolbarOpenFeedback }
  983. text = { t('toolbar.feedback') } />,
  984. this.props._shouldShowButton('download')
  985. && <DownloadButton
  986. key = 'download'
  987. showLabel = { true } />,
  988. this.props._shouldShowButton('help')
  989. && <HelpButton
  990. key = 'help'
  991. showLabel = { true } />
  992. ];
  993. }
  994. /**
  995. * Returns the buttons to be displayed in main or the overflow menu.
  996. *
  997. * @param {Set} buttons - A set containing the buttons to be displayed
  998. * in the toolbar beside the main audio/video & hanugup.
  999. * @returns {Object}
  1000. */
  1001. _getAdditionalButtons(buttons) {
  1002. const {
  1003. _chatOpen,
  1004. _desktopSharingEnabled,
  1005. _desktopSharingDisabledTooltipKey,
  1006. _raisedHand,
  1007. _screensharing,
  1008. t
  1009. } = this.props;
  1010. const overflowMenuAdditionalButtons = [];
  1011. const mainMenuAdditionalButtons = [];
  1012. if (this._showDesktopSharingButton()) {
  1013. buttons.has('desktop')
  1014. ? mainMenuAdditionalButtons.push(<ToolbarButton
  1015. accessibilityLabel = { t('toolbar.accessibilityLabel.shareYourScreen') }
  1016. disabled = { !_desktopSharingEnabled }
  1017. icon = { IconShareDesktop }
  1018. key = 'desktop'
  1019. onClick = { this._onToolbarToggleScreenshare }
  1020. toggled = { _screensharing }
  1021. tooltip = { t(_desktopSharingEnabled
  1022. ? 'dialog.shareYourScreen' : _desktopSharingDisabledTooltipKey) } />)
  1023. : overflowMenuAdditionalButtons.push(<OverflowMenuItem
  1024. accessibilityLabel = { t('toolbar.accessibilityLabel.shareYourScreen') }
  1025. icon = { IconShareDesktop }
  1026. iconId = 'share-desktop'
  1027. key = 'desktop'
  1028. onClick = { this._onToolbarToggleScreenshare }
  1029. text = { t(`toolbar.${_screensharing ? 'stopScreenSharing' : 'startScreenSharing'}`) } />);
  1030. }
  1031. if (this.props._shouldShowButton('chat')) {
  1032. buttons.has('chat')
  1033. ? mainMenuAdditionalButtons.push(<div
  1034. className = 'toolbar-button-with-badge'
  1035. key = 'chatcontainer'>
  1036. <ToolbarButton
  1037. accessibilityLabel = { t('toolbar.accessibilityLabel.chat') }
  1038. icon = { IconChat }
  1039. key = 'chat'
  1040. onClick = { this._onToolbarToggleChat }
  1041. toggled = { _chatOpen }
  1042. tooltip = { t('toolbar.chat') } />
  1043. <ChatCounter />
  1044. </div>) : overflowMenuAdditionalButtons.push(<OverflowMenuItem
  1045. accessibilityLabel = { t('toolbar.accessibilityLabel.chat') }
  1046. icon = { IconChat }
  1047. key = 'chat'
  1048. onClick = { this._onToolbarToggleChat }
  1049. text = { t(`toolbar.${_chatOpen ? 'closeChat' : 'openChat'}`) } />);
  1050. }
  1051. if (this.props._shouldShowButton('raisehand')) {
  1052. buttons.has('raisehand')
  1053. ? mainMenuAdditionalButtons.push(<ToolbarButton
  1054. accessibilityLabel = { t('toolbar.accessibilityLabel.raiseHand') }
  1055. icon = { IconRaisedHand }
  1056. key = 'raisehand'
  1057. onClick = { this._onToolbarToggleRaiseHand }
  1058. toggled = { _raisedHand }
  1059. tooltip = { t(`toolbar.${_raisedHand ? 'lowerYourHand' : 'raiseYourHand'}`) } />)
  1060. : overflowMenuAdditionalButtons.push(<OverflowMenuItem
  1061. accessibilityLabel = { t('toolbar.accessibilityLabel.raiseHand') }
  1062. icon = { IconRaisedHand }
  1063. key = 'raisehand'
  1064. onClick = { this._onToolbarToggleRaiseHand }
  1065. text = { t(`toolbar.${_raisedHand ? 'lowerYourHand' : 'raiseYourHand'}`) } />);
  1066. }
  1067. if (this.props._shouldShowButton('participants-pane') || this.props._shouldShowButton('invite')) {
  1068. buttons.has('participants-pane')
  1069. ? mainMenuAdditionalButtons.push(
  1070. <ToolbarButton
  1071. accessibilityLabel = { t('toolbar.accessibilityLabel.participants') }
  1072. icon = { IconParticipants }
  1073. onClick = { this._onToolbarToggleParticipantsPane }
  1074. toggled = { this.props._participantsPaneOpen }
  1075. tooltip = { t('toolbar.participants') } />)
  1076. : overflowMenuAdditionalButtons.push(
  1077. <OverflowMenuItem
  1078. accessibilityLabel = { t('toolbar.accessibilityLabel.participants') }
  1079. icon = { IconParticipants }
  1080. key = 'participants-pane'
  1081. onClick = { this._onToolbarToggleParticipantsPane }
  1082. text = { t('toolbar.participants') } />
  1083. );
  1084. }
  1085. if (this.props._shouldShowButton('tileview')) {
  1086. buttons.has('tileview')
  1087. ? mainMenuAdditionalButtons.push(
  1088. <TileViewButton
  1089. key = 'tileview'
  1090. showLabel = { false } />)
  1091. : overflowMenuAdditionalButtons.push(
  1092. <TileViewButton
  1093. key = 'tileview'
  1094. showLabel = { true } />);
  1095. }
  1096. return {
  1097. mainMenuAdditionalButtons,
  1098. overflowMenuAdditionalButtons
  1099. };
  1100. }
  1101. /**
  1102. * Renders the Audio controlling button.
  1103. *
  1104. * @returns {ReactElement}
  1105. */
  1106. _renderAudioButton() {
  1107. return this.props._shouldShowButton('microphone')
  1108. ? <AudioSettingsButton
  1109. key = 'asb'
  1110. visible = { true } />
  1111. : null;
  1112. }
  1113. /**
  1114. * Renders the Video controlling button.
  1115. *
  1116. * @returns {ReactElement}
  1117. */
  1118. _renderVideoButton() {
  1119. return this.props._shouldShowButton('camera')
  1120. ? <VideoSettingsButton
  1121. key = 'vsb'
  1122. visible = { true } />
  1123. : null;
  1124. }
  1125. /**
  1126. * Renders the toolbox content.
  1127. *
  1128. * @returns {ReactElement}
  1129. */
  1130. _renderToolboxContent() {
  1131. const {
  1132. _clientWidth,
  1133. _isMobile,
  1134. _overflowMenuVisible,
  1135. t
  1136. } = this.props;
  1137. const buttonSet = getToolbarAdditionalButtons(_clientWidth, _isMobile);
  1138. const toolbarAccLabel = 'toolbar.accessibilityLabel.moreActionsMenu';
  1139. const showOverflowMenuButton = buttonSet.has('overflow');
  1140. const containerClassName = `toolbox-content${_isMobile ? ' toolbox-content-mobile' : ''}`;
  1141. let overflowMenuAdditionalButtons = [];
  1142. let mainMenuAdditionalButtons = [];
  1143. if (showOverflowMenuButton) {
  1144. ({ overflowMenuAdditionalButtons, mainMenuAdditionalButtons } = this._getAdditionalButtons(buttonSet));
  1145. }
  1146. return (
  1147. <div className = { containerClassName }>
  1148. <div
  1149. className = 'toolbox-content-wrapper'
  1150. onFocus = { this._onTabIn }
  1151. onMouseOut = { this._onMouseOut }
  1152. onMouseOver = { this._onMouseOver }>
  1153. <div className = 'toolbox-content-items'>
  1154. { this._renderAudioButton() }
  1155. { this._renderVideoButton() }
  1156. { mainMenuAdditionalButtons }
  1157. { showOverflowMenuButton && <OverflowMenuButton
  1158. isOpen = { _overflowMenuVisible }
  1159. onVisibilityChange = { this._onSetOverflowVisible }>
  1160. <ul
  1161. aria-label = { t(toolbarAccLabel) }
  1162. className = 'overflow-menu'>
  1163. { this._renderOverflowMenuContent(overflowMenuAdditionalButtons) }
  1164. </ul>
  1165. </OverflowMenuButton>}
  1166. <HangupButton
  1167. customClass = 'hangup-button'
  1168. visible = { this.props._shouldShowButton('hangup') } />
  1169. </div>
  1170. </div>
  1171. </div>
  1172. );
  1173. }
  1174. }
  1175. /**
  1176. * Maps (parts of) the redux state to {@link Toolbox}'s React {@code Component}
  1177. * props.
  1178. *
  1179. * @param {Object} state - The redux store/state.
  1180. * @private
  1181. * @returns {{}}
  1182. */
  1183. function _mapStateToProps(state) {
  1184. const { conference, locked } = state['features/base/conference'];
  1185. let desktopSharingEnabled = JitsiMeetJS.isDesktopSharingEnabled();
  1186. const {
  1187. callStatsID,
  1188. enableFeaturesBasedOnToken
  1189. } = state['features/base/config'];
  1190. const {
  1191. fullScreen,
  1192. overflowMenuVisible
  1193. } = state['features/toolbox'];
  1194. const localParticipant = getLocalParticipant(state);
  1195. const localRecordingStates = state['features/local-recording'];
  1196. const localVideo = getLocalVideoTrack(state['features/base/tracks']);
  1197. const { clientWidth } = state['features/base/responsive-ui'];
  1198. let desktopSharingDisabledTooltipKey;
  1199. if (enableFeaturesBasedOnToken) {
  1200. // we enable desktop sharing if any participant already have this
  1201. // feature enabled
  1202. desktopSharingEnabled = getParticipants(state)
  1203. .find(({ features = {} }) =>
  1204. String(features['screen-sharing']) === 'true') !== undefined;
  1205. desktopSharingDisabledTooltipKey = 'dialog.shareYourScreenDisabled';
  1206. }
  1207. return {
  1208. _chatOpen: state['features/chat'].isOpen,
  1209. _clientWidth: clientWidth,
  1210. _conference: conference,
  1211. _desktopSharingEnabled: desktopSharingEnabled,
  1212. _desktopSharingDisabledTooltipKey: desktopSharingDisabledTooltipKey,
  1213. _dialog: Boolean(state['features/base/dialog'].component),
  1214. _feedbackConfigured: Boolean(callStatsID),
  1215. _isProfileDisabled: Boolean(state['features/base/config'].disableProfile),
  1216. _isMobile: isMobileBrowser(),
  1217. _isVpaasMeeting: isVpaasMeeting(state),
  1218. _fullScreen: fullScreen,
  1219. _tileViewEnabled: shouldDisplayTileView(state),
  1220. _localParticipantID: localParticipant.id,
  1221. _localRecState: localRecordingStates,
  1222. _locked: locked,
  1223. _overflowMenuVisible: overflowMenuVisible,
  1224. _participantsPaneOpen: getParticipantsPaneOpen(state),
  1225. _raisedHand: localParticipant.raisedHand,
  1226. _screensharing: (localVideo && localVideo.videoType === 'desktop') || isScreenAudioShared(state),
  1227. _shouldShowButton: buttonName => isToolbarButtonEnabled(buttonName)(state),
  1228. _visible: isToolboxVisible(state),
  1229. _visibleButtons: getToolbarButtons(state)
  1230. };
  1231. }
  1232. export default translate(connect(_mapStateToProps)(Toolbox));