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

Cant see camera in DOM #241

Open
harshad5498 opened this issue Mar 13, 2020 · 8 comments
Open

Cant see camera in DOM #241

harshad5498 opened this issue Mar 13, 2020 · 8 comments

Comments

@harshad5498
Copy link

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
Copy link

Norc89 commented Mar 30, 2020

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
Copy link

Norc89 commented Mar 30, 2020

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
Copy link
Author

harshad5498 commented Mar 30, 2020 via email

@alignwebs
Copy link

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
Copy link
Author

harshad5498 commented Apr 7, 2020 via email

@Ren14
Copy link

Ren14 commented Jun 11, 2020

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
Copy link
Author

thanks bro its working fine now

@creenx062512
Copy link

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

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

5 participants