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 44KB

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