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.tsx 2.2KB

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