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

TypeError: Failed to execute 'createObjectURL' on 'URL': No function was found that matched the signature provided. #251

Open
mchmdarvan opened this issue Jun 10, 2020 · 6 comments

Comments

@mchmdarvan
Copy link

Hi,
this error happen when i try to access the camera, my code file was same like the example.
I'm still beginner, so i hope you guys can help me.
Thanks

@ghost
Copy link

ghost commented Jun 17, 2020

Yes me 2

@mehran-akb
Copy link

i have this problem too

@notshekhar
Copy link

me too

@notshekhar
Copy link

https://github.com/zxing-js/library I found this library, great library for QR code and barcode scanner

@fabionaspolini
Copy link

fabionaspolini commented Jul 2, 2020

It seems that this project is stopped.
I fixed bug at my fork and published with new package name on npm.

npm install --save instascan-new

For React projects, I did fix these packages:
My fork: https://github.com/fabionaspolini/react-instascan

To install new packages:
npm install react-instascan-new instascan-umd-new --save

@oscarmartins
Copy link

Fix:

Attach your stream directly to srcObject property instead of using URL.createObjectURL function.
recomendation: https://developer.mozilla.org/en-US/docs/Web/API/URL/createObjectURL#Using_object_URLs_for_media_streams

const instascan = require('instascan');

const args = { video: document.getElementById('preview') };

window.URL.createObjectURL = (stream) => {
            args.video.srcObject = stream;
            return stream;
};

const scanner = new instascan.Scanner(args);

...

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