Skip to content

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

toolbox: disable audio-mode when video-unmuting

Saúl Ibarra Corretgé4ddfcaf58439
diff --git a/react/features/toolbox/components/VideoMuteButton.js b/react/features/toolbox/components/VideoMuteButton.js
index 7cf6cab199..14a744cfab 100644
--- a/react/features/toolbox/components/VideoMuteButton.js
+++ b/react/features/toolbox/components/VideoMuteButton.js
@@ -7,6 +7,7 @@ import {
createToolbarEvent,
sendAnalytics
} from '../../analytics';
+import { setAudioOnly } from '../../base/conference';
import { translate } from '../../base/i18n';
import {
MEDIA_TYPE,
@@ -91,17 +92,6 @@ class VideoMuteButton extends AbstractVideoMuteButton<Props, *> {
|| APP.keyboardshortcut.unregisterShortcut('V');
}
- /**
- * Indicates if this button should be disabled or not.
- *
- * @override
- * @protected
- * @returns {boolean}
- */
- _isDisabled() {
- return this.props._audioOnly;
- }
-
/**
* Indicates if video is currently muted ot nor.
*
@@ -142,11 +132,16 @@ class VideoMuteButton extends AbstractVideoMuteButton<Props, *> {
*/
_setVideoMuted(videoMuted: boolean) {
sendAnalytics(createToolbarEvent(VIDEO_MUTE, { enable: videoMuted }));
- this.props.dispatch(
- setVideoMuted(
- videoMuted,
- VIDEO_MUTISM_AUTHORITY.USER,
- /* ensureTrack */ true));
+ if (this.props._audioOnly) {
+ this.props.dispatch(
+ setAudioOnly(false, /* ensureTrack */ true));
+ } else {
+ this.props.dispatch(
+ setVideoMuted(
+ videoMuted,
+ VIDEO_MUTISM_AUTHORITY.USER,
+ /* ensureTrack */ true));
+ }
// FIXME: The old conference logic still relies on this event being
// emitted.