From 93a916aa67913a0ba56451a99468b848e81df572 Mon Sep 17 00:00:00 2001 From: Charlie Kapsiak Date: Thu, 17 Oct 2024 15:48:43 -0500 Subject: [PATCH] Fix --- src/routes/BarcodeScanner.svelte | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/src/routes/BarcodeScanner.svelte b/src/routes/BarcodeScanner.svelte index a0a4ffc..299b85e 100644 --- a/src/routes/BarcodeScanner.svelte +++ b/src/routes/BarcodeScanner.svelte @@ -36,6 +36,7 @@ async function getDevices() { await navigator.mediaDevices.getUserMedia({video: true, audio: false}); let devices = await code_reader.listVideoInputDevices(); + devices.sort((a,b) => b.label.includes("Back")); no_cameras = devices.length === 0; return devices; } @@ -103,16 +104,6 @@ } - onMount(() => { - promise = getDevices(); - promise.then((vals) => { - all_devices = vals; - // if(vals.length>0){ - // selected_device_id = vals[0].deviceId; - // } - onSelectDevice(); - }); - });