Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

Conference.web.js 5.9KB

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