2021-02-24 21:45:07 +00:00
|
|
|
/* @flow */
|
|
|
|
|
|
|
|
import React from 'react';
|
|
|
|
|
|
|
|
import { translate } from '../../../base/i18n';
|
2021-12-15 13:18:41 +00:00
|
|
|
import { IconVideoOff } from '../../../base/icons';
|
2021-02-24 21:45:07 +00:00
|
|
|
import { connect } from '../../../base/redux';
|
2022-10-06 10:09:40 +00:00
|
|
|
import ContextMenuItem from '../../../base/ui/components/web/ContextMenuItem';
|
2021-02-24 21:45:07 +00:00
|
|
|
import AbstractMuteVideoButton, {
|
2022-09-27 07:10:28 +00:00
|
|
|
type Props,
|
|
|
|
_mapStateToProps
|
2021-02-24 21:45:07 +00:00
|
|
|
} from '../AbstractMuteVideoButton';
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Implements a React {@link Component} which displays a button for disabling
|
|
|
|
* the camera of a participant in the conference.
|
|
|
|
*
|
|
|
|
* NOTE: At the time of writing this is a button that doesn't use the
|
|
|
|
* {@code AbstractButton} base component, but is inherited from the same
|
|
|
|
* super class ({@code AbstractMuteVideoButton} that extends {@code AbstractButton})
|
|
|
|
* for the sake of code sharing between web and mobile. Once web uses the
|
|
|
|
* {@code AbstractButton} base component, this can be fully removed.
|
|
|
|
*/
|
|
|
|
class MuteVideoButton extends AbstractMuteVideoButton {
|
|
|
|
/**
|
|
|
|
* Instantiates a new {@code Component}.
|
|
|
|
*
|
|
|
|
* @inheritdoc
|
|
|
|
*/
|
|
|
|
constructor(props: Props) {
|
|
|
|
super(props);
|
|
|
|
|
|
|
|
this._handleClick = this._handleClick.bind(this);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Implements React's {@link Component#render()}.
|
|
|
|
*
|
|
|
|
* @inheritdoc
|
|
|
|
* @returns {ReactElement}
|
|
|
|
*/
|
|
|
|
render() {
|
2021-12-15 13:18:41 +00:00
|
|
|
const { _videoTrackMuted, t } = this.props;
|
|
|
|
|
|
|
|
if (_videoTrackMuted) {
|
|
|
|
return null;
|
|
|
|
}
|
2021-02-24 21:45:07 +00:00
|
|
|
|
|
|
|
return (
|
2021-12-15 13:18:41 +00:00
|
|
|
<ContextMenuItem
|
|
|
|
accessibilityLabel = { t('participantsPane.actions.stopVideo') }
|
|
|
|
className = 'mutevideolink'
|
|
|
|
icon = { IconVideoOff }
|
2021-02-24 21:45:07 +00:00
|
|
|
// eslint-disable-next-line react/jsx-handler-names
|
2021-12-15 13:18:41 +00:00
|
|
|
onClick = { this._handleClick }
|
|
|
|
text = { t('participantsPane.actions.stopVideo') } />
|
2021-02-24 21:45:07 +00:00
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2021-11-04 21:10:43 +00:00
|
|
|
_handleClick: () => void;
|
2021-02-24 21:45:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export default translate(connect(_mapStateToProps)(MuteVideoButton));
|