2023-06-09 15:02:00 -05:00
|
|
|
import { connect } from 'react-redux';
|
|
|
|
|
|
2023-11-16 09:28:52 +01:00
|
|
|
import { VIDEO_MUTED_CHANGED } from '../../../base/conference/actionTypes';
|
2023-06-09 15:02:00 -05:00
|
|
|
import { translate } from '../../../base/i18n/functions';
|
|
|
|
|
import AbstractVideoMuteButton, { IProps, mapStateToProps } from '../AbstractVideoMuteButton';
|
|
|
|
|
|
2023-11-16 09:28:52 +01:00
|
|
|
/**
|
|
|
|
|
* Component that renders native toolbar button for toggling video mute.
|
|
|
|
|
*
|
|
|
|
|
* @augments AbstractVideoMuteButton
|
|
|
|
|
*/
|
|
|
|
|
class VideoMuteButton extends AbstractVideoMuteButton<IProps> {
|
|
|
|
|
/**
|
|
|
|
|
* Changes video muted state and dispatches the state to redux.
|
|
|
|
|
*
|
|
|
|
|
* @override
|
|
|
|
|
* @param {boolean} videoMuted - Whether video should be muted or not.
|
|
|
|
|
* @protected
|
|
|
|
|
* @returns {void}
|
|
|
|
|
*/
|
|
|
|
|
_setVideoMuted(videoMuted: boolean) {
|
|
|
|
|
this.props.dispatch?.({
|
|
|
|
|
type: VIDEO_MUTED_CHANGED,
|
|
|
|
|
muted: videoMuted
|
|
|
|
|
});
|
2023-06-09 15:02:00 -05:00
|
|
|
|
2023-11-16 09:28:52 +01:00
|
|
|
super._setVideoMuted(videoMuted);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export default translate(connect(mapStateToProps)(VideoMuteButton));
|