Skip to content

Commit

Permalink
Don't freeze QR code video on iOS Safari
Browse files Browse the repository at this point in the history
  • Loading branch information
helgoboss committed Nov 3, 2020
1 parent 0d40563 commit 5879268
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/infrastructure/platform/web/qr_code_scanner.dart
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,13 @@ class _WebQrCodeScannerWidgetState extends State<WebQrCodeScannerWidget> {
<body>
<canvas id="canvas" hidden></canvas>
<video id="video"></video>
<script>
var video = document.createElement("video");
var video = document.getElementById("video");
video['style']['transform'] = 'scale(0.0001,0.0001)';
video['style']['position'] = 'fixed';
video['style']['bottom'] = '0px';
video['style']['right'] = '0px';
var canvasElement = document.getElementById("canvas");
var canvas = canvasElement.getContext("2d");
navigator.mediaDevices.getUserMedia({ video: { facingMode: "environment" } }).then(function (stream) {
Expand Down

0 comments on commit 5879268

Please sign in to comment.