Use canvas instead of video element to fix ios
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
Also fix default url
This commit is contained in:
parent
57ce326a7a
commit
e38bf8ac8b
|
@ -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)
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue