fix(virtual-background): Prevent memory leak when desktop share as a virtual background is applied.
This commit is contained in:
parent
d5f379a97c
commit
52ee9b5151
|
@ -4,6 +4,7 @@ import { VIDEO_TYPE } from '../base/media';
|
|||
import { MiddlewareRegistry } from '../base/redux';
|
||||
import { getLocalVideoTrack } from '../base/tracks';
|
||||
|
||||
import { SET_VIRTUAL_BACKGROUND } from './actionTypes';
|
||||
import { localTrackStopped } from './functions';
|
||||
|
||||
/**
|
||||
|
@ -19,7 +20,7 @@ MiddlewareRegistry.register(store => next => action => {
|
|||
const virtualSource = getState()['features/virtual-background'].virtualSource;
|
||||
const currentLocalTrack = getLocalVideoTrack(getState()['features/base/tracks']);
|
||||
|
||||
if (virtualSource?.videoType === VIDEO_TYPE.DESKTOP) {
|
||||
if (virtualSource?.videoType === VIDEO_TYPE.DESKTOP && action.type === SET_VIRTUAL_BACKGROUND) {
|
||||
localTrackStopped(dispatch, virtualSource, currentLocalTrack?.jitsiTrack);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue