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.1KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  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. /**
  32. * This component is displayed before joining a meeting.
  33. */
  34. class PrejoinThirdParty extends Component<Props> {
  35. /**
  36. * Implements React's {@link Component#render()}.
  37. *
  38. * @inheritdoc
  39. * @returns {ReactElement}
  40. */
  41. render() {
  42. const {
  43. className,
  44. deviceStatusVisible,
  45. showCameraPreview,
  46. videoTrack
  47. } = this.props;
  48. return (
  49. <PreMeetingScreen
  50. className = { `prejoin-third-party ${className}` }
  51. showDeviceStatus = { deviceStatusVisible }
  52. skipPrejoinButton = { false }
  53. thirdParty = { true }
  54. videoMuted = { !showCameraPreview }
  55. videoTrack = { videoTrack } />
  56. );
  57. }
  58. }
  59. /**
  60. * Maps (parts of) the redux state to the React {@code Component} props.
  61. *
  62. * @param {Object} state - The redux state.
  63. * @param {Object} ownProps - The props passed to the component.
  64. * @returns {Object}
  65. */
  66. function mapStateToProps(state): Object {
  67. return {
  68. deviceStatusVisible: isDeviceStatusVisible(state),
  69. showCameraPreview: !isVideoMutedByUser(state),
  70. videoTrack: getLocalJitsiVideoTrack(state)
  71. };
  72. }
  73. export default connect(mapStateToProps)(translate(PrejoinThirdParty));