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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401
  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. onFocus = { this._onTabIn }
  333. onMouseOut = { this._onMouseOut }
  334. onMouseOver = { this._onMouseOver }>
  335. { this._renderToolboxContent() }
  336. </div>
  337. );
  338. }
  339. /**
  340. * Closes the overflow menu if opened.
  341. *
  342. * @private
  343. * @returns {void}
  344. */
  345. _closeOverflowMenuIfOpen() {
  346. const { dispatch, _overflowMenuVisible } = this.props;
  347. _overflowMenuVisible && dispatch(setOverflowMenuVisible(false));
  348. }
  349. /**
  350. * Callback invoked to display {@code FeedbackDialog}.
  351. *
  352. * @private
  353. * @returns {void}
  354. */
  355. _doOpenFeedback() {
  356. const { _conference } = this.props;
  357. this.props.dispatch(openFeedbackDialog(_conference));
  358. }
  359. /**
  360. * Callback invoked to display {@code FeedbackDialog}.
  361. *
  362. * @private
  363. * @returns {void}
  364. */
  365. _doOpenEmbedMeeting() {
  366. this.props.dispatch(openDialog(EmbedMeetingDialog));
  367. }
  368. /**
  369. * Dispatches an action to display {@code KeyboardShortcuts}.
  370. *
  371. * @private
  372. * @returns {void}
  373. */
  374. _doOpenKeyboardShorcuts() {
  375. this.props.dispatch(openKeyboardShortcutsDialog());
  376. }
  377. /**
  378. * Callback invoked to display {@code SpeakerStats}.
  379. *
  380. * @private
  381. * @returns {void}
  382. */
  383. _doOpenSpeakerStats() {
  384. this.props.dispatch(openDialog(SpeakerStats, {
  385. conference: this.props._conference
  386. }));
  387. }
  388. /**
  389. * Dispatches an action to open the video quality dialog.
  390. *
  391. * @private
  392. * @returns {void}
  393. */
  394. _doOpenVideoQuality() {
  395. this.props.dispatch(openDialog(VideoQualityDialog));
  396. }
  397. /**
  398. * Dispatches an action to toggle the display of chat.
  399. *
  400. * @private
  401. * @returns {void}
  402. */
  403. _doToggleChat() {
  404. this.props.dispatch(toggleChat());
  405. }
  406. /**
  407. * Dispatches an action to toggle screensharing.
  408. *
  409. * @private
  410. * @returns {void}
  411. */
  412. _doToggleFullScreen() {
  413. const fullScreen = !this.props._fullScreen;
  414. this.props.dispatch(setFullScreen(fullScreen));
  415. }
  416. /**
  417. * Dispatches an action to show or hide the profile edit panel.
  418. *
  419. * @private
  420. * @returns {void}
  421. */
  422. _doToggleProfile() {
  423. this.props.dispatch(openSettingsDialog(SETTINGS_TABS.PROFILE));
  424. }
  425. /**
  426. * Dispatches an action to toggle the local participant's raised hand state.
  427. *
  428. * @private
  429. * @returns {void}
  430. */
  431. _doToggleRaiseHand() {
  432. const { _localParticipantID, _raisedHand } = this.props;
  433. const newRaisedStatus = !_raisedHand;
  434. this.props.dispatch(participantUpdated({
  435. // XXX Only the local participant is allowed to update without
  436. // stating the JitsiConference instance (i.e. participant property
  437. // `conference` for a remote participant) because the local
  438. // participant is uniquely identified by the very fact that there is
  439. // only one local participant.
  440. id: _localParticipantID,
  441. local: true,
  442. raisedHand: newRaisedStatus
  443. }));
  444. APP.API.notifyRaiseHandUpdated(_localParticipantID, newRaisedStatus);
  445. }
  446. /**
  447. * Dispatches an action to toggle screensharing.
  448. *
  449. * @private
  450. * @param {boolean} enabled - The state to toggle screen sharing to.
  451. * @param {boolean} audioOnly - Only share system audio.
  452. * @returns {void}
  453. */
  454. _doToggleScreenshare(enabled, audioOnly = false) {
  455. if (this.props._desktopSharingEnabled) {
  456. this.props.dispatch(toggleScreensharing(enabled, audioOnly));
  457. }
  458. }
  459. /**
  460. * Dispatches an action to toggle the video quality dialog.
  461. *
  462. * @private
  463. * @returns {void}
  464. */
  465. _doToggleVideoQuality() {
  466. this.props.dispatch(toggleDialog(VideoQualityDialog));
  467. }
  468. /**
  469. * Dispaches an action to toggle tile view.
  470. *
  471. * @private
  472. * @returns {void}
  473. */
  474. _doToggleTileView() {
  475. this.props.dispatch(toggleTileView());
  476. }
  477. _onMouseOut: () => void;
  478. /**
  479. * Dispatches an action signaling the toolbar is not being hovered.
  480. *
  481. * @private
  482. * @returns {void}
  483. */
  484. _onMouseOut() {
  485. this.props.dispatch(setToolbarHovered(false));
  486. }
  487. _onMouseOver: () => void;
  488. /**
  489. * Dispatches an action signaling the toolbar is being hovered.
  490. *
  491. * @private
  492. * @returns {void}
  493. */
  494. _onMouseOver() {
  495. this.props.dispatch(setToolbarHovered(true));
  496. }
  497. _onSetOverflowVisible: (boolean) => void;
  498. /**
  499. * Sets the visibility of the overflow menu.
  500. *
  501. * @param {boolean} visible - Whether or not the overflow menu should be
  502. * displayed.
  503. * @private
  504. * @returns {void}
  505. */
  506. _onSetOverflowVisible(visible) {
  507. this.props.dispatch(setOverflowMenuVisible(visible));
  508. }
  509. _onShortcutToggleChat: () => void;
  510. /**
  511. * Creates an analytics keyboard shortcut event and dispatches an action for
  512. * toggling the display of chat.
  513. *
  514. * @private
  515. * @returns {void}
  516. */
  517. _onShortcutToggleChat() {
  518. sendAnalytics(createShortcutEvent(
  519. 'toggle.chat',
  520. {
  521. enable: !this.props._chatOpen
  522. }));
  523. this._doToggleChat();
  524. }
  525. _onShortcutToggleParticipantsPane: () => void;
  526. /**
  527. * Creates an analytics keyboard shortcut event and dispatches an action for
  528. * toggling the display of the participants pane.
  529. *
  530. * @private
  531. * @returns {void}
  532. */
  533. _onShortcutToggleParticipantsPane() {
  534. sendAnalytics(createShortcutEvent(
  535. 'toggle.participants-pane',
  536. {
  537. enable: !this.props._participantsPaneOpen
  538. }));
  539. this._onToolbarToggleParticipantsPane();
  540. }
  541. _onShortcutToggleVideoQuality: () => void;
  542. /**
  543. * Creates an analytics keyboard shortcut event and dispatches an action for
  544. * toggling the display of Video Quality.
  545. *
  546. * @private
  547. * @returns {void}
  548. */
  549. _onShortcutToggleVideoQuality() {
  550. sendAnalytics(createShortcutEvent('video.quality'));
  551. this._doToggleVideoQuality();
  552. }
  553. _onShortcutToggleTileView: () => void;
  554. /**
  555. * Dispatches an action for toggling the tile view.
  556. *
  557. * @private
  558. * @returns {void}
  559. */
  560. _onShortcutToggleTileView() {
  561. sendAnalytics(createShortcutEvent(
  562. 'toggle.tileview',
  563. {
  564. enable: !this.props._tileViewEnabled
  565. }));
  566. this._doToggleTileView();
  567. }
  568. _onShortcutToggleFullScreen: () => void;
  569. /**
  570. * Creates an analytics keyboard shortcut event and dispatches an action for
  571. * toggling full screen mode.
  572. *
  573. * @private
  574. * @returns {void}
  575. */
  576. _onShortcutToggleFullScreen() {
  577. sendAnalytics(createShortcutEvent(
  578. 'toggle.fullscreen',
  579. {
  580. enable: !this.props._fullScreen
  581. }));
  582. this._doToggleFullScreen();
  583. }
  584. _onShortcutToggleRaiseHand: () => void;
  585. /**
  586. * Creates an analytics keyboard shortcut event and dispatches an action for
  587. * toggling raise hand.
  588. *
  589. * @private
  590. * @returns {void}
  591. */
  592. _onShortcutToggleRaiseHand() {
  593. sendAnalytics(createShortcutEvent(
  594. 'toggle.raise.hand',
  595. ACTION_SHORTCUT_TRIGGERED,
  596. { enable: !this.props._raisedHand }));
  597. this._doToggleRaiseHand();
  598. }
  599. _onShortcutToggleScreenshare: () => void;
  600. /**
  601. * Creates an analytics keyboard shortcut event and dispatches an action for
  602. * toggling screensharing.
  603. *
  604. * @private
  605. * @returns {void}
  606. */
  607. _onShortcutToggleScreenshare() {
  608. const enable = !this.props._screensharing;
  609. sendAnalytics(createToolbarEvent(
  610. 'screen.sharing',
  611. {
  612. enable
  613. }));
  614. this._doToggleScreenshare(enable);
  615. }
  616. _onTabIn: () => void;
  617. /**
  618. * Toggle the toolbar visibility when tabbing into it.
  619. *
  620. * @returns {void}
  621. */
  622. _onTabIn() {
  623. if (!this.props._visible) {
  624. this.props.dispatch(showToolbox());
  625. }
  626. }
  627. _onToolbarOpenFeedback: () => void;
  628. /**
  629. * Creates an analytics toolbar event and dispatches an action for toggling
  630. * display of feedback.
  631. *
  632. * @private
  633. * @returns {void}
  634. */
  635. _onToolbarOpenFeedback() {
  636. sendAnalytics(createToolbarEvent('feedback'));
  637. this._doOpenFeedback();
  638. }
  639. _onToolbarToggleParticipantsPane: () => void;
  640. /**
  641. * Dispatches an action for toggling the participants pane.
  642. *
  643. * @private
  644. * @returns {void}
  645. */
  646. _onToolbarToggleParticipantsPane() {
  647. const { dispatch, _participantsPaneOpen } = this.props;
  648. if (_participantsPaneOpen) {
  649. dispatch(closeParticipantsPane());
  650. } else {
  651. dispatch(openParticipantsPane());
  652. }
  653. }
  654. _onToolbarOpenKeyboardShortcuts: () => void;
  655. /**
  656. * Creates an analytics toolbar event and dispatches an action for opening
  657. * the modal for showing available keyboard shortcuts.
  658. *
  659. * @private
  660. * @returns {void}
  661. */
  662. _onToolbarOpenKeyboardShortcuts() {
  663. sendAnalytics(createToolbarEvent('shortcuts'));
  664. this._doOpenKeyboardShorcuts();
  665. }
  666. _onToolbarOpenEmbedMeeting: () => void;
  667. /**
  668. * Creates an analytics toolbar event and dispatches an action for opening
  669. * the embed meeting modal.
  670. *
  671. * @private
  672. * @returns {void}
  673. */
  674. _onToolbarOpenEmbedMeeting() {
  675. sendAnalytics(createToolbarEvent('embed.meeting'));
  676. this._doOpenEmbedMeeting();
  677. }
  678. _onToolbarOpenSpeakerStats: () => void;
  679. /**
  680. * Creates an analytics toolbar event and dispatches an action for opening
  681. * the speaker stats modal.
  682. *
  683. * @private
  684. * @returns {void}
  685. */
  686. _onToolbarOpenSpeakerStats() {
  687. sendAnalytics(createToolbarEvent('speaker.stats'));
  688. this._doOpenSpeakerStats();
  689. }
  690. _onToolbarOpenVideoQuality: () => void;
  691. /**
  692. * Creates an analytics toolbar event and dispatches an action for toggling
  693. * open the video quality dialog.
  694. *
  695. * @private
  696. * @returns {void}
  697. */
  698. _onToolbarOpenVideoQuality() {
  699. sendAnalytics(createToolbarEvent('video.quality'));
  700. this._doOpenVideoQuality();
  701. }
  702. _onToolbarToggleChat: () => void;
  703. /**
  704. * Creates an analytics toolbar event and dispatches an action for toggling
  705. * the display of chat.
  706. *
  707. * @private
  708. * @returns {void}
  709. */
  710. _onToolbarToggleChat() {
  711. sendAnalytics(createToolbarEvent(
  712. 'toggle.chat',
  713. {
  714. enable: !this.props._chatOpen
  715. }));
  716. this._closeOverflowMenuIfOpen();
  717. this._doToggleChat();
  718. }
  719. _onToolbarToggleFullScreen: () => void;
  720. /**
  721. * Creates an analytics toolbar event and dispatches an action for toggling
  722. * full screen mode.
  723. *
  724. * @private
  725. * @returns {void}
  726. */
  727. _onToolbarToggleFullScreen() {
  728. sendAnalytics(createToolbarEvent(
  729. 'toggle.fullscreen',
  730. {
  731. enable: !this.props._fullScreen
  732. }));
  733. this._closeOverflowMenuIfOpen();
  734. this._doToggleFullScreen();
  735. }
  736. _onToolbarToggleProfile: () => void;
  737. /**
  738. * Creates an analytics toolbar event and dispatches an action for showing
  739. * or hiding the profile edit panel.
  740. *
  741. * @private
  742. * @returns {void}
  743. */
  744. _onToolbarToggleProfile() {
  745. sendAnalytics(createToolbarEvent('profile'));
  746. this._doToggleProfile();
  747. }
  748. _onToolbarToggleRaiseHand: () => void;
  749. /**
  750. * Creates an analytics toolbar event and dispatches an action for toggling
  751. * raise hand.
  752. *
  753. * @private
  754. * @returns {void}
  755. */
  756. _onToolbarToggleRaiseHand() {
  757. sendAnalytics(createToolbarEvent(
  758. 'raise.hand',
  759. { enable: !this.props._raisedHand }));
  760. this._doToggleRaiseHand();
  761. }
  762. _onToolbarToggleScreenshare: () => void;
  763. /**
  764. * Creates an analytics toolbar event and dispatches an action for toggling
  765. * screensharing.
  766. *
  767. * @private
  768. * @returns {void}
  769. */
  770. _onToolbarToggleScreenshare() {
  771. if (!this.props._desktopSharingEnabled) {
  772. return;
  773. }
  774. const enable = !this.props._screensharing;
  775. sendAnalytics(createShortcutEvent(
  776. 'toggle.screen.sharing',
  777. ACTION_SHORTCUT_TRIGGERED,
  778. { enable }));
  779. this._closeOverflowMenuIfOpen();
  780. this._doToggleScreenshare(enable);
  781. }
  782. _onToolbarToggleShareAudio: () => void;
  783. /**
  784. * Handles toggle share audio action.
  785. *
  786. * @returns {void}
  787. */
  788. _onToolbarToggleShareAudio() {
  789. const enable = !this.props._screensharing;
  790. this._closeOverflowMenuIfOpen();
  791. this._doToggleScreenshare(enable, true);
  792. }
  793. _onToolbarOpenLocalRecordingInfoDialog: () => void;
  794. /**
  795. * Opens the {@code LocalRecordingInfoDialog}.
  796. *
  797. * @private
  798. * @returns {void}
  799. */
  800. _onToolbarOpenLocalRecordingInfoDialog() {
  801. sendAnalytics(createToolbarEvent('local.recording'));
  802. this.props.dispatch(openDialog(LocalRecordingInfoDialog));
  803. }
  804. /**
  805. * Returns true if the desktop sharing button should be visible and
  806. * false otherwise.
  807. *
  808. * @returns {boolean}
  809. */
  810. _showDesktopSharingButton() {
  811. const {
  812. _desktopSharingEnabled,
  813. _desktopSharingDisabledTooltipKey
  814. } = this.props;
  815. return (
  816. (_desktopSharingEnabled
  817. || _desktopSharingDisabledTooltipKey)
  818. && this._shouldShowButton('desktop')
  819. );
  820. }
  821. /**
  822. * Returns true if the embed meeting button is visible and false otherwise.
  823. *
  824. * @returns {boolean}
  825. */
  826. _isEmbedMeetingVisible() {
  827. return !this.props._isVpaasMeeting
  828. && !this.props._isMobile
  829. && this._shouldShowButton('embedmeeting');
  830. }
  831. /**
  832. * Returns true if the profile button is visible and false otherwise.
  833. *
  834. * @returns {boolean}
  835. */
  836. _isProfileVisible() {
  837. return !this.props._isProfileDisabled && this._shouldShowButton('profile');
  838. }
  839. /**
  840. * Renders the list elements of the overflow menu.
  841. *
  842. * @private
  843. * @param {Array<React$Element>} additionalButtons - Additional buttons to be displayed.
  844. * @returns {Array<React$Element>}
  845. */
  846. _renderOverflowMenuContent(additionalButtons: Array<React$Element<any>>) {
  847. const {
  848. _desktopSharingEnabled,
  849. _feedbackConfigured,
  850. _fullScreen,
  851. _isMobile,
  852. _screensharing,
  853. t
  854. } = this.props;
  855. const group1 = [
  856. ...additionalButtons,
  857. this._shouldShowButton('toggle-camera')
  858. && <ToggleCameraButton
  859. key = 'toggle-camera'
  860. showLabel = { true } />,
  861. this._shouldShowButton('videoquality')
  862. && <OverflowMenuVideoQualityItem
  863. key = 'videoquality'
  864. onClick = { this._onToolbarOpenVideoQuality } />,
  865. this._shouldShowButton('fullscreen')
  866. && !_isMobile
  867. && <OverflowMenuItem
  868. accessibilityLabel = { t('toolbar.accessibilityLabel.fullScreen') }
  869. icon = { _fullScreen ? IconExitFullScreen : IconFullScreen }
  870. key = 'fullscreen'
  871. onClick = { this._onToolbarToggleFullScreen }
  872. text = { _fullScreen ? t('toolbar.exitFullScreen') : t('toolbar.enterFullScreen') } />,
  873. (this._shouldShowButton('security') || this._shouldShowButton('info'))
  874. && <SecurityDialogButton
  875. key = 'security'
  876. showLabel = { true } />,
  877. this._shouldShowButton('closedcaptions')
  878. && <ClosedCaptionButton
  879. key = 'closed-captions'
  880. showLabel = { true } />,
  881. this._shouldShowButton('recording')
  882. && <RecordButton
  883. key = 'record'
  884. showLabel = { true } />,
  885. this._shouldShowButton('localrecording')
  886. && <OverflowMenuItem
  887. accessibilityLabel = { t('toolbar.accessibilityLabel.localRecording') }
  888. icon = { IconRec }
  889. key = 'localrecording'
  890. onClick = { this._onToolbarOpenLocalRecordingInfoDialog }
  891. text = { t('localRecording.dialogTitle') } />,
  892. this._shouldShowButton('mute-everyone')
  893. && <MuteEveryoneButton
  894. key = 'mute-everyone'
  895. showLabel = { true } />,
  896. this._shouldShowButton('mute-video-everyone')
  897. && <MuteEveryonesVideoButton
  898. key = 'mute-everyones-video'
  899. showLabel = { true } />,
  900. this._shouldShowButton('livestreaming')
  901. && <LiveStreamButton
  902. key = 'livestreaming'
  903. showLabel = { true } />
  904. ];
  905. const group2 = [
  906. this._shouldShowButton('sharedvideo')
  907. && <SharedVideoButton
  908. key = 'sharedvideo'
  909. showLabel = { true } />,
  910. this._shouldShowButton('shareaudio')
  911. && _desktopSharingEnabled
  912. && isScreenAudioSupported()
  913. && <OverflowMenuItem
  914. accessibilityLabel = { t('toolbar.accessibilityLabel.shareaudio') }
  915. icon = { IconShareAudio }
  916. key = 'shareaudio'
  917. onClick = { this._onToolbarToggleShareAudio }
  918. text = { t('toolbar.shareaudio') } />,
  919. this._shouldShowButton('etherpad')
  920. && <SharedDocumentButton
  921. key = 'etherpad'
  922. showLabel = { true } />,
  923. (this._shouldShowButton('select-background') || this._shouldShowButton('videobackgroundblur'))
  924. && <VideoBackgroundButton
  925. key = { 'select-background' }
  926. showLabel = { true }
  927. visible = { !_screensharing && checkBlurSupport() } />,
  928. this._shouldShowButton('stats')
  929. && <OverflowMenuItem
  930. accessibilityLabel = { t('toolbar.accessibilityLabel.speakerStats') }
  931. icon = { IconPresentation }
  932. key = 'stats'
  933. onClick = { this._onToolbarOpenSpeakerStats }
  934. text = { t('toolbar.speakerStats') } />
  935. ];
  936. return [
  937. this._isProfileVisible()
  938. && <OverflowMenuProfileItem
  939. key = 'profile'
  940. onClick = { this._onToolbarToggleProfile } />,
  941. this._isProfileVisible()
  942. && <hr
  943. className = 'overflow-menu-hr'
  944. key = 'hr1' />,
  945. ...group1,
  946. group1.some(Boolean)
  947. && <hr
  948. className = 'overflow-menu-hr'
  949. key = 'hr2' />,
  950. ...group2,
  951. group2.some(Boolean)
  952. && <hr
  953. className = 'overflow-menu-hr'
  954. key = 'hr3' />,
  955. this._shouldShowButton('settings')
  956. && <SettingsButton
  957. key = 'settings'
  958. showLabel = { true } />,
  959. this._shouldShowButton('shortcuts')
  960. && !_isMobile
  961. && <OverflowMenuItem
  962. accessibilityLabel = { t('toolbar.accessibilityLabel.shortcuts') }
  963. icon = { IconDeviceDocument }
  964. key = 'shortcuts'
  965. onClick = { this._onToolbarOpenKeyboardShortcuts }
  966. text = { t('toolbar.shortcuts') } />,
  967. this._isEmbedMeetingVisible()
  968. && <OverflowMenuItem
  969. accessibilityLabel = { t('toolbar.accessibilityLabel.embedMeeting') }
  970. icon = { IconCodeBlock }
  971. key = 'embed'
  972. onClick = { this._onToolbarOpenEmbedMeeting }
  973. text = { t('toolbar.embedMeeting') } />,
  974. this._shouldShowButton('feedback')
  975. && _feedbackConfigured
  976. && <OverflowMenuItem
  977. accessibilityLabel = { t('toolbar.accessibilityLabel.feedback') }
  978. icon = { IconFeedback }
  979. key = 'feedback'
  980. onClick = { this._onToolbarOpenFeedback }
  981. text = { t('toolbar.feedback') } />,
  982. this._shouldShowButton('download')
  983. && <DownloadButton
  984. key = 'download'
  985. showLabel = { true } />,
  986. this._shouldShowButton('help')
  987. && <HelpButton
  988. key = 'help'
  989. showLabel = { true } />
  990. ];
  991. }
  992. /**
  993. * Returns the buttons to be displayed in main or the overflow menu.
  994. *
  995. * @param {Set} buttons - A set containing the buttons to be displayed
  996. * in the toolbar beside the main audio/video & hanugup.
  997. * @returns {Object}
  998. */
  999. _getAdditionalButtons(buttons) {
  1000. const {
  1001. _chatOpen,
  1002. _desktopSharingEnabled,
  1003. _desktopSharingDisabledTooltipKey,
  1004. _raisedHand,
  1005. _screensharing,
  1006. t
  1007. } = this.props;
  1008. const overflowMenuAdditionalButtons = [];
  1009. const mainMenuAdditionalButtons = [];
  1010. if (this._showDesktopSharingButton()) {
  1011. buttons.has('desktop')
  1012. ? mainMenuAdditionalButtons.push(<ToolbarButton
  1013. accessibilityLabel = { t('toolbar.accessibilityLabel.shareYourScreen') }
  1014. disabled = { !_desktopSharingEnabled }
  1015. icon = { IconShareDesktop }
  1016. key = 'desktop'
  1017. onClick = { this._onToolbarToggleScreenshare }
  1018. toggled = { _screensharing }
  1019. tooltip = { t(_desktopSharingEnabled
  1020. ? 'dialog.shareYourScreen' : _desktopSharingDisabledTooltipKey) } />)
  1021. : overflowMenuAdditionalButtons.push(<OverflowMenuItem
  1022. accessibilityLabel = { t('toolbar.accessibilityLabel.shareYourScreen') }
  1023. icon = { IconShareDesktop }
  1024. iconId = 'share-desktop'
  1025. key = 'desktop'
  1026. onClick = { this._onToolbarToggleScreenshare }
  1027. text = { t(`toolbar.${_screensharing ? 'stopScreenSharing' : 'startScreenSharing'}`) } />);
  1028. }
  1029. if (this._shouldShowButton('chat')) {
  1030. buttons.has('chat')
  1031. ? mainMenuAdditionalButtons.push(<div
  1032. className = 'toolbar-button-with-badge'
  1033. key = 'chatcontainer'>
  1034. <ToolbarButton
  1035. accessibilityLabel = { t('toolbar.accessibilityLabel.chat') }
  1036. icon = { IconChat }
  1037. key = 'chat'
  1038. onClick = { this._onToolbarToggleChat }
  1039. toggled = { _chatOpen }
  1040. tooltip = { t('toolbar.chat') } />
  1041. <ChatCounter />
  1042. </div>) : overflowMenuAdditionalButtons.push(<OverflowMenuItem
  1043. accessibilityLabel = { t('toolbar.accessibilityLabel.chat') }
  1044. icon = { IconChat }
  1045. key = 'chat'
  1046. onClick = { this._onToolbarToggleChat }
  1047. text = { t(`toolbar.${_chatOpen ? 'closeChat' : 'openChat'}`) } />);
  1048. }
  1049. if (this._shouldShowButton('raisehand')) {
  1050. buttons.has('raisehand')
  1051. ? mainMenuAdditionalButtons.push(<ToolbarButton
  1052. accessibilityLabel = { t('toolbar.accessibilityLabel.raiseHand') }
  1053. icon = { IconRaisedHand }
  1054. key = 'raisehand'
  1055. onClick = { this._onToolbarToggleRaiseHand }
  1056. toggled = { _raisedHand }
  1057. tooltip = { t(`toolbar.${_raisedHand ? 'lowerYourHand' : 'raiseYourHand'}`) } />)
  1058. : overflowMenuAdditionalButtons.push(<OverflowMenuItem
  1059. accessibilityLabel = { t('toolbar.accessibilityLabel.raiseHand') }
  1060. icon = { IconRaisedHand }
  1061. key = 'raisehand'
  1062. onClick = { this._onToolbarToggleRaiseHand }
  1063. text = { t(`toolbar.${_raisedHand ? 'lowerYourHand' : 'raiseYourHand'}`) } />);
  1064. }
  1065. if (this._shouldShowButton('participants-pane') || this._shouldShowButton('invite')) {
  1066. buttons.has('participants-pane')
  1067. ? mainMenuAdditionalButtons.push(
  1068. <ToolbarButton
  1069. accessibilityLabel = { t('toolbar.accessibilityLabel.participants') }
  1070. icon = { IconParticipants }
  1071. onClick = { this._onToolbarToggleParticipantsPane }
  1072. toggled = { this.props._participantsPaneOpen }
  1073. tooltip = { t('toolbar.participants') } />)
  1074. : overflowMenuAdditionalButtons.push(
  1075. <OverflowMenuItem
  1076. accessibilityLabel = { t('toolbar.accessibilityLabel.participants') }
  1077. icon = { IconParticipants }
  1078. key = 'participants-pane'
  1079. onClick = { this._onToolbarToggleParticipantsPane }
  1080. text = { t('toolbar.participants') } />
  1081. );
  1082. }
  1083. if (this._shouldShowButton('tileview')) {
  1084. buttons.has('tileview')
  1085. ? mainMenuAdditionalButtons.push(
  1086. <TileViewButton
  1087. key = 'tileview'
  1088. showLabel = { false } />)
  1089. : overflowMenuAdditionalButtons.push(
  1090. <TileViewButton
  1091. key = 'tileview'
  1092. showLabel = { true } />);
  1093. }
  1094. return {
  1095. mainMenuAdditionalButtons,
  1096. overflowMenuAdditionalButtons
  1097. };
  1098. }
  1099. /**
  1100. * Renders the Audio controlling button.
  1101. *
  1102. * @returns {ReactElement}
  1103. */
  1104. _renderAudioButton() {
  1105. return this._shouldShowButton('microphone')
  1106. ? <AudioSettingsButton
  1107. key = 'asb'
  1108. visible = { true } />
  1109. : null;
  1110. }
  1111. /**
  1112. * Renders the Video controlling button.
  1113. *
  1114. * @returns {ReactElement}
  1115. */
  1116. _renderVideoButton() {
  1117. return this._shouldShowButton('camera')
  1118. ? <VideoSettingsButton
  1119. key = 'vsb'
  1120. visible = { true } />
  1121. : null;
  1122. }
  1123. /**
  1124. * Renders the toolbox content.
  1125. *
  1126. * @returns {ReactElement}
  1127. */
  1128. _renderToolboxContent() {
  1129. const {
  1130. _clientWidth,
  1131. _isMobile,
  1132. _overflowMenuVisible,
  1133. t
  1134. } = this.props;
  1135. const buttonSet = getToolbarAdditionalButtons(_clientWidth, _isMobile);
  1136. const toolbarAccLabel = 'toolbar.accessibilityLabel.moreActionsMenu';
  1137. const showOverflowMenuButton = buttonSet.has('overflow');
  1138. const containerClassName = `toolbox-content${_isMobile ? ' toolbox-content-mobile' : ''}`;
  1139. let overflowMenuAdditionalButtons = [];
  1140. let mainMenuAdditionalButtons = [];
  1141. if (showOverflowMenuButton) {
  1142. ({ overflowMenuAdditionalButtons, mainMenuAdditionalButtons } = this._getAdditionalButtons(buttonSet));
  1143. }
  1144. return (
  1145. <div className = { containerClassName }>
  1146. <div className = 'toolbox-content-wrapper'>
  1147. <div className = 'toolbox-content-items'>
  1148. { this._renderAudioButton() }
  1149. { this._renderVideoButton() }
  1150. { mainMenuAdditionalButtons }
  1151. { showOverflowMenuButton && <OverflowMenuButton
  1152. isOpen = { _overflowMenuVisible }
  1153. onVisibilityChange = { this._onSetOverflowVisible }>
  1154. <ul
  1155. aria-label = { t(toolbarAccLabel) }
  1156. className = 'overflow-menu'>
  1157. { this._renderOverflowMenuContent(overflowMenuAdditionalButtons) }
  1158. </ul>
  1159. </OverflowMenuButton>}
  1160. <HangupButton
  1161. customClass = 'hangup-button'
  1162. visible = { this._shouldShowButton('hangup') } />
  1163. </div>
  1164. </div>
  1165. </div>
  1166. );
  1167. }
  1168. _shouldShowButton: (string) => boolean;
  1169. /**
  1170. * Returns if a button name has been explicitly configured to be displayed.
  1171. *
  1172. * @param {string} buttonName - The name of the button, as expected in
  1173. * {@link interfaceConfig}.
  1174. * @private
  1175. * @returns {boolean} True if the button should be displayed.
  1176. */
  1177. _shouldShowButton(buttonName) {
  1178. return this.props._visibleButtons.includes(buttonName);
  1179. }
  1180. }
  1181. /**
  1182. * Maps (parts of) the redux state to {@link Toolbox}'s React {@code Component}
  1183. * props.
  1184. *
  1185. * @param {Object} state - The redux store/state.
  1186. * @private
  1187. * @returns {{}}
  1188. */
  1189. function _mapStateToProps(state) {
  1190. const { conference, locked } = state['features/base/conference'];
  1191. let desktopSharingEnabled = JitsiMeetJS.isDesktopSharingEnabled();
  1192. const {
  1193. callStatsID,
  1194. enableFeaturesBasedOnToken
  1195. } = state['features/base/config'];
  1196. const {
  1197. fullScreen,
  1198. overflowMenuVisible
  1199. } = state['features/toolbox'];
  1200. const localParticipant = getLocalParticipant(state);
  1201. const localRecordingStates = state['features/local-recording'];
  1202. const localVideo = getLocalVideoTrack(state['features/base/tracks']);
  1203. const { clientWidth } = state['features/base/responsive-ui'];
  1204. let desktopSharingDisabledTooltipKey;
  1205. if (enableFeaturesBasedOnToken) {
  1206. // we enable desktop sharing if any participant already have this
  1207. // feature enabled
  1208. desktopSharingEnabled = getParticipants(state)
  1209. .find(({ features = {} }) =>
  1210. String(features['screen-sharing']) === 'true') !== undefined;
  1211. desktopSharingDisabledTooltipKey = 'dialog.shareYourScreenDisabled';
  1212. }
  1213. return {
  1214. _chatOpen: state['features/chat'].isOpen,
  1215. _clientWidth: clientWidth,
  1216. _conference: conference,
  1217. _desktopSharingEnabled: desktopSharingEnabled,
  1218. _desktopSharingDisabledTooltipKey: desktopSharingDisabledTooltipKey,
  1219. _dialog: Boolean(state['features/base/dialog'].component),
  1220. _feedbackConfigured: Boolean(callStatsID),
  1221. _isProfileDisabled: Boolean(state['features/base/config'].disableProfile),
  1222. _isMobile: isMobileBrowser(),
  1223. _isVpaasMeeting: isVpaasMeeting(state),
  1224. _fullScreen: fullScreen,
  1225. _tileViewEnabled: shouldDisplayTileView(state),
  1226. _localParticipantID: localParticipant.id,
  1227. _localRecState: localRecordingStates,
  1228. _locked: locked,
  1229. _overflowMenuVisible: overflowMenuVisible,
  1230. _participantsPaneOpen: getParticipantsPaneOpen(state),
  1231. _raisedHand: localParticipant.raisedHand,
  1232. _screensharing: (localVideo && localVideo.videoType === 'desktop') || isScreenAudioShared(state),
  1233. _visible: isToolboxVisible(state),
  1234. _visibleButtons: getToolbarButtons(state)
  1235. };
  1236. }
  1237. export default translate(connect(_mapStateToProps)(Toolbox));