Merge pull request #1139 from thecodingmachine/fix-webcam-name

Fixing the cleaning of webcam name
This commit is contained in:
David Négrier 2021-06-08 14:35:13 +02:00 committed by GitHub
commit 5c9da4a725
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -61,8 +61,8 @@
onDestroy(unsubscribe); onDestroy(unsubscribe);
function normalizeDeviceName(label: string): string { function normalizeDeviceName(label: string): string {
// remove text in parenthesis // remove IDs (that can appear in Chrome, like: "HD Pro Webcam (4df7:4eda)"
return label.replace(/\([^()]*\)/g, '').trim(); return label.replace(/(\([[0-9a-f]{4}:[0-9a-f]{4}\))/g, '').trim();
} }
function selectCamera() { function selectCamera() {