瀏覽代碼

fix(virtual-background): Add logs on virtual background actions.

j8
tudordan7 3 年之前
父節點
當前提交
bb8c30a6c9

+ 1
- 5
react/features/stream-effects/virtual-background/JitsiStreamBackgroundEffect.js 查看文件

@@ -97,11 +97,7 @@ export default class JitsiStreamBackgroundEffect {
97 97
         // Draw segmentation mask.
98 98
 
99 99
         // Smooth out the edges.
100
-        if (backgroundType === VIRTUAL_BACKGROUND_TYPE.IMAGE) {
101
-            this._outputCanvasCtx.filter = 'blur(4px)';
102
-        } else {
103
-            this._outputCanvasCtx.filter = 'blur(8px)';
104
-        }
100
+        this._outputCanvasCtx.filter = backgroundType === VIRTUAL_BACKGROUND_TYPE.IMAGE ? 'blur(4px)' : 'blur(8px)';
105 101
         if (backgroundType === VIRTUAL_BACKGROUND_TYPE.DESKTOP_SHARE) {
106 102
             // Save current context before applying transformations.
107 103
             this._outputCanvasCtx.save();

+ 14
- 0
react/features/virtual-background/components/VirtualBackgroundDialog.js 查看文件

@@ -198,6 +198,8 @@ function VirtualBackground({
198 198
             blurValue: 25,
199 199
             selectedThumbnail: 'blur'
200 200
         });
201
+        logger.info('"Blur" option setted for virtual background preview!');
202
+
201 203
     }, []);
202 204
 
203 205
     const enableBlurKeyPress = useCallback(e => {
@@ -214,6 +216,8 @@ function VirtualBackground({
214 216
             blurValue: 8,
215 217
             selectedThumbnail: 'slight-blur'
216 218
         });
219
+        logger.info('"Slight-blur" option setted for virtual background preview!');
220
+
217 221
     }, []);
218 222
 
219 223
     const enableSlideBlurKeyPress = useCallback(e => {
@@ -273,6 +277,7 @@ function VirtualBackground({
273 277
             dispatch(openDialog(VirtualBackgroundDialog, { initialOptions: newOptions }));
274 278
         } else {
275 279
             setOptions(newOptions);
280
+            logger.info('"Desktop-share" option setted for virtual background preview!');
276 281
         }
277 282
     }, [ dispatch, options ]);
278 283
 
@@ -288,6 +293,8 @@ function VirtualBackground({
288 293
             enabled: false,
289 294
             selectedThumbnail: 'none'
290 295
         });
296
+        logger.info('"None" option setted for virtual background preview!');
297
+
291 298
     }, []);
292 299
 
293 300
     const removeBackgroundKeyPress = useCallback(e => {
@@ -308,6 +315,7 @@ function VirtualBackground({
308 315
                 url: image.src,
309 316
                 selectedThumbnail: image.id
310 317
             });
318
+            logger.info('Uploaded image setted for virtual background preview!');
311 319
         }
312 320
     }, [ storedImages ]);
313 321
 
@@ -324,6 +332,8 @@ function VirtualBackground({
324 332
                 url,
325 333
                 selectedThumbnail: image.id
326 334
             });
335
+            logger.info('Image setted for virtual background preview!');
336
+
327 337
             setLoading(false);
328 338
         }
329 339
     }, []);
@@ -351,6 +361,8 @@ function VirtualBackground({
351 361
                 selectedThumbnail: uuId
352 362
             });
353 363
         };
364
+        logger.info('New virtual background image uploaded!');
365
+
354 366
         reader.onerror = () => {
355 367
             setLoading(false);
356 368
             logger.error('Failed to upload virtual image!');
@@ -397,6 +409,8 @@ function VirtualBackground({
397 409
             }));
398 410
         }
399 411
         dispatch(hideDialog());
412
+        logger.info(`Virtual background type: '${typeof options.backgroundType === 'undefined'
413
+            ? 'none' : options.backgroundType}' applied!`);
400 414
     }, [ dispatch, options, _localFlipX ]);
401 415
 
402 416
     // Prevent the selection of a new virtual background if it has not been applied by default

Loading…
取消
儲存