schmich / instascan

HTML5 QR code scanner using your webcam
https://schmich.github.io/instascan/
MIT License
2.97k stars 867 forks source link

Cant see camera in DOM #241

Open harshad5498 opened 4 years ago

harshad5498 commented 4 years ago

The camera is starting, in notification bar its showing camera is accessing by localhost:4200 but i am not getting view in DOM code in html:- <video id="preview" #preview class="border border-dark w-100 h-100 mx-auto"> code of typescript;- var scanner = new Instascan.Scanner( { video: document.getElementById('preview'), mirror: false }); console.log(scanner); Instascan.Camera.getCameras().then(cameras => { if (cameras.length > 0) { alert("camera on "+cameras.length); if(cameras.length>1){ scanner.start(cameras[1]); } else{ scanner.start(cameras[0]); } } else { Swal.fire({ title: "Cannot start camera", text: "Cannot start camera or you denied the permission for camera check site settings", icon: "info" }); } }).catch(error => { Swal.fire({ title: "Cannot start camera", text: "Cannot get Camera"+error, icon: "info" }); });

scanner.addListener('scan', function (content) {
    console.log("code",content);
}); 
Norc89 commented 4 years ago

Are you also getting in console this error ?

invalid asm.js: Type mismatch in assignment (anonymous) @ Index:46 Promise.then (async) (anonymous) @ Index:44 instascan.min.js:9 Uncaught (in promise) TypeError: Failed to execute 'createObjectURL' on 'URL': No function was found that matched the signature provided. at e.<anonymous> (instascan.min.js:9) at t (instascan.min.js:7) at Generator._invoke (instascan.min.js:7) at Generator.e.<computed> [as next] (instascan.min.js:7) at t (instascan.min.js:7) at r (instascan.min.js:7) at instascan.min.js:7

Norc89 commented 4 years ago

Use this build and you will be able to use it(is from demo). https://rawgit.com/schmich/instascan-builds/master/instascan.min.js

Can please somebody recreate latest release build.

Thanks

harshad5498 commented 4 years ago

Yes

On Mon, Mar 30, 2020, 4:29 PM MiselM notifications@github.com wrote:

Are you also getting in console this error ?

invalid asm.js: Type mismatch in assignment (anonymous) @ Index:46 Promise.then (async) (anonymous) @ Index:44 instascan.min.js:9 Uncaught (in promise) TypeError: Failed to execute 'createObjectURL' on 'URL': No function was found that matched the signature provided. at e. (instascan.min.js:9) at t (instascan.min.js:7) at Generator._invoke (instascan.min.js:7) at Generator.e. [as next] (instascan.min.js:7) at t (instascan.min.js:7) at r (instascan.min.js:7) at instascan.min.js:7

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/schmich/instascan/issues/241#issuecomment-605932171, or unsubscribe https://github.com/notifications/unsubscribe-auth/AOMEJGJ6G7S22ELSVAOZRMDRKB3SNANCNFSM4LG4HLSQ .

alignwebs commented 4 years ago

Use this build and you will be able to use it(is from demo). https://rawgit.com/schmich/instascan-builds/master/instascan.min.js

Can please somebody recreate latest release build.

Thanks

Thanks mate, this works

harshad5498 commented 4 years ago

Ok thanks I will try it soon.

On Tue, Apr 7, 2020, 2:53 PM Gulzar Ahmed notifications@github.com wrote:

Use this build and you will be able to use it(is from demo). https://rawgit.com/schmich/instascan-builds/master/instascan.min.js

Can please somebody recreate latest release build.

Thanks

Thanks mate, this works

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/schmich/instascan/issues/241#issuecomment-610277850, or unsubscribe https://github.com/notifications/unsubscribe-auth/AOMEJGLZLULUHYATQOJKYLLRLLWJJANCNFSM4LG4HLSQ .

Ren14 commented 4 years ago

Use this build and you will be able to use it(is from demo). https://rawgit.com/schmich/instascan-builds/master/instascan.min.js

Can please somebody recreate latest release build.

Thanks

Funcionó perfecto. Muchas gracias.

harshad5498 commented 4 years ago

thanks bro its working fine now

creenx062512 commented 2 years ago

Just now I am getting the same error, before it was working fine