Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

VideoQualityButton.web.ts 1.7KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. import { connect } from 'react-redux';
  2. import { createToolbarEvent } from '../../analytics/AnalyticsEvents';
  3. import { sendAnalytics } from '../../analytics/functions';
  4. import { openDialog } from '../../base/dialog/actions';
  5. import { translate } from '../../base/i18n/functions';
  6. import { IconPerformance } from '../../base/icons/svg';
  7. import AbstractButton, { IProps as AbstractButtonProps } from '../../base/toolbox/components/AbstractButton';
  8. import VideoQualityDialog from './VideoQualityDialog.web';
  9. /**
  10. * The type of the React {@code Component} props of
  11. * {@link VideoQualityButton}.
  12. */
  13. interface IProps extends AbstractButtonProps {
  14. /**
  15. * Whether or not audio only mode is currently enabled.
  16. */
  17. _audioOnly: boolean;
  18. /**
  19. * The currently configured maximum quality resolution to be received from
  20. * and sent to remote participants.
  21. */
  22. _videoQuality: number;
  23. }
  24. /**
  25. * React {@code Component} responsible for displaying a button in the overflow
  26. * menu of the toolbar, including an icon showing the currently selected
  27. * max receive quality.
  28. *
  29. * @augments Component
  30. */
  31. class VideoQualityButton extends AbstractButton<IProps> {
  32. accessibilityLabel = 'toolbar.accessibilityLabel.callQuality';
  33. label = 'videoStatus.performanceSettings';
  34. tooltip = 'videoStatus.performanceSettings';
  35. icon = IconPerformance;
  36. /**
  37. * Handles clicking the button, and opens the video quality dialog.
  38. *
  39. * @private
  40. * @returns {void}
  41. */
  42. _handleClick() {
  43. const { dispatch } = this.props;
  44. sendAnalytics(createToolbarEvent('video.quality'));
  45. dispatch(openDialog(VideoQualityDialog));
  46. }
  47. }
  48. export default connect()(translate(VideoQualityButton));