From fab5c17dc2362f3806bb7f10d146e60dbd98648c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20N=C3=A9grier?= Date: Tue, 8 Jun 2021 12:19:07 +0200 Subject: [PATCH] Fixing the cleaning of webcam name Closes #1130 --- front/src/Components/EnableCamera/EnableCameraScene.svelte | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/front/src/Components/EnableCamera/EnableCameraScene.svelte b/front/src/Components/EnableCamera/EnableCameraScene.svelte index 537e8bdb..afdcc745 100644 --- a/front/src/Components/EnableCamera/EnableCameraScene.svelte +++ b/front/src/Components/EnableCamera/EnableCameraScene.svelte @@ -61,8 +61,8 @@ onDestroy(unsubscribe); function normalizeDeviceName(label: string): string { - // remove text in parenthesis - return label.replace(/\([^()]*\)/g, '').trim(); + // remove IDs (that can appear in Chrome, like: "HD Pro Webcam (4df7:4eda)" + return label.replace(/(\([[0-9a-f]{4}:[0-9a-f]{4}\))/g, '').trim(); } function selectCamera() {