Use canvas instead of video element to fix ios
All checks were successful
continuous-integration/drone/push Build is passing

Also fix default url
This commit is contained in:
Julius 2022-06-12 01:06:46 +02:00
parent 57ce326a7a
commit e38bf8ac8b
Signed by: j00lz
GPG key ID: AF241B0AA237BBA2
2 changed files with 6 additions and 3 deletions

View file

@ -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)

View file

@ -18,7 +18,10 @@
Scannen</button> </p>
<h4><span id="last-scanned">Nog geen gescand</span></h4>
<h3><span id="scan-status">Nog geen gescand</span></h3>
<video autoplay class="column col-12"></video>
<video autoplay hidden="true"></video>
<div class="columns">
<canvas id="qr-canvas" class="column col-12"></canvas>
</div>
</div>
<div class="columns">
<div class="column col-md-12 col-6">
@ -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);