From e38bf8ac8b6582dc4f5d3300c5da95f5a04ebc8e Mon Sep 17 00:00:00 2001
From: Julius de Jeu
Date: Sun, 12 Jun 2022 01:06:46 +0200
Subject: [PATCH] Use canvas instead of video element to fix ios
Also fix default url
---
src/main.rs | 2 +-
templates/party.html | 7 +++++--
2 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/src/main.rs b/src/main.rs
index 2a50017..44512e6 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -381,7 +381,7 @@ async fn main() {
let url = if let Some(url) = std::env::var("DATABASE_URL").ok() {
url
} else {
- "postgres://postgres:postgres@localhost:5432/postgres".to_string()
+ "postgres://tickets:verysecure@localhost:5432/tickets".to_string()
};
let pool = PgPoolOptions::new()
.connect(&url)
diff --git a/templates/party.html b/templates/party.html
index 0bcd90b..041ab05 100644
--- a/templates/party.html
+++ b/templates/party.html
@@ -18,7 +18,10 @@
Scannen
Nog geen gescand
Nog geen gescand
-
+
+
+
+
@@ -177,7 +180,7 @@
setInterval(() => {
console.log("scanning now?")
- const canvas = document.createElement("canvas");
+ const canvas = document.getElementById("qr-canvas");
canvas.width = videoElement.videoWidth;
canvas.height = videoElement.videoHeight;
canvas.getContext("2d").drawImage(videoElement, 0, 0);