mirror of
https://gitcode.com/GitHub_Trending/ji/jitsi-meet.git
synced 2025-12-30 11:22:31 +00:00
feat(external-api) add function to change virtual backgrounds
This commit is contained in:
@@ -122,7 +122,8 @@ import { isAudioMuteButtonDisabled } from '../../react/features/toolbox/function
|
||||
import { setTileView, toggleTileView } from '../../react/features/video-layout/actions.any';
|
||||
import { muteAllParticipants } from '../../react/features/video-menu/actions';
|
||||
import { setVideoQuality } from '../../react/features/video-quality/actions';
|
||||
import { toggleBlurredBackgroundEffect } from '../../react/features/virtual-background/actions';
|
||||
import { toggleBackgroundEffect, toggleBlurredBackgroundEffect } from '../../react/features/virtual-background/actions';
|
||||
import { VIRTUAL_BACKGROUND_TYPE } from '../../react/features/virtual-background/constants';
|
||||
import { toggleWhiteboard } from '../../react/features/whiteboard/actions.web';
|
||||
import { getJitsiMeetTransport } from '../transport';
|
||||
|
||||
@@ -871,6 +872,16 @@ function initCommands() {
|
||||
},
|
||||
'toggle-whiteboard': () => {
|
||||
APP.store.dispatch(toggleWhiteboard());
|
||||
},
|
||||
'set-virtual-background': (enabled, backgroundImage) => {
|
||||
const tracks = APP.store.getState()['features/base/tracks'];
|
||||
const jitsiTrack = getLocalVideoTrack(tracks)?.jitsiTrack;
|
||||
|
||||
APP.store.dispatch(toggleBackgroundEffect({
|
||||
backgroundEffectEnabled: enabled,
|
||||
backgroundType: VIRTUAL_BACKGROUND_TYPE.IMAGE,
|
||||
virtualSource: backgroundImage
|
||||
}, jitsiTrack));
|
||||
}
|
||||
};
|
||||
transport.on('event', ({ data, name }) => {
|
||||
|
||||
Reference in New Issue
Block a user