From 40d4eb3ed6e0e790ff172e4e5254dab4705b5f20 Mon Sep 17 00:00:00 2001 From: "Dustin C. Hatch" Date: Sat, 8 Mar 2025 20:41:40 -0600 Subject: [PATCH] ui: Request higher video resolution from camera Apparently, you get 640x480 unless you ask for more? Need to constrain the viewer size, though, otherwise it massively overflows the page and makes it impossible to see what you're taking a picture of. --- js/transaction.css | 7 +++++++ js/transaction.ts | 2 ++ 2 files changed, 9 insertions(+) diff --git a/js/transaction.css b/js/transaction.css index d125efd..1054a32 100644 --- a/js/transaction.css +++ b/js/transaction.css @@ -6,6 +6,13 @@ text-align: center; } +#photo-view video, +#photo-view canvas { + width: 100%; + height: auto; + object-fit: contain; +} + #photo-view sl-icon-button { font-size: 3em; margin: 0 0.5em; diff --git a/js/transaction.ts b/js/transaction.ts index 559bb74..cb1a22a 100644 --- a/js/transaction.ts +++ b/js/transaction.ts @@ -50,6 +50,8 @@ async function startCamera() { facingMode: { ideal: "environment", }, + width: { ideal: 1280 }, + height: { ideal: 720 }, }, audio: false, });