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.

Conference.web.js 2.7KB

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