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

Conference.web.js 2.7KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. /* @flow */
  2. import React, { Component } from 'react';
  3. import { connect as reactReduxConnect } from 'react-redux';
  4. import { connect, disconnect } from '../../base/connection';
  5. import { DialogContainer } from '../../base/dialog';
  6. import { Filmstrip } from '../../filmstrip';
  7. import { LargeVideo } from '../../large-video';
  8. import { NotificationsContainer } from '../../notifications';
  9. import { OverlayContainer } from '../../overlay';
  10. import { Toolbox } from '../../toolbox';
  11. import { HideNotificationBarStyle } from '../../unsupported-browser';
  12. declare var $: Function;
  13. declare var APP: Object;
  14. declare var interfaceConfig: Object;
  15. /**
  16. * The conference page of the Web application.
  17. */
  18. class Conference extends Component {
  19. /**
  20. * Conference component's property types.
  21. *
  22. * @static
  23. */
  24. static propTypes = {
  25. dispatch: React.PropTypes.func
  26. };
  27. /**
  28. * Until we don't rewrite UI using react components
  29. * we use UI.start from old app. Also method translates
  30. * component right after it has been mounted.
  31. *
  32. * @inheritdoc
  33. */
  34. componentDidMount() {
  35. APP.UI.start();
  36. APP.UI.registerListeners();
  37. APP.UI.bindEvents();
  38. this.props.dispatch(connect());
  39. }
  40. /**
  41. * Disconnect from the conference when component will be
  42. * unmounted.
  43. *
  44. * @inheritdoc
  45. */
  46. componentWillUnmount() {
  47. APP.UI.stopDaemons();
  48. APP.UI.unregisterListeners();
  49. APP.UI.unbindEvents();
  50. APP.conference.isJoined() && this.props.dispatch(disconnect());
  51. }
  52. /**
  53. * Implements React's {@link Component#render()}.
  54. *
  55. * @inheritdoc
  56. * @returns {ReactElement}
  57. */
  58. render() {
  59. const { filmStripOnly } = interfaceConfig;
  60. return (
  61. <div id = 'videoconference_page'>
  62. <div id = 'videospace'>
  63. <LargeVideo />
  64. <Filmstrip displayToolbox = { filmStripOnly } />
  65. </div>
  66. { filmStripOnly ? null : <Toolbox /> }
  67. <DialogContainer />
  68. { filmStripOnly ? null : <NotificationsContainer /> }
  69. <OverlayContainer />
  70. {/*
  71. * Temasys automatically injects a notification bar, if
  72. * necessary, displayed at the top of the page notifying that
  73. * WebRTC is not installed or supported. We do not need/want
  74. * the notification bar in question because we have whole pages
  75. * dedicated to the respective scenarios.
  76. */}
  77. <HideNotificationBarStyle />
  78. </div>
  79. );
  80. }
  81. }
  82. export default reactReduxConnect()(Conference);