Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Camera is active, and scanning is working, but the camera not displaying on video #256

Open
fzn0x opened this issue Oct 9, 2020 · 1 comment

Comments

@fzn0x
Copy link

fzn0x commented Oct 9, 2020

SMA Muhammadiyah 2 Surabaya - Transaksi_ Tambah Transaksi - Mozilla Firefox 10_9_2020 3_06_45 PM
Browser: Firefox 81.0.1

Relate to #241
js : https://rawgit.com/schmich/instascan-builds/master/instascan.min.js

my source code :

//preview box
<div class="box">
     <div class="box-body ">
         <video id="preview"></video>
     </div>
</div>   
// init
<script src="{{ asset('js/instascan.min.js') }}"></script>
<script type="text/javascript">
    let scanner = new Instascan.Scanner({ video: document.getElementById('preview') });
    scanner.addListener('scan', function (content) {
      console.log(content);
    });
    scanner.addListener('active', function (content) {
      console.log('active');
    });
    scanner.addListener('inactive', function (content) {
      console.log('inactive');
    });
    Instascan.Camera.getCameras().then(function (cameras) {
      if (cameras.length > 0) {
        scanner.start(cameras[0]);
      } else {
        console.error('No cameras found.');
      }
    }).catch(function (e) {
      console.error(e);
    });
</script>

No errors found in console.log but the camera display not showing .

Do we need to adding the camera display by ourself?

@ThuTa707
Copy link

Same error is having here. Camera is active but camera is not displaying on video. Do you have any answer??

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants