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

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