2023-06-29 14:59:12 +03:00
|
|
|
import { connect } from 'react-redux';
|
|
|
|
|
|
|
|
|
|
import { createToolbarEvent } from '../../analytics/AnalyticsEvents';
|
|
|
|
|
import { sendAnalytics } from '../../analytics/functions';
|
|
|
|
|
import { openDialog } from '../../base/dialog/actions';
|
2023-03-30 11:27:53 +03:00
|
|
|
import { translate } from '../../base/i18n/functions';
|
|
|
|
|
import { IconPerformance } from '../../base/icons/svg';
|
|
|
|
|
import AbstractButton, { IProps as AbstractButtonProps } from '../../base/toolbox/components/AbstractButton';
|
2018-04-11 13:04:40 -07:00
|
|
|
|
2023-06-29 14:59:12 +03:00
|
|
|
import VideoQualityDialog from './VideoQualityDialog.web';
|
|
|
|
|
|
2018-04-11 13:04:40 -07:00
|
|
|
/**
|
|
|
|
|
* The type of the React {@code Component} props of
|
2021-07-08 16:42:07 +03:00
|
|
|
* {@link VideoQualityButton}.
|
2018-04-11 13:04:40 -07:00
|
|
|
*/
|
2023-03-30 11:27:53 +03:00
|
|
|
interface IProps extends AbstractButtonProps {
|
2018-04-11 13:04:40 -07:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Whether or not audio only mode is currently enabled.
|
|
|
|
|
*/
|
2023-03-30 11:27:53 +03:00
|
|
|
_audioOnly: boolean;
|
2018-04-11 13:04:40 -07:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* The currently configured maximum quality resolution to be received from
|
2020-04-27 22:51:40 -04:00
|
|
|
* and sent to remote participants.
|
2018-04-11 13:04:40 -07:00
|
|
|
*/
|
2023-03-30 11:27:53 +03:00
|
|
|
_videoQuality: number;
|
|
|
|
|
}
|
2018-04-11 13:04:40 -07:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* React {@code Component} responsible for displaying a button in the overflow
|
|
|
|
|
* menu of the toolbar, including an icon showing the currently selected
|
|
|
|
|
* max receive quality.
|
|
|
|
|
*
|
2021-11-04 22:10:43 +01:00
|
|
|
* @augments Component
|
2018-04-11 13:04:40 -07:00
|
|
|
*/
|
2023-03-30 11:27:53 +03:00
|
|
|
class VideoQualityButton extends AbstractButton<IProps> {
|
2025-03-12 10:19:11 -05:00
|
|
|
override accessibilityLabel = 'toolbar.accessibilityLabel.callQuality';
|
|
|
|
|
override label = 'videoStatus.performanceSettings';
|
|
|
|
|
override tooltip = 'videoStatus.performanceSettings';
|
|
|
|
|
override icon = IconPerformance;
|
2023-06-29 14:59:12 +03:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Handles clicking the button, and opens the video quality dialog.
|
|
|
|
|
*
|
|
|
|
|
* @private
|
|
|
|
|
* @returns {void}
|
|
|
|
|
*/
|
2025-03-12 10:19:11 -05:00
|
|
|
override _handleClick() {
|
2023-06-29 14:59:12 +03:00
|
|
|
const { dispatch } = this.props;
|
|
|
|
|
|
|
|
|
|
sendAnalytics(createToolbarEvent('video.quality'));
|
|
|
|
|
|
2025-11-06 09:49:30 -06:00
|
|
|
dispatch(openDialog('VideoQualityDialog', VideoQualityDialog));
|
2023-06-29 14:59:12 +03:00
|
|
|
}
|
2018-04-11 13:04:40 -07:00
|
|
|
}
|
|
|
|
|
|
2023-06-29 14:59:12 +03:00
|
|
|
export default connect()(translate(VideoQualityButton));
|