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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184
  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 { Watermarks } from '../../base/react';
  6. import { FeedbackButton } from '../../feedback';
  7. import { OverlayContainer } from '../../overlay';
  8. import { HideNotificationBarStyle } from '../../unsupported-browser';
  9. declare var $: Function;
  10. declare var APP: Object;
  11. /**
  12. * For legacy reasons, inline style for display none.
  13. *
  14. * @private
  15. * @type {{
  16. * display: string
  17. * }}
  18. */
  19. const _DISPLAY_NONE_STYLE = {
  20. display: 'none'
  21. };
  22. /**
  23. * The conference page of the Web application.
  24. */
  25. class Conference extends Component {
  26. /**
  27. * Conference component's property types.
  28. *
  29. * @static
  30. */
  31. static propTypes = {
  32. dispatch: React.PropTypes.func
  33. }
  34. /**
  35. * Until we don't rewrite UI using react components
  36. * we use UI.start from old app. Also method translates
  37. * component right after it has been mounted.
  38. *
  39. * @inheritdoc
  40. */
  41. componentDidMount() {
  42. APP.UI.start();
  43. APP.UI.registerListeners();
  44. APP.UI.bindEvents();
  45. // XXX Temporary solution until we add React translation.
  46. APP.translation.translateElement($('#videoconference_page'));
  47. this.props.dispatch(connect());
  48. }
  49. /**
  50. * Disconnect from the conference when component will be
  51. * unmounted.
  52. *
  53. * @inheritdoc
  54. */
  55. componentWillUnmount() {
  56. APP.UI.unregisterListeners();
  57. APP.UI.unbindEvents();
  58. APP.conference.isJoined() && this.props.dispatch(disconnect());
  59. }
  60. /**
  61. * Implements React's {@link Component#render()}.
  62. *
  63. * @inheritdoc
  64. * @returns {ReactElement}
  65. */
  66. render() {
  67. return (
  68. <div id = 'videoconference_page'>
  69. <div id = 'mainToolbarContainer'>
  70. <div
  71. className = 'notice'
  72. id = 'notice'
  73. style = { _DISPLAY_NONE_STYLE }>
  74. <span
  75. className = 'noticeText'
  76. id = 'noticeText' />
  77. </div>
  78. <div
  79. className = 'toolbar'
  80. id = 'mainToolbar' />
  81. </div>
  82. <div
  83. className = 'hide'
  84. id = 'subject' />
  85. <div
  86. className = 'toolbar'
  87. id = 'extendedToolbar'>
  88. <div id = 'extendedToolbarButtons' />
  89. <FeedbackButton />
  90. <div id = 'sideToolbarContainer' />
  91. </div>
  92. <div id = 'videospace'>
  93. <div
  94. className = 'videocontainer'
  95. id = 'largeVideoContainer'>
  96. <div id = 'sharedVideo'>
  97. <div id = 'sharedVideoIFrame' />
  98. </div>
  99. <div id = 'etherpad' />
  100. <Watermarks />
  101. <div id = 'dominantSpeaker'>
  102. <div className = 'dynamic-shadow' />
  103. <img
  104. id = 'dominantSpeakerAvatar'
  105. src = '' />
  106. </div>
  107. <span id = 'remoteConnectionMessage' />
  108. <div id = 'largeVideoWrapper'>
  109. <video
  110. autoPlay = { true }
  111. id = 'largeVideo'
  112. muted = 'true' />
  113. </div>
  114. <span id = 'localConnectionMessage' />
  115. <span
  116. className = 'video-state-indicator moveToCorner'
  117. id = 'videoResolutionLabel'>HD</span>
  118. <span
  119. className
  120. = 'video-state-indicator centeredVideoLabel'
  121. id = 'recordingLabel'>
  122. <span id = 'recordingLabelText' />
  123. <img
  124. className = 'recordingSpinner'
  125. id = 'recordingSpinner'
  126. src = 'images/spin.svg' />
  127. </span>
  128. </div>
  129. <div className = 'filmstrip'>
  130. <div
  131. className = 'filmstrip__videos'
  132. id = 'remoteVideos'>
  133. <span
  134. className = 'videocontainer'
  135. id = 'localVideoContainer'>
  136. <div className = 'videocontainer__background' />
  137. <span id = 'localVideoWrapper' />
  138. <audio
  139. autoPlay = { true }
  140. id = 'localAudio'
  141. muted = { true } />
  142. <div className = 'videocontainer__toolbar' />
  143. <div className = 'videocontainer__toptoolbar' />
  144. <div
  145. className
  146. = 'videocontainer__hoverOverlay' />
  147. </span>
  148. <audio
  149. id = 'userJoined'
  150. preload = 'auto'
  151. src = 'sounds/joined.wav' />
  152. <audio
  153. id = 'userLeft'
  154. preload = 'auto'
  155. src = 'sounds/left.wav' />
  156. </div>
  157. </div>
  158. </div>
  159. <OverlayContainer />
  160. <HideNotificationBarStyle />
  161. </div>
  162. );
  163. }
  164. }
  165. export default reactReduxConnect()(Conference);