瀏覽代碼

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.
master
Saúl Ibarra Corretgé 6 年之前
父節點
當前提交
4ddfcaf584
共有 1 個檔案被更改,包括 11 行新增16 行删除
  1. 11
    16
      react/features/toolbox/components/VideoMuteButton.js

+ 11
- 16
react/features/toolbox/components/VideoMuteButton.js 查看文件

@@ -7,6 +7,7 @@ import {
7 7
     createToolbarEvent,
8 8
     sendAnalytics
9 9
 } from '../../analytics';
10
+import { setAudioOnly } from '../../base/conference';
10 11
 import { translate } from '../../base/i18n';
11 12
 import {
12 13
     MEDIA_TYPE,
@@ -91,17 +92,6 @@ class VideoMuteButton extends AbstractVideoMuteButton<Props, *> {
91 92
             || APP.keyboardshortcut.unregisterShortcut('V');
92 93
     }
93 94
 
94
-    /**
95
-     * Indicates if this button should be disabled or not.
96
-     *
97
-     * @override
98
-     * @protected
99
-     * @returns {boolean}
100
-     */
101
-    _isDisabled() {
102
-        return this.props._audioOnly;
103
-    }
104
-
105 95
     /**
106 96
      * Indicates if video is currently muted ot nor.
107 97
      *
@@ -142,11 +132,16 @@ class VideoMuteButton extends AbstractVideoMuteButton<Props, *> {
142 132
      */
143 133
     _setVideoMuted(videoMuted: boolean) {
144 134
         sendAnalytics(createToolbarEvent(VIDEO_MUTE, { enable: videoMuted }));
145
-        this.props.dispatch(
146
-            setVideoMuted(
147
-                videoMuted,
148
-                VIDEO_MUTISM_AUTHORITY.USER,
149
-                /* ensureTrack */ true));
135
+        if (this.props._audioOnly) {
136
+            this.props.dispatch(
137
+                setAudioOnly(false, /* ensureTrack */ true));
138
+        } else {
139
+            this.props.dispatch(
140
+                setVideoMuted(
141
+                    videoMuted,
142
+                    VIDEO_MUTISM_AUTHORITY.USER,
143
+                    /* ensureTrack */ true));
144
+        }
150 145
 
151 146
         // FIXME: The old conference logic still relies on this event being
152 147
         // emitted.

Loading…
取消
儲存