Browse Source

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

j8
tudordan7 4 years ago
parent
commit
bb8c30a6c9

+ 1
- 5
react/features/stream-effects/virtual-background/JitsiStreamBackgroundEffect.js View File

97
         // Draw segmentation mask.
97
         // Draw segmentation mask.
98
 
98
 
99
         // Smooth out the edges.
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
         if (backgroundType === VIRTUAL_BACKGROUND_TYPE.DESKTOP_SHARE) {
101
         if (backgroundType === VIRTUAL_BACKGROUND_TYPE.DESKTOP_SHARE) {
106
             // Save current context before applying transformations.
102
             // Save current context before applying transformations.
107
             this._outputCanvasCtx.save();
103
             this._outputCanvasCtx.save();

+ 14
- 0
react/features/virtual-background/components/VirtualBackgroundDialog.js View File

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

Loading…
Cancel
Save