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.

PrejoinThirdParty.js 2.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. // @flow
  2. import React, { Component } from 'react';
  3. import { translate } from '../../base/i18n';
  4. import { isVideoMutedByUser } from '../../base/media';
  5. import { PreMeetingScreen } from '../../base/premeeting';
  6. import { connect } from '../../base/redux';
  7. import { getLocalJitsiVideoTrack } from '../../base/tracks';
  8. import { isDeviceStatusVisible } from '../functions';
  9. type Props = {
  10. /**
  11. * Indicates the className that needs to be applied.
  12. */
  13. className: string,
  14. /**
  15. * Flag signaling if the device status is visible or not.
  16. */
  17. deviceStatusVisible: boolean,
  18. /**
  19. * Flag signaling the visibility of camera preview.
  20. */
  21. showCameraPreview: boolean,
  22. /**
  23. * Used for translation.
  24. */
  25. t: Function,
  26. /**
  27. * The JitsiLocalTrack to display.
  28. */
  29. videoTrack: ?Object
  30. };
  31. const buttons = [ 'microphone', 'camera', 'select-background' ];
  32. /**
  33. * This component is displayed before joining a meeting.
  34. */
  35. class PrejoinThirdParty extends Component<Props> {
  36. /**
  37. * Implements React's {@link Component#render()}.
  38. *
  39. * @inheritdoc
  40. * @returns {ReactElement}
  41. */
  42. render() {
  43. const {
  44. className,
  45. deviceStatusVisible,
  46. showCameraPreview,
  47. videoTrack
  48. } = this.props;
  49. return (
  50. <PreMeetingScreen
  51. className = { `prejoin-third-party ${className}` }
  52. showDeviceStatus = { deviceStatusVisible }
  53. skipPrejoinButton = { false }
  54. toolbarButtons = { buttons }
  55. videoMuted = { !showCameraPreview }
  56. videoTrack = { videoTrack } />
  57. );
  58. }
  59. }
  60. /**
  61. * Maps (parts of) the redux state to the React {@code Component} props.
  62. *
  63. * @param {Object} state - The redux state.
  64. * @param {Object} ownProps - The props passed to the component.
  65. * @returns {Object}
  66. */
  67. function mapStateToProps(state): Object {
  68. return {
  69. deviceStatusVisible: isDeviceStatusVisible(state),
  70. showCameraPreview: !isVideoMutedByUser(state),
  71. videoTrack: getLocalJitsiVideoTrack(state)
  72. };
  73. }
  74. export default connect(mapStateToProps)(translate(PrejoinThirdParty));