2017-09-27 21:23:31 +00:00
|
|
|
import PropTypes from 'prop-types';
|
2017-08-09 19:40:03 +00:00
|
|
|
import React, { Component } from 'react';
|
|
|
|
|
2017-09-20 20:38:07 +00:00
|
|
|
import { ToolbarButtonWithDialog } from '../../toolbox';
|
2017-08-09 19:40:03 +00:00
|
|
|
|
2017-09-27 21:23:31 +00:00
|
|
|
import { VideoQualityDialog } from './';
|
|
|
|
|
2017-09-20 20:38:07 +00:00
|
|
|
/**
|
|
|
|
* A configuration object to describe how {@code ToolbarButton} should render
|
|
|
|
* the button.
|
|
|
|
*
|
|
|
|
* @type {object}
|
|
|
|
*/
|
2017-08-09 19:40:03 +00:00
|
|
|
const DEFAULT_BUTTON_CONFIGURATION = {
|
|
|
|
buttonName: 'videoquality',
|
|
|
|
classNames: [ 'button', 'icon-visibility' ],
|
|
|
|
enabled: true,
|
|
|
|
id: 'toolbar_button_videoquality',
|
|
|
|
tooltipKey: 'videoStatus.qualityButtonTip'
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
2017-09-20 20:38:07 +00:00
|
|
|
* React {@code Component} for displaying a button which will open an inline
|
|
|
|
* dialog for changing received video quality settings.
|
2017-08-09 19:40:03 +00:00
|
|
|
*
|
|
|
|
* @extends Component
|
|
|
|
*/
|
|
|
|
class VideoQualityButton extends Component {
|
|
|
|
/**
|
|
|
|
* {@code VideoQualityButton}'s property types.
|
|
|
|
*
|
|
|
|
* @static
|
|
|
|
*/
|
|
|
|
static propTypes = {
|
|
|
|
/**
|
|
|
|
* From which side tooltips should display. Will be re-used for
|
|
|
|
* displaying the inline dialog for video quality adjustment.
|
|
|
|
*/
|
2017-09-27 21:23:31 +00:00
|
|
|
tooltipPosition: PropTypes.string
|
2017-08-09 19:40:03 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Implements React's {@link Component#render()}.
|
|
|
|
*
|
|
|
|
* @inheritdoc
|
|
|
|
* @returns {ReactElement}
|
|
|
|
*/
|
|
|
|
render() {
|
|
|
|
return (
|
2017-09-20 20:38:07 +00:00
|
|
|
<ToolbarButtonWithDialog
|
|
|
|
button = { DEFAULT_BUTTON_CONFIGURATION }
|
|
|
|
content = { VideoQualityDialog }
|
|
|
|
tooltipPosition = { this.props.tooltipPosition } />
|
2017-08-09 19:40:03 +00:00
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-09-20 20:38:07 +00:00
|
|
|
export default VideoQualityButton;
|