Skip to content

Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.

fix(RN): broken build after AV pending changes.

Hristo Terezov70be08212d97
diff --git a/react/features/base/toolbox/components/AbstractAudioMuteButton.ts b/react/features/base/toolbox/components/BaseAudioMuteButton.ts
similarity index 95%
rename from react/features/base/toolbox/components/AbstractAudioMuteButton.ts
rename to react/features/base/toolbox/components/BaseAudioMuteButton.ts
index bf8db80d94..66bbba3adc 100644
--- a/react/features/base/toolbox/components/AbstractAudioMuteButton.ts
+++ b/react/features/base/toolbox/components/BaseAudioMuteButton.ts
@@ -5,7 +5,7 @@ import AbstractButton, { IProps } from './AbstractButton';
/**
* An abstract implementation of a button for toggling audio mute.
*/
-export default class AbstractAudioMuteButton<P extends IProps, S=any>
+export default class BaseAudioMuteButton<P extends IProps, S=any>
extends AbstractButton<P, S> {
icon = IconMic;
diff --git a/react/features/base/toolbox/components/AbstractVideoMuteButton.ts b/react/features/base/toolbox/components/BaseVideoMuteButton.ts
similarity index 95%
rename from react/features/base/toolbox/components/AbstractVideoMuteButton.ts
rename to react/features/base/toolbox/components/BaseVideoMuteButton.ts
index 36e3f806f0..1bdbfced61 100644
--- a/react/features/base/toolbox/components/AbstractVideoMuteButton.ts
+++ b/react/features/base/toolbox/components/BaseVideoMuteButton.ts
@@ -5,7 +5,7 @@ import AbstractButton, { IProps } from './AbstractButton';
/**
* An abstract implementation of a button for toggling video mute.
*/
-export default class AbstractVideoMuteButton<P extends IProps, S=any>
+export default class BaseVideoMuteButton<P extends IProps, S=any>
extends AbstractButton<P, S> {
icon = IconVideo;
diff --git a/react/features/lobby/components/native/LobbyScreen.tsx b/react/features/lobby/components/native/LobbyScreen.tsx
index 0f7d8abe93..41974ed518 100644
--- a/react/features/lobby/components/native/LobbyScreen.tsx
+++ b/react/features/lobby/components/native/LobbyScreen.tsx
@@ -18,8 +18,8 @@ import { navigate }
from '../../../mobile/navigation/components/lobby/LobbyNavigationContainerRef';
import { screen } from '../../../mobile/navigation/routes';
import { preJoinStyles } from '../../../prejoin/components/native/styles';
-import AudioMuteButton from '../../../toolbox/components/AudioMuteButton';
-import VideoMuteButton from '../../../toolbox/components/VideoMuteButton';
+import AudioMuteButton from '../../../toolbox/components/native/AudioMuteButton';
+import VideoMuteButton from '../../../toolbox/components/native/VideoMuteButton';
import AbstractLobbyScreen, {
IProps as AbstractProps,
_mapStateToProps as abstractMapStateToProps } from '../AbstractLobbyScreen';
diff --git a/react/features/prejoin/components/native/Prejoin.tsx b/react/features/prejoin/components/native/Prejoin.tsx
index 7b2e23f490..a688d2cb5e 100644
--- a/react/features/prejoin/components/native/Prejoin.tsx
+++ b/react/features/prejoin/components/native/Prejoin.tsx
@@ -33,8 +33,8 @@ import LargeVideo from '../../../large-video/components/LargeVideo.native';
import HeaderNavigationButton from '../../../mobile/navigation/components/HeaderNavigationButton';
import { navigateRoot } from '../../../mobile/navigation/rootNavigationContainerRef';
import { screen } from '../../../mobile/navigation/routes';
-import AudioMuteButton from '../../../toolbox/components/AudioMuteButton';
-import VideoMuteButton from '../../../toolbox/components/VideoMuteButton';
+import AudioMuteButton from '../../../toolbox/components/native/AudioMuteButton';
+import VideoMuteButton from '../../../toolbox/components/native/VideoMuteButton';
import { isDisplayNameRequired } from '../../functions';
import { IPrejoinProps } from '../../types';
diff --git a/react/features/toolbox/components/AbstractAudioMuteButton.tsx b/react/features/toolbox/components/AbstractAudioMuteButton.tsx
new file mode 100644
index 0000000000..f80a0a2c91
--- /dev/null
+++ b/react/features/toolbox/components/AbstractAudioMuteButton.tsx
@@ -0,0 +1,94 @@
+import { IReduxState } from '../../app/types';
+import { AUDIO_MUTE_BUTTON_ENABLED } from '../../base/flags/constants';
+import { getFeatureFlag } from '../../base/flags/functions';
+import { MEDIA_TYPE } from '../../base/media/constants';
+import { IProps as AbstractButtonProps } from '../../base/toolbox/components/AbstractButton';
+import BaseAudioMuteButton from '../../base/toolbox/components/BaseAudioMuteButton';
+import { isLocalTrackMuted } from '../../base/tracks/functions';
+import { muteLocal } from '../../video-menu/actions';
+import { isAudioMuteButtonDisabled } from '../functions';
+
+
+/**
+ * The type of the React {@code Component} props of {@link AbstractAudioMuteButton}.
+ */
+export interface IProps extends AbstractButtonProps {
+
+
+ /**
+ * Whether audio is currently muted or not.
+ */
+ _audioMuted: boolean;
+
+ /**
+ * Whether the button is disabled.
+ */
+ _disabled: boolean;
+}
+
+/**
+ * Component that renders a toolbar button for toggling audio mute.
+ *
+ * @augments BaseAudioMuteButton
+ */
+export default class AbstractAudioMuteButton<P extends IProps> extends BaseAudioMuteButton<P> {
+ accessibilityLabel = 'toolbar.accessibilityLabel.mute';
+ toggledAccessibilityLabel = 'toolbar.accessibilityLabel.unmute';
+ label = 'toolbar.mute';
+ tooltip = 'toolbar.mute';
+ toggledTooltip = 'toolbar.unmute';
+
+ /**
+ * Indicates if audio is currently muted or not.
+ *
+ * @override
+ * @protected
+ * @returns {boolean}
+ */
+ _isAudioMuted() {
+ return this.props._audioMuted;
+ }
+
+ /**
+ * Changes the muted state.
+ *
+ * @param {boolean} audioMuted - Whether audio should be muted or not.
+ * @protected
+ * @returns {void}
+ */
+ _setAudioMuted(audioMuted: boolean) {
+ this.props.dispatch(muteLocal(audioMuted, MEDIA_TYPE.AUDIO));
+ }
+
+ /**
+ * Return a boolean value indicating if this button is disabled or not.
+ *
+ * @returns {boolean}
+ */
+ _isDisabled() {
+ return this.props._disabled;
+ }
+}
+
+/**
+ * Maps (parts of) the redux state to the associated props for the
+ * {@code AbstractAudioMuteButton} component.
+ *
+ * @param {Object} state - The Redux state.
+ * @private
+ * @returns {{
+ * _audioMuted: boolean,
+ * _disabled: boolean
+ * }}
+ */
+export function mapStateToProps(state: IReduxState) {
+ const _audioMuted = isLocalTrackMuted(state['features/base/tracks'], MEDIA_TYPE.AUDIO);
+ const _disabled = isAudioMuteButtonDisabled(state);
+ const enabledFlag = getFeatureFlag(state, AUDIO_MUTE_BUTTON_ENABLED, true);
+
+ return {
+ _audioMuted,
+ _disabled,
+ visible: enabledFlag
+ };
+}
diff --git a/react/features/toolbox/components/AbstractVideoMuteButton.tsx b/react/features/toolbox/components/AbstractVideoMuteButton.tsx
new file mode 100644
index 0000000000..d6d862ac23
--- /dev/null
+++ b/react/features/toolbox/components/AbstractVideoMuteButton.tsx
@@ -0,0 +1,93 @@
+import { IReduxState } from '../../app/types';
+import { VIDEO_MUTE_BUTTON_ENABLED } from '../../base/flags/constants';
+import { getFeatureFlag } from '../../base/flags/functions';
+import { MEDIA_TYPE } from '../../base/media/constants';
+import { IProps as AbstractButtonProps } from '../../base/toolbox/components/AbstractButton';
+import BaseVideoMuteButton from '../../base/toolbox/components/BaseVideoMuteButton';
+import { isLocalTrackMuted } from '../../base/tracks/functions';
+import { handleToggleVideoMuted } from '../actions.any';
+import { isVideoMuteButtonDisabled } from '../functions';
+
+/**
+ * The type of the React {@code Component} props of {@link AbstractVideoMuteButton}.
+ */
+export interface IProps extends AbstractButtonProps {
+
+ /**
+ * Whether video button is disabled or not.
+ */
+ _videoDisabled: boolean;
+
+ /**
+ * Whether video is currently muted or not.
+ */
+ _videoMuted: boolean;
+}
+
+/**
+ * Component that renders a toolbar button for toggling video mute.
+ *
+ * @augments BaseVideoMuteButton
+ */
+export default class AbstractVideoMuteButton<P extends IProps> extends BaseVideoMuteButton<P> {
+ accessibilityLabel = 'toolbar.accessibilityLabel.videomute';
+ toggledAccessibilityLabel = 'toolbar.accessibilityLabel.videounmute';
+ label = 'toolbar.videomute';
+ tooltip = 'toolbar.videomute';
+ toggledTooltip = 'toolbar.videounmute';
+
+ /**
+ * Indicates if video is currently disabled or not.
+ *
+ * @override
+ * @protected
+ * @returns {boolean}
+ */
+ _isDisabled() {
+ return this.props._videoDisabled;
+ }
+
+ /**
+ * Indicates if video is currently muted or not.
+ *
+ * @override
+ * @protected
+ * @returns {boolean}
+ */
+ _isVideoMuted() {
+ return this.props._videoMuted;
+ }
+
+ /**
+ * Changes the muted state.
+ *
+ * @override
+ * @param {boolean} videoMuted - Whether video should be muted or not.
+ * @protected
+ * @returns {void}
+ */
+ _setVideoMuted(videoMuted: boolean) {
+ this.props.dispatch(handleToggleVideoMuted(videoMuted, true, true));
+ }
+}
+
+/**
+ * Maps (parts of) the redux state to the associated props for the
+ * {@code VideoMuteButton} component.
+ *
+ * @param {Object} state - The Redux state.
+ * @private
+ * @returns {{
+ * _videoMuted: boolean
+ * }}
+ */
+export function mapStateToProps(state: IReduxState) {
+ const tracks = state['features/base/tracks'];
+ const enabledFlag = getFeatureFlag(state, VIDEO_MUTE_BUTTON_ENABLED, true);
+
+ return {
+ _videoDisabled: isVideoMuteButtonDisabled(state),
+ _videoMuted: isLocalTrackMuted(tracks, MEDIA_TYPE.VIDEO),
+ visible: enabledFlag
+ };
+}
diff --git a/react/features/toolbox/components/native/AudioMuteButton.tsx b/react/features/toolbox/components/native/AudioMuteButton.tsx
new file mode 100644
index 0000000000..9aa75fbf75
--- /dev/null
+++ b/react/features/toolbox/components/native/AudioMuteButton.tsx
@@ -0,0 +1,6 @@
+import { connect } from 'react-redux';
+
+import { translate } from '../../../base/i18n/functions';
+import AbstractAudioMuteButton, { IProps, mapStateToProps } from '../AbstractAudioMuteButton';
+
+export default translate(connect(mapStateToProps)(AbstractAudioMuteButton<IProps>));
diff --git a/react/features/toolbox/components/native/Toolbox.tsx b/react/features/toolbox/components/native/Toolbox.tsx
index b63af6c941..6a657db893 100644
--- a/react/features/toolbox/components/native/Toolbox.tsx
+++ b/react/features/toolbox/components/native/Toolbox.tsx
@@ -12,14 +12,14 @@ import { isReactionsEnabled } from '../../../reactions/functions.any';
import TileViewButton from '../../../video-layout/components/TileViewButton';
import { iAmVisitor } from '../../../visitors/functions';
import { getMovableButtons, isToolboxVisible } from '../../functions.native';
-import AudioMuteButton from '../AudioMuteButton';
import HangupButton from '../HangupButton';
-import VideoMuteButton from '../VideoMuteButton';
+import AudioMuteButton from './AudioMuteButton';
import HangupMenuButton from './HangupMenuButton';
import OverflowMenuButton from './OverflowMenuButton';
import RaiseHandButton from './RaiseHandButton';
import ScreenSharingButton from './ScreenSharingButton';
+import VideoMuteButton from './VideoMuteButton';
import styles from './styles';
/**
diff --git a/react/features/toolbox/components/native/VideoMuteButton.tsx b/react/features/toolbox/components/native/VideoMuteButton.tsx
new file mode 100644
index 0000000000..9b92b0e49a
--- /dev/null
+++ b/react/features/toolbox/components/native/VideoMuteButton.tsx
@@ -0,0 +1,7 @@
+import { connect } from 'react-redux';
+
+import { translate } from '../../../base/i18n/functions';
+import AbstractVideoMuteButton, { IProps, mapStateToProps } from '../AbstractVideoMuteButton';
+
+
+export default translate(connect(mapStateToProps)(AbstractVideoMuteButton<IProps>));
diff --git a/react/features/toolbox/components/AudioMuteButton.tsx b/react/features/toolbox/components/web/AudioMuteButton.tsx
similarity index 65%
rename from react/features/toolbox/components/AudioMuteButton.tsx
rename to react/features/toolbox/components/web/AudioMuteButton.tsx
index b501b54ed6..ee115d3e5e 100644
--- a/react/features/toolbox/components/AudioMuteButton.tsx
+++ b/react/features/toolbox/components/web/AudioMuteButton.tsx
@@ -2,22 +2,19 @@ import { ClassNameMap, withStyles } from '@mui/styles';
import React, { ReactElement } from 'react';
import { connect } from 'react-redux';
-import { ACTION_SHORTCUT_TRIGGERED, AUDIO_MUTE, createShortcutEvent } from '../../analytics/AnalyticsEvents';
-import { sendAnalytics } from '../../analytics/functions';
-import { IReduxState } from '../../app/types';
-import { AUDIO_MUTE_BUTTON_ENABLED } from '../../base/flags/constants';
-import { getFeatureFlag } from '../../base/flags/functions';
-import { translate } from '../../base/i18n/functions';
-import { MEDIA_TYPE } from '../../base/media/constants';
-import { IGUMPendingState } from '../../base/media/types';
-import AbstractAudioMuteButton from '../../base/toolbox/components/AbstractAudioMuteButton';
-import AbstractButton, { IProps as AbstractButtonProps } from '../../base/toolbox/components/AbstractButton';
-import { isLocalTrackMuted } from '../../base/tracks/functions';
-import Spinner from '../../base/ui/components/web/Spinner';
-import { registerShortcut, unregisterShortcut } from '../../keyboard-shortcuts/actions';
-import { muteLocal } from '../../video-menu/actions';
-import { SPINNER_COLOR } from '../constants';
-import { isAudioMuteButtonDisabled } from '../functions';
+import { ACTION_SHORTCUT_TRIGGERED, AUDIO_MUTE, createShortcutEvent } from '../../../analytics/AnalyticsEvents';
+import { sendAnalytics } from '../../../analytics/functions';
+import { IReduxState } from '../../../app/types';
+import { translate } from '../../../base/i18n/functions';
+import { IGUMPendingState } from '../../../base/media/types';
+import AbstractButton from '../../../base/toolbox/components/AbstractButton';
+import Spinner from '../../../base/ui/components/web/Spinner';
+import { registerShortcut, unregisterShortcut } from '../../../keyboard-shortcuts/actions';
+import { SPINNER_COLOR } from '../../constants';
+import AbstractAudioMuteButton, {
+ IProps as AbstractAudioMuteButtonProps,
+ mapStateToProps as abstractMapStateToProps
+} from '../AbstractAudioMuteButton';
const styles = () => {
return {
@@ -32,19 +29,9 @@ const styles = () => {
/**
* The type of the React {@code Component} props of {@link AudioMuteButton}.
*/
-interface IProps extends AbstractButtonProps {
+interface IProps extends AbstractAudioMuteButtonProps {
- /**
- * Whether audio is currently muted or not.
- */
- _audioMuted: boolean;
-
- /**
- * Whether the button is disabled.
- */
- _disabled: boolean;
-
/**
* The gumPending state from redux.
*/
@@ -62,11 +49,6 @@ interface IProps extends AbstractButtonProps {
* @augments AbstractAudioMuteButton
*/
class AudioMuteButton extends AbstractAudioMuteButton<IProps> {
- accessibilityLabel = 'toolbar.accessibilityLabel.mute';
- toggledAccessibilityLabel = 'toolbar.accessibilityLabel.unmute';
- label = 'toolbar.mute';
- tooltip = 'toolbar.mute';
- toggledTooltip = 'toolbar.unmute';
/**
* Initializes a new {@code AudioMuteButton} instance.
@@ -89,10 +71,6 @@ class AudioMuteButton extends AbstractAudioMuteButton<IProps> {
* @returns {void}
*/
componentDidMount() {
- if (typeof APP === 'undefined') {
- return;
- }
-
this.props.dispatch(registerShortcut({
character: 'M',
helpDescription: 'keyboardShortcuts.mute',
@@ -107,10 +85,6 @@ class AudioMuteButton extends AbstractAudioMuteButton<IProps> {
* @returns {void}
*/
componentWillUnmount() {
- if (typeof APP === 'undefined') {
- return;
- }
-
this.props.dispatch(unregisterShortcut('M'));
}
@@ -159,13 +133,11 @@ class AudioMuteButton extends AbstractAudioMuteButton<IProps> {
* @returns {boolean}
*/
_isAudioMuted() {
- const { _audioMuted, _gumPending } = this.props;
-
- if (_gumPending === IGUMPendingState.PENDING_UNMUTE) {
+ if (this.props._gumPending === IGUMPendingState.PENDING_UNMUTE) {
return false;
}
- return _audioMuted;
+ return super._isAudioMuted();
}
/**
@@ -207,26 +179,6 @@ class AudioMuteButton extends AbstractAudioMuteButton<IProps> {
</div>
);
}
-
- /**
- * Changes the muted state.
- *
- * @param {boolean} audioMuted - Whether audio should be muted or not.
- * @protected
- * @returns {void}
- */
- _setAudioMuted(audioMuted: boolean) {
- this.props.dispatch(muteLocal(audioMuted, MEDIA_TYPE.AUDIO));
- }
-
- /**
- * Return a boolean value indicating if this button is disabled or not.
- *
- * @returns {boolean}
- */
- _isDisabled() {
- return this.props._disabled;
- }
}
/**
@@ -241,16 +193,11 @@ class AudioMuteButton extends AbstractAudioMuteButton<IProps> {
* }}
*/
function _mapStateToProps(state: IReduxState) {
- const _audioMuted = isLocalTrackMuted(state['features/base/tracks'], MEDIA_TYPE.AUDIO);
- const _disabled = isAudioMuteButtonDisabled(state);
- const enabledFlag = getFeatureFlag(state, AUDIO_MUTE_BUTTON_ENABLED, true);
const { gumPending } = state['features/base/media'].audio;
return {
- _audioMuted,
- _disabled,
- _gumPending: gumPending,
- visible: enabledFlag
+ ...abstractMapStateToProps(state),
+ _gumPending: gumPending
};
}
diff --git a/react/features/toolbox/components/web/AudioSettingsButton.tsx b/react/features/toolbox/components/web/AudioSettingsButton.tsx
index 3e4702b9bd..f8c67eab84 100644
--- a/react/features/toolbox/components/web/AudioSettingsButton.tsx
+++ b/react/features/toolbox/components/web/AudioSettingsButton.tsx
@@ -13,7 +13,8 @@ import { toggleAudioSettings } from '../../../settings/actions';
import AudioSettingsPopup from '../../../settings/components/web/audio/AudioSettingsPopup';
import { getAudioSettingsVisibility } from '../../../settings/functions';
import { isAudioSettingsButtonDisabled } from '../../functions';
-import AudioMuteButton from '../AudioMuteButton';
+
+import AudioMuteButton from './AudioMuteButton';
interface IProps extends WithTranslation {
diff --git a/react/features/toolbox/components/VideoMuteButton.tsx b/react/features/toolbox/components/web/VideoMuteButton.tsx
similarity index 63%
rename from react/features/toolbox/components/VideoMuteButton.tsx
rename to react/features/toolbox/components/web/VideoMuteButton.tsx
index bc9c160154..57cb8f3b02 100644
--- a/react/features/toolbox/components/VideoMuteButton.tsx
+++ b/react/features/toolbox/components/web/VideoMuteButton.tsx
@@ -2,22 +2,19 @@ import { ClassNameMap, withStyles } from '@mui/styles';
import React, { ReactElement } from 'react';
import { connect } from 'react-redux';
-import { ACTION_SHORTCUT_TRIGGERED, VIDEO_MUTE, createShortcutEvent } from '../../analytics/AnalyticsEvents';
-import { sendAnalytics } from '../../analytics/functions';
-import { IReduxState } from '../../app/types';
-import { VIDEO_MUTE_BUTTON_ENABLED } from '../../base/flags/constants';
-import { getFeatureFlag } from '../../base/flags/functions';
-import { translate } from '../../base/i18n/functions';
-import { MEDIA_TYPE } from '../../base/media/constants';
-import { IGUMPendingState } from '../../base/media/types';
-import AbstractButton, { IProps as AbstractButtonProps } from '../../base/toolbox/components/AbstractButton';
-import AbstractVideoMuteButton from '../../base/toolbox/components/AbstractVideoMuteButton';
-import { isLocalTrackMuted } from '../../base/tracks/functions';
-import Spinner from '../../base/ui/components/web/Spinner';
-import { registerShortcut, unregisterShortcut } from '../../keyboard-shortcuts/actions';
-import { handleToggleVideoMuted } from '../actions.any';
-import { SPINNER_COLOR } from '../constants';
-import { isVideoMuteButtonDisabled } from '../functions';
+import { ACTION_SHORTCUT_TRIGGERED, VIDEO_MUTE, createShortcutEvent } from '../../../analytics/AnalyticsEvents';
+import { sendAnalytics } from '../../../analytics/functions';
+import { IReduxState } from '../../../app/types';
+import { translate } from '../../../base/i18n/functions';
+import { IGUMPendingState } from '../../../base/media/types';
+import AbstractButton from '../../../base/toolbox/components/AbstractButton';
+import Spinner from '../../../base/ui/components/web/Spinner';
+import { registerShortcut, unregisterShortcut } from '../../../keyboard-shortcuts/actions';
+import { SPINNER_COLOR } from '../../constants';
+import AbstractVideoMuteButton, {
+ IProps as AbstractVideoMuteButtonProps,
+ mapStateToProps as abstractMapStateToProps
+} from '../AbstractVideoMuteButton';
const styles = () => {
return {
@@ -32,23 +29,13 @@ const styles = () => {
/**
* The type of the React {@code Component} props of {@link VideoMuteButton}.
*/
-interface IProps extends AbstractButtonProps {
+export interface IProps extends AbstractVideoMuteButtonProps {
/**
* The gumPending state from redux.
*/
_gumPending: IGUMPendingState;
- /**
- * Whether video button is disabled or not.
- */
- _videoDisabled: boolean;
-
- /**
- * Whether video is currently muted or not.
- */
- _videoMuted: boolean;
-
/**
* The @mui/styles classes.
*/
@@ -61,11 +48,6 @@ interface IProps extends AbstractButtonProps {
* @augments AbstractVideoMuteButton
*/
class VideoMuteButton extends AbstractVideoMuteButton<IProps> {
- accessibilityLabel = 'toolbar.accessibilityLabel.videomute';
- toggledAccessibilityLabel = 'toolbar.accessibilityLabel.videounmute';
- label = 'toolbar.videomute';
- tooltip = 'toolbar.videomute';
- toggledTooltip = 'toolbar.videounmute';
/**
* Initializes a new {@code VideoMuteButton} instance.
@@ -88,10 +70,6 @@ class VideoMuteButton extends AbstractVideoMuteButton<IProps> {
* @returns {void}
*/
componentDidMount() {
- if (typeof APP === 'undefined') {
- return;
- }
-
this.props.dispatch(registerShortcut({
character: 'V',
helpDescription: 'keyboardShortcuts.videoMute',
@@ -106,10 +84,6 @@ class VideoMuteButton extends AbstractVideoMuteButton<IProps> {
* @returns {void}
*/
componentWillUnmount() {
- if (typeof APP === 'undefined') {
- return;
- }
-
this.props.dispatch(unregisterShortcut('V'));
}
@@ -150,17 +124,6 @@ class VideoMuteButton extends AbstractVideoMuteButton<IProps> {
return 'toolbar.videomuteGUMPending';
}
- /**
- * Indicates if video is currently disabled or not.
- *
- * @override
- * @protected
- * @returns {boolean}
- */
- _isDisabled() {
- return this.props._videoDisabled || this.props._gumPending !== IGUMPendingState.NONE;
- }
-
/**
* Indicates if video is currently muted or not.
*
@@ -169,13 +132,11 @@ class VideoMuteButton extends AbstractVideoMuteButton<IProps> {
* @returns {boolean}
*/
_isVideoMuted() {
- const { _gumPending, _videoMuted } = this.props;
-
- if (_gumPending === IGUMPendingState.PENDING_UNMUTE) {
+ if (this.props._gumPending === IGUMPendingState.PENDING_UNMUTE) {
return false;
}
- return _videoMuted;
+ return super._isVideoMuted();
}
/**
@@ -217,18 +178,6 @@ class VideoMuteButton extends AbstractVideoMuteButton<IProps> {
AbstractButton.prototype._onClick.call(this);
}
-
- /**
- * Changes the muted state.
- *
- * @override
- * @param {boolean} videoMuted - Whether video should be muted or not.
- * @protected
- * @returns {void}
- */
- _setVideoMuted(videoMuted: boolean) {
- this.props.dispatch(handleToggleVideoMuted(videoMuted, true, true));
- }
}
/**
@@ -242,15 +191,11 @@ class VideoMuteButton extends AbstractVideoMuteButton<IProps> {
* }}
*/
function _mapStateToProps(state: IReduxState) {
- const tracks = state['features/base/tracks'];
- const enabledFlag = getFeatureFlag(state, VIDEO_MUTE_BUTTON_ENABLED, true);
const { gumPending } = state['features/base/media'].video;
return {
- _videoDisabled: isVideoMuteButtonDisabled(state),
- _videoMuted: isLocalTrackMuted(tracks, MEDIA_TYPE.VIDEO),
- _gumPending: gumPending,
- visible: enabledFlag
+ ...abstractMapStateToProps(state),
+ _gumPending: gumPending
};
}
diff --git a/react/features/toolbox/components/web/VideoSettingsButton.tsx b/react/features/toolbox/components/web/VideoSettingsButton.tsx
index 84604fbe27..4aa7306634 100644
--- a/react/features/toolbox/components/web/VideoSettingsButton.tsx
+++ b/react/features/toolbox/components/web/VideoSettingsButton.tsx
@@ -13,7 +13,8 @@ import { toggleVideoSettings } from '../../../settings/actions';
import VideoSettingsPopup from '../../../settings/components/web/video/VideoSettingsPopup';
import { getVideoSettingsVisibility } from '../../../settings/functions.web';
import { isVideoSettingsButtonDisabled } from '../../functions.web';
-import VideoMuteButton from '../VideoMuteButton';
+
+import VideoMuteButton from './VideoMuteButton';
interface IProps extends WithTranslation {