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

MuteVideoButton.js 1.9KB

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