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

LargeVideo.web.js 2.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. // @flow
  2. import React, { Component } from 'react';
  3. import { Watermarks } from '../../base/react';
  4. import { Captions } from '../../subtitles/';
  5. import { connect } from '../../base/redux';
  6. declare var interfaceConfig: Object;
  7. type Props = {
  8. /**
  9. * Used to determine the value of the autoplay attribute of the underlying
  10. * video element.
  11. */
  12. _noAutoPlayVideo: boolean
  13. }
  14. /**
  15. * Implements a React {@link Component} which represents the large video (a.k.a.
  16. * the conference participant who is on the local stage) on Web/React.
  17. *
  18. * @extends Component
  19. */
  20. class LargeVideo extends Component<Props> {
  21. /**
  22. * Implements React's {@link Component#render()}.
  23. *
  24. * @inheritdoc
  25. * @returns {React$Element}
  26. */
  27. render() {
  28. return (
  29. <div
  30. className = 'videocontainer'
  31. id = 'largeVideoContainer'>
  32. <div id = 'sharedVideo'>
  33. <div id = 'sharedVideoIFrame' />
  34. </div>
  35. <div id = 'etherpad' />
  36. <Watermarks />
  37. <div id = 'dominantSpeaker'>
  38. <div className = 'dynamic-shadow' />
  39. <div id = 'dominantSpeakerAvatarContainer' />
  40. </div>
  41. <div id = 'remotePresenceMessage' />
  42. <span id = 'remoteConnectionMessage' />
  43. <div id = 'largeVideoElementsContainer'>
  44. <div id = 'largeVideoBackgroundContainer' />
  45. {/*
  46. * FIXME: the architecture of elements related to the large
  47. * video and the naming. The background is not part of
  48. * largeVideoWrapper because we are controlling the size of
  49. * the video through largeVideoWrapper. That's why we need
  50. * another container for the background and the
  51. * largeVideoWrapper in order to hide/show them.
  52. */}
  53. <div id = 'largeVideoWrapper'>
  54. <video
  55. autoPlay = { !this.props._noAutoPlayVideo }
  56. id = 'largeVideo'
  57. muted = { true }
  58. playsInline = { true } /* for Safari on iOS to work */ />
  59. </div>
  60. </div>
  61. { interfaceConfig.DISABLE_TRANSCRIPTION_SUBTITLES
  62. || <Captions /> }
  63. </div>
  64. );
  65. }
  66. }
  67. /**
  68. * Maps (parts of) the Redux state to the associated LargeVideo props.
  69. *
  70. * @param {Object} state - The Redux state.
  71. * @private
  72. * @returns {{
  73. * _noAutoPlayVideo: boolean
  74. * }}
  75. */
  76. function _mapStateToProps(state) {
  77. const testingConfig = state['features/base/config'].testing;
  78. return {
  79. _noAutoPlayVideo: testingConfig?.noAutoPlayVideo
  80. };
  81. }
  82. export default connect(_mapStateToProps)(LargeVideo);