浏览代码

feat(toolbox): restore emitting UI events for legacy code

j8
Saúl Ibarra Corretgé 7 年前
父节点
当前提交
cd57477b68

+ 6
- 0
react/features/toolbox/components/AudioMuteButton.js 查看文件

@@ -14,6 +14,7 @@ import { MEDIA_TYPE, setAudioMuted } from '../../base/media';
14 14
 import { AbstractAudioMuteButton } from '../../base/toolbox';
15 15
 import type { AbstractButtonProps } from '../../base/toolbox';
16 16
 import { isLocalTrackMuted } from '../../base/tracks';
17
+import UIEvents from '../../../../service/UI/UIEvents';
17 18
 
18 19
 declare var APP: Object;
19 20
 
@@ -121,6 +122,11 @@ class AudioMuteButton extends AbstractAudioMuteButton<Props, *> {
121 122
     _setAudioMuted(audioMuted: boolean) {
122 123
         sendAnalytics(createToolbarEvent(AUDIO_MUTE, { enable: audioMuted }));
123 124
         this.props.dispatch(setAudioMuted(audioMuted));
125
+
126
+        // FIXME: The old conference logic as well as the shared video feature
127
+        // still rely on this event being emitted.
128
+        typeof APP === 'undefined'
129
+            || APP.UI.emitEvent(UIEvents.AUDIO_MUTED, audioMuted, true);
124 130
     }
125 131
 }
126 132
 

+ 6
- 0
react/features/toolbox/components/VideoMuteButton.js 查看文件

@@ -18,6 +18,7 @@ import {
18 18
 import { AbstractVideoMuteButton } from '../../base/toolbox';
19 19
 import type { AbstractButtonProps } from '../../base/toolbox';
20 20
 import { isLocalTrackMuted } from '../../base/tracks';
21
+import UIEvents from '../../../../service/UI/UIEvents';
21 22
 
22 23
 declare var APP: Object;
23 24
 
@@ -146,6 +147,11 @@ class VideoMuteButton extends AbstractVideoMuteButton<Props, *> {
146 147
                 videoMuted,
147 148
                 VIDEO_MUTISM_AUTHORITY.USER,
148 149
                 /* ensureTrack */ true));
150
+
151
+        // FIXME: The old conference logic still relies on this event being
152
+        // emitted.
153
+        typeof APP === 'undefined'
154
+            || APP.UI.emitEvent(UIEvents.VIDEO_MUTED, videoMuted, true);
149 155
     }
150 156
 }
151 157
 

正在加载...
取消
保存