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

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