From 4ddfcaf584395130929d9e1b833fc76f16c98f25 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sa=C3=BAl=20Ibarra=20Corretg=C3=A9?= Date: Tue, 11 Jun 2019 12:40:08 +0200 Subject: [PATCH] toolbox: disable audio-mode when video-unmuting If audio-only was engaged, use the video (un)mute button to disengage it. This should simplify the flow for getting back to video. --- .../toolbox/components/VideoMuteButton.js | 27 ++++++++----------- 1 file changed, 11 insertions(+), 16 deletions(-) diff --git a/react/features/toolbox/components/VideoMuteButton.js b/react/features/toolbox/components/VideoMuteButton.js index 7cf6cab19..14a744cfa 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 { || 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 { */ _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.