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.
This commit is contained in:
Saúl Ibarra Corretgé 2019-06-11 12:40:08 +02:00 committed by Saúl Ibarra Corretgé
parent 431a221c63
commit 4ddfcaf584
1 changed files with 11 additions and 16 deletions

View File

@ -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 }));
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.