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.

VideoQualityButton.web.js 1.5KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. import PropTypes from 'prop-types';
  2. import React, { Component } from 'react';
  3. import { ToolbarButtonWithDialog } from '../../toolbox';
  4. import { VideoQualityDialog } from './';
  5. /**
  6. * A configuration object to describe how {@code ToolbarButton} should render
  7. * the button.
  8. *
  9. * @type {object}
  10. */
  11. const DEFAULT_BUTTON_CONFIGURATION = {
  12. buttonName: 'videoquality',
  13. classNames: [ 'button', 'icon-visibility' ],
  14. enabled: true,
  15. id: 'toolbar_button_videoquality',
  16. tooltipKey: 'videoStatus.qualityButtonTip'
  17. };
  18. /**
  19. * React {@code Component} for displaying a button which will open an inline
  20. * dialog for changing received video quality settings.
  21. *
  22. * @extends Component
  23. */
  24. class VideoQualityButton extends Component {
  25. /**
  26. * {@code VideoQualityButton}'s property types.
  27. *
  28. * @static
  29. */
  30. static propTypes = {
  31. /**
  32. * From which side tooltips should display. Will be re-used for
  33. * displaying the inline dialog for video quality adjustment.
  34. */
  35. tooltipPosition: PropTypes.string
  36. };
  37. /**
  38. * Implements React's {@link Component#render()}.
  39. *
  40. * @inheritdoc
  41. * @returns {ReactElement}
  42. */
  43. render() {
  44. return (
  45. <ToolbarButtonWithDialog
  46. button = { DEFAULT_BUTTON_CONFIGURATION }
  47. content = { VideoQualityDialog }
  48. tooltipPosition = { this.props.tooltipPosition } />
  49. );
  50. }
  51. }
  52. export default VideoQualityButton;