Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

Filmstrip.web.js 4.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. /* @flow */
  2. import React, { Component } from 'react';
  3. import { connect } from 'react-redux';
  4. import { Toolbox } from '../../toolbox';
  5. /**
  6. * Implements a React {@link Component} which represents the filmstrip on
  7. * Web/React.
  8. *
  9. * @extends Component
  10. */
  11. class Filmstrip extends Component {
  12. static propTypes = {
  13. /**
  14. * Whether or not the remote videos should be visible. Will toggle
  15. * a class for hiding the videos.
  16. */
  17. _remoteVideosVisible: React.PropTypes.bool,
  18. /**
  19. * Whether or not the toolbox should be displayed within the filmstrip.
  20. */
  21. displayToolbox: React.PropTypes.bool
  22. };
  23. /**
  24. * Implements React's {@link Component#render()}.
  25. *
  26. * @inheritdoc
  27. * @returns {ReactElement}
  28. */
  29. render() {
  30. /**
  31. * Note: Appending of {@code RemoteVideo} views is handled through
  32. * VideoLayout. The views do not get blown away on render() because
  33. * ReactDOMComponent is only aware of the given JSX and not new appended
  34. * DOM. As such, when updateDOMProperties gets called, only attributes
  35. * will get updated without replacing the DOM. If the known DOM gets
  36. * modified, then the views will get blown away.
  37. */
  38. const filmstripClassNames = `filmstrip ${this.props._remoteVideosVisible
  39. ? '' : 'hide-videos'}`;
  40. return (
  41. <div className = { filmstripClassNames }>
  42. { this.props.displayToolbox ? <Toolbox /> : null }
  43. <div
  44. className = 'filmstrip__videos'
  45. id = 'remoteVideos'>
  46. <div
  47. className = 'filmstrip__videos'
  48. id = 'filmstripLocalVideo'>
  49. <span
  50. className = 'videocontainer'
  51. id = 'localVideoContainer'>
  52. <div className = 'videocontainer__background' />
  53. <span id = 'localVideoWrapper' />
  54. <audio
  55. autoPlay = { true }
  56. id = 'localAudio'
  57. muted = { true } />
  58. <div className = 'videocontainer__toolbar' />
  59. <div className = 'videocontainer__toptoolbar' />
  60. <div className = 'videocontainer__hoverOverlay' />
  61. <div className = 'displayNameContainer' />
  62. <div className = 'avatar-container' />
  63. </span>
  64. </div>
  65. <div
  66. className = 'filmstrip__videos'
  67. id = 'filmstripRemoteVideos'>
  68. {/**
  69. * This extra video container is needed for scrolling
  70. * thumbnails in Firefox; otherwise, the flex
  71. * thumbnails resize instead of causing overflow.
  72. */}
  73. <div
  74. className = 'remote-videos-container'
  75. id = 'filmstripRemoteVideosContainer' />
  76. </div>
  77. <audio
  78. id = 'userJoined'
  79. preload = 'auto'
  80. src = 'sounds/joined.wav' />
  81. <audio
  82. id = 'userLeft'
  83. preload = 'auto'
  84. src = 'sounds/left.wav' />
  85. </div>
  86. </div>
  87. );
  88. }
  89. }
  90. /**
  91. * Maps (parts of) the Redux state to the associated {@code Filmstrip}'s props.
  92. *
  93. * @param {Object} state - The Redux state.
  94. * @private
  95. * @returns {{
  96. * _remoteVideosVisible: boolean
  97. * }}
  98. */
  99. function _mapStateToProps(state) {
  100. const { remoteVideosVisible } = state['features/filmstrip'];
  101. const { disable1On1Mode } = state['features/base/config'];
  102. return {
  103. _remoteVideosVisible: Boolean(remoteVideosVisible || disable1On1Mode)
  104. };
  105. }
  106. export default connect(_mapStateToProps)(Filmstrip);