简体   繁体   中英

How I can switch off camera in browser when I read a QR code?

Firstly sorry for my English.

Well, my problem is this. I'm using this library for read QRcodes in my WebApp. My QR codes contain links to other parts of my application, but when it redirect me, the camera is not turned off because (I think) that is using AngularJS routes. My question is, how I can force to reload the page when it redirect me ? By this way the camera will be turn off.

This is my code for turn on the cámera and read the QR:

        app.controller("ReadQRCtrl", function() {
          $(document).ready(function() {
            $('#reader').html5_qrcode(function(data) {
                 window.location.href ="http://localhost/SCTraker/Application/appIndex#/"+data;
            },
            function(error) {
                 console.log(error);
            }, function(videoError) {
                 console.log(videoError);
            }
         );
      });
  });

Resolved!! It a bug of the library, I uploaded the library to my GitHub: https://github.com/emilioxiri/html5_qrcode

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM