fix(virtual-background): Add logs on virtual background actions.
This commit is contained in:
parent
c5438ecd0c
commit
bb8c30a6c9
|
@ -97,11 +97,7 @@ export default class JitsiStreamBackgroundEffect {
|
||||||
// Draw segmentation mask.
|
// Draw segmentation mask.
|
||||||
|
|
||||||
// Smooth out the edges.
|
// Smooth out the edges.
|
||||||
if (backgroundType === VIRTUAL_BACKGROUND_TYPE.IMAGE) {
|
this._outputCanvasCtx.filter = backgroundType === VIRTUAL_BACKGROUND_TYPE.IMAGE ? 'blur(4px)' : 'blur(8px)';
|
||||||
this._outputCanvasCtx.filter = 'blur(4px)';
|
|
||||||
} else {
|
|
||||||
this._outputCanvasCtx.filter = 'blur(8px)';
|
|
||||||
}
|
|
||||||
if (backgroundType === VIRTUAL_BACKGROUND_TYPE.DESKTOP_SHARE) {
|
if (backgroundType === VIRTUAL_BACKGROUND_TYPE.DESKTOP_SHARE) {
|
||||||
// Save current context before applying transformations.
|
// Save current context before applying transformations.
|
||||||
this._outputCanvasCtx.save();
|
this._outputCanvasCtx.save();
|
||||||
|
|
|
@ -198,6 +198,8 @@ function VirtualBackground({
|
||||||
blurValue: 25,
|
blurValue: 25,
|
||||||
selectedThumbnail: 'blur'
|
selectedThumbnail: 'blur'
|
||||||
});
|
});
|
||||||
|
logger.info('"Blur" option setted for virtual background preview!');
|
||||||
|
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
const enableBlurKeyPress = useCallback(e => {
|
const enableBlurKeyPress = useCallback(e => {
|
||||||
|
@ -214,6 +216,8 @@ function VirtualBackground({
|
||||||
blurValue: 8,
|
blurValue: 8,
|
||||||
selectedThumbnail: 'slight-blur'
|
selectedThumbnail: 'slight-blur'
|
||||||
});
|
});
|
||||||
|
logger.info('"Slight-blur" option setted for virtual background preview!');
|
||||||
|
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
const enableSlideBlurKeyPress = useCallback(e => {
|
const enableSlideBlurKeyPress = useCallback(e => {
|
||||||
|
@ -273,6 +277,7 @@ function VirtualBackground({
|
||||||
dispatch(openDialog(VirtualBackgroundDialog, { initialOptions: newOptions }));
|
dispatch(openDialog(VirtualBackgroundDialog, { initialOptions: newOptions }));
|
||||||
} else {
|
} else {
|
||||||
setOptions(newOptions);
|
setOptions(newOptions);
|
||||||
|
logger.info('"Desktop-share" option setted for virtual background preview!');
|
||||||
}
|
}
|
||||||
}, [ dispatch, options ]);
|
}, [ dispatch, options ]);
|
||||||
|
|
||||||
|
@ -288,6 +293,8 @@ function VirtualBackground({
|
||||||
enabled: false,
|
enabled: false,
|
||||||
selectedThumbnail: 'none'
|
selectedThumbnail: 'none'
|
||||||
});
|
});
|
||||||
|
logger.info('"None" option setted for virtual background preview!');
|
||||||
|
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
const removeBackgroundKeyPress = useCallback(e => {
|
const removeBackgroundKeyPress = useCallback(e => {
|
||||||
|
@ -308,6 +315,7 @@ function VirtualBackground({
|
||||||
url: image.src,
|
url: image.src,
|
||||||
selectedThumbnail: image.id
|
selectedThumbnail: image.id
|
||||||
});
|
});
|
||||||
|
logger.info('Uploaded image setted for virtual background preview!');
|
||||||
}
|
}
|
||||||
}, [ storedImages ]);
|
}, [ storedImages ]);
|
||||||
|
|
||||||
|
@ -324,6 +332,8 @@ function VirtualBackground({
|
||||||
url,
|
url,
|
||||||
selectedThumbnail: image.id
|
selectedThumbnail: image.id
|
||||||
});
|
});
|
||||||
|
logger.info('Image setted for virtual background preview!');
|
||||||
|
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
}
|
}
|
||||||
}, []);
|
}, []);
|
||||||
|
@ -351,6 +361,8 @@ function VirtualBackground({
|
||||||
selectedThumbnail: uuId
|
selectedThumbnail: uuId
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
logger.info('New virtual background image uploaded!');
|
||||||
|
|
||||||
reader.onerror = () => {
|
reader.onerror = () => {
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
logger.error('Failed to upload virtual image!');
|
logger.error('Failed to upload virtual image!');
|
||||||
|
@ -397,6 +409,8 @@ function VirtualBackground({
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
dispatch(hideDialog());
|
dispatch(hideDialog());
|
||||||
|
logger.info(`Virtual background type: '${typeof options.backgroundType === 'undefined'
|
||||||
|
? 'none' : options.backgroundType}' applied!`);
|
||||||
}, [ dispatch, options, _localFlipX ]);
|
}, [ dispatch, options, _localFlipX ]);
|
||||||
|
|
||||||
// Prevent the selection of a new virtual background if it has not been applied by default
|
// Prevent the selection of a new virtual background if it has not been applied by default
|
||||||
|
|
Loading…
Reference in New Issue