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.

MuteVideoButton.tsx 1.9KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. import React from 'react';
  2. import { connect } from 'react-redux';
  3. import { translate } from '../../../base/i18n/functions';
  4. import { IconVideoOff } from '../../../base/icons/svg';
  5. import ContextMenuItem from '../../../base/ui/components/web/ContextMenuItem';
  6. import AbstractMuteVideoButton, { IProps, _mapStateToProps } from '../AbstractMuteVideoButton';
  7. /**
  8. * Implements a React {@link Component} which displays a button for disabling
  9. * the camera of a participant in the conference.
  10. *
  11. * NOTE: At the time of writing this is a button that doesn't use the
  12. * {@code AbstractButton} base component, but is inherited from the same
  13. * super class ({@code AbstractMuteVideoButton} that extends {@code AbstractButton})
  14. * for the sake of code sharing between web and mobile. Once web uses the
  15. * {@code AbstractButton} base component, this can be fully removed.
  16. */
  17. class MuteVideoButton extends AbstractMuteVideoButton {
  18. /**
  19. * Instantiates a new {@code Component}.
  20. *
  21. * @inheritdoc
  22. */
  23. constructor(props: IProps) {
  24. super(props);
  25. this._handleClick = this._handleClick.bind(this);
  26. }
  27. /**
  28. * Implements React's {@link Component#render()}.
  29. *
  30. * @inheritdoc
  31. * @returns {ReactElement}
  32. */
  33. render() {
  34. const { _videoTrackMuted, t } = this.props;
  35. if (_videoTrackMuted) {
  36. return null;
  37. }
  38. return (
  39. <ContextMenuItem
  40. accessibilityLabel = { t('participantsPane.actions.stopVideo') }
  41. className = 'mutevideolink'
  42. icon = { IconVideoOff }
  43. // eslint-disable-next-line react/jsx-handler-names
  44. onClick = { this._handleClick }
  45. text = { t('participantsPane.actions.stopVideo') } />
  46. );
  47. }
  48. _handleClick: () => void;
  49. }
  50. export default translate(connect(_mapStateToProps)(MuteVideoButton));