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

feat(barcode-scanning): add web support #52

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

Conversation

robingenz
Copy link
Member

Pull request checklist

Please check if your PR fulfills the following requirements:

  • The changes have been tested successfully.
  • A changeset has been created (npm run changeset).

Close #20

@robingenz robingenz changed the title feat: add web support feat(barcode-scanning): add web support Nov 24, 2023
@zavovi
Copy link

zavovi commented Dec 8, 2023

Hi, please, is there any update of this? I am using this plugin on Android and I want to use it on mobile web browser (mainly iOS). Is it possible? Can I help with continue of this?

@bartokopec
Copy link

Hello! Merging such a feature like this would be helpful :) @robingenz

@p3nnst8r
Copy link

p3nnst8r commented Jan 9, 2024

Any updates to this?

@zavovi
Copy link

zavovi commented Jan 10, 2024

Hi, I spent some time to try this code. Now, it is not up to date and I had to change some things to update it to latest master. After that, I had lot of problems with camera on my computer. The code options.videoElement.play() is not working for me, play() is missing.
The barcodeDetector is missing for me too.
I was using Google Chrome on desktop Windows 10.
I read lot of discussions and manual.

The last thing, I wanted to use this code for support my app on iOS, because I cannot pay for Applle developper account, but this is not supported in Safari.

@arcadius
Copy link

Any update on this please @robingenz

@SimonVermeiren
Copy link

Any updates already on this issue? @robingenz

@robingenz
Copy link
Member Author

No, there are currently no updates.

@iBobik
Copy link

iBobik commented Jun 20, 2024

Testing it with the last commits from the main (checked out this PR and merged main) and it works on the web, but iOS (and possibly Android, not tested) was broken - it cannot serialize <video> element when calling BarcodeScanner.startScan, so I had to call it like this:

BarcodeScanner.startScan({ formats: [BarcodeFormat.QrCode], videoElement: Capacitor.isNativePlatform() ? undefined : videoEl.value, lensFacing: LensFacing.Back })

But I think this is bug - native plugin should ignore videoElement option.

@iBobik
Copy link

iBobik commented Jul 21, 2024

@robingenz Why you choose the ways with passing custom videoElement in the options?

Other similar plugin creates video element in the plugin, so for developer the web plugin works similarly to native plugins - video will appear under the DOM tree on all platforms, so there is less surface for bugs.

@iBobik
Copy link

iBobik commented Nov 24, 2024

Hi, I’ve just rewrote it to the updated API and changed web plugin to automatically create video element, so options are consistent to the native plugins.

My PR: #211

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

Successfully merging this pull request may close these issues.

feat(barcode-scanning): support the Web platform
7 participants