fix(blur) disable blur button if camera is off
This commit is contained in:
parent
cecf324023
commit
cc0ecc1fdd
|
@ -6,6 +6,7 @@ import { IconBlurBackground } from '../../base/icons';
|
||||||
import { connect } from '../../base/redux';
|
import { connect } from '../../base/redux';
|
||||||
import { AbstractButton } from '../../base/toolbox/components';
|
import { AbstractButton } from '../../base/toolbox/components';
|
||||||
import type { AbstractButtonProps } from '../../base/toolbox/components';
|
import type { AbstractButtonProps } from '../../base/toolbox/components';
|
||||||
|
import { isLocalCameraTrackMuted } from '../../base/tracks';
|
||||||
import { toggleBlurEffect } from '../actions';
|
import { toggleBlurEffect } from '../actions';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -18,6 +19,11 @@ type Props = AbstractButtonProps & {
|
||||||
*/
|
*/
|
||||||
_isVideoBlurred: boolean,
|
_isVideoBlurred: boolean,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Whether video is currently muted or not.
|
||||||
|
*/
|
||||||
|
_videoMuted: boolean,
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The redux {@code dispatch} function.
|
* The redux {@code dispatch} function.
|
||||||
*/
|
*/
|
||||||
|
@ -60,6 +66,17 @@ class VideoBlurButton extends AbstractButton<Props, *> {
|
||||||
_isToggled() {
|
_isToggled() {
|
||||||
return this.props._isVideoBlurred;
|
return this.props._isVideoBlurred;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns {@code boolean} value indicating if disabled state is
|
||||||
|
* enabled or not.
|
||||||
|
*
|
||||||
|
* @protected
|
||||||
|
* @returns {boolean}
|
||||||
|
*/
|
||||||
|
_isDisabled() {
|
||||||
|
return this.props._videoMuted;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -73,9 +90,13 @@ class VideoBlurButton extends AbstractButton<Props, *> {
|
||||||
* }}
|
* }}
|
||||||
*/
|
*/
|
||||||
function _mapStateToProps(state): Object {
|
function _mapStateToProps(state): Object {
|
||||||
|
const tracks = state['features/base/tracks'];
|
||||||
|
|
||||||
return {
|
return {
|
||||||
_isVideoBlurred: Boolean(state['features/blur'].blurEnabled)
|
_isVideoBlurred: Boolean(state['features/blur'].blurEnabled),
|
||||||
|
_videoMuted: isLocalCameraTrackMuted(tracks)
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
export default translate(connect(_mapStateToProps)(VideoBlurButton));
|
export default translate(connect(_mapStateToProps)(VideoBlurButton));
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue