您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

Conference.web.js 5.9KB

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