Skip to content

Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.

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

Saúl Ibarra Corretgécd57477b6822
diff --git a/react/features/toolbox/components/AudioMuteButton.js b/react/features/toolbox/components/AudioMuteButton.js
index 9d4b1ad761..a1b8c6fd38 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<Props, *> {
_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 92f27c34ae..e153702538 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<Props, *> {
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);
}
}