From cd57477b6822a45d9d33852f56000dafa66fb65d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sa=C3=BAl=20Ibarra=20Corretg=C3=A9?= Date: Tue, 15 May 2018 10:45:49 +0200 Subject: [PATCH] feat(toolbox): restore emitting UI events for legacy code --- react/features/toolbox/components/AudioMuteButton.js | 6 ++++++ react/features/toolbox/components/VideoMuteButton.js | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/react/features/toolbox/components/AudioMuteButton.js b/react/features/toolbox/components/AudioMuteButton.js index 9d4b1ad76..a1b8c6fd3 100644 --- a/react/features/toolbox/components/AudioMuteButton.js +++ b/react/features/toolbox/components/AudioMuteButton.js @@ -14,6 +14,7 @@ import { MEDIA_TYPE, setAudioMuted } from '../../base/media'; import { AbstractAudioMuteButton } from '../../base/toolbox'; import type { AbstractButtonProps } from '../../base/toolbox'; import { isLocalTrackMuted } from '../../base/tracks'; +import UIEvents from '../../../../service/UI/UIEvents'; declare var APP: Object; @@ -121,6 +122,11 @@ class AudioMuteButton extends AbstractAudioMuteButton { _setAudioMuted(audioMuted: boolean) { sendAnalytics(createToolbarEvent(AUDIO_MUTE, { enable: audioMuted })); this.props.dispatch(setAudioMuted(audioMuted)); + + // FIXME: The old conference logic as well as the shared video feature + // still rely on this event being emitted. + typeof APP === 'undefined' + || APP.UI.emitEvent(UIEvents.AUDIO_MUTED, audioMuted, true); } } diff --git a/react/features/toolbox/components/VideoMuteButton.js b/react/features/toolbox/components/VideoMuteButton.js index 92f27c34a..e15370253 100644 --- a/react/features/toolbox/components/VideoMuteButton.js +++ b/react/features/toolbox/components/VideoMuteButton.js @@ -18,6 +18,7 @@ import { import { AbstractVideoMuteButton } from '../../base/toolbox'; import type { AbstractButtonProps } from '../../base/toolbox'; import { isLocalTrackMuted } from '../../base/tracks'; +import UIEvents from '../../../../service/UI/UIEvents'; declare var APP: Object; @@ -146,6 +147,11 @@ class VideoMuteButton extends AbstractVideoMuteButton { videoMuted, VIDEO_MUTISM_AUTHORITY.USER, /* ensureTrack */ true)); + + // FIXME: The old conference logic still relies on this event being + // emitted. + typeof APP === 'undefined' + || APP.UI.emitEvent(UIEvents.VIDEO_MUTED, videoMuted, true); } }