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

[Tracking Bug] Compatibility - Webcam access only works for Safari in IOS #14

Open
mebjas opened this issue Apr 4, 2020 · 27 comments
Open

Comments

@mebjas
Copy link
Owner

mebjas commented Apr 4, 2020

Query camera is not working for Opera, Edge, Firefox and Chrome.

[Fixed] For Safari the query is working but the stream is not realtime.
For chrome

Describe the browser:

  • OS: iOS in Iphone 7 and IPad 9.7
  • Browser: all
@mebjas mebjas added this to the v1.0.1 milestone Apr 4, 2020
@aamirbilvani
Copy link

Hi, what's the status of this issue? I was wondering when you might be able to fix it. Please let me know. Thanks.

PS. Love this plugin.

@mebjas
Copy link
Owner Author

mebjas commented Apr 11, 2020

Thanks, this is a weird issue and I am afraid it's a limitation of WebKit rendering engine used in IOS Chrome and Firefox - https://stackoverflow.com/questions/51501642/chrome-and-firefox-are-not-able-to-access-iphone-camera

@aamirbilvani
Copy link

What about Safari?

@mebjas
Copy link
Owner Author

mebjas commented Apr 11, 2020

So I verified that none of the webcam based approach work on any other browsers on IOS other than safari.

As for safari - I verified this to work on IPad, but for IPhone it has another problem, when we get the webcam access and want to stream the webcam feed to a video, it throws this exception and the scanner cannot run:

NotAllowedError: The request is not allowed by the user agent or the platform in the current context, 
possibly because the user denied permission.

This is being tracked in #9

@mebjas
Copy link
Owner Author

mebjas commented Apr 11, 2020

The ios safari issue has been now fixed: 4c28708

Try https://blog.minhazav.dev/research/html5-qrcode for demo. However, I observed another issue: #21

Will try to fix this soon as well.

@aamirbilvani
Copy link

Awesome, thanks for the quick turnaround. Let me try it out.

@mebjas
Copy link
Owner Author

mebjas commented Apr 18, 2020

@aamirbilvani With this #24 I have added support for scanning local media on device. This implicitly adds scanning using default camera on device.

This can be used as fallback on browsers that do not support inline QR code scanning. Like non Safari browsers on IOS.

https://blog.minhazav.dev/HTML5-QR-Code-scanning-support-for-local-file-and-default-camera/ may be helpful in understanding more about this change.

@mebjas mebjas changed the title Compatibility - [ios] [All Browser] - [Query Camera] Compatibility - Webcam access only works for Safari in IOS May 8, 2020
@mebjas mebjas changed the title Compatibility - Webcam access only works for Safari in IOS [Tracking Bug] Compatibility - Webcam access only works for Safari in IOS Sep 20, 2020
@Zaffer
Copy link

Zaffer commented Nov 3, 2020

Hi Mebjas, is there any optimism to fix this bug? Most people now prefer to use chrome on iOS.

@mebjas
Copy link
Owner Author

mebjas commented Nov 7, 2020

This is unfortunately out of my hand. This has been forever open at https://bugs.chromium.org/p/chromium/issues/detail?id=752458

One thing I can try to do is to make the file / device camera based option as the first option when user opens the web page on iOS from browsers other than Safari - would that help @Zaffer

One thing that could push Apple move in the direction to implement this would be as mentioned in comment#39

Apple prioritizes features based on developer interest, so the best way to help us convince them to fix this is to file a bug at https://feedbackassistant.apple.com/

Commenting on the WebKit bug (https://bugs.webkit.org/show_bug.cgi?id=208667) might help somewhat, but not as much as filing at https://feedbackassistant.apple.com/, since the latter is what Apple uses internally for prioritization.

This may practically have no impact, but I tried to raise the concern here as well: https://twitter.com/minhazav/status/1324938828155482113

@georgewei
Copy link

It's confirmed that WKWebView of newest iOS 14.3 supports WebRTC, so thirt-party browsers can utilize it.

@mebjas
Copy link
Owner Author

mebjas commented Jan 17, 2021

This is awesome, thanks for updating. I'll verify and update the docs.

1 similar comment
@mebjas
Copy link
Owner Author

mebjas commented Jan 17, 2021

This is awesome, thanks for updating. I'll verify and update the docs.

@SimonPickup
Copy link

This isn’t working for me using WKWebView in iOS 14.3. I get “unable to query supported devices.” after pressing “Request Camera Permissions”, even if I add prior Swift code to request camera authorization. Is there a sample iOS app that should work? If not I’ll create one.

@TheWizz
Copy link

TheWizz commented Jan 25, 2021

AFAIK, webviews can't access the camera "live" in the way required here. This goes for iOS and Android.

https://stackoverflow.com/questions/56646575/wkwebview-does-not-allow-camera-access-in-application

-JM

@SimonPickup
Copy link

Thanks @mebjas, but I thought @georgewei above has confirmed this is now allowed from iOS 14.3. Sorry I didn't reference that explicitly.

@TheWizz
Copy link

TheWizz commented Jan 25, 2021

He's talking about WebRTC. I don't think that's what's being used here.

-JM

@mebjas
Copy link
Owner Author

mebjas commented Jan 25, 2021

@georgewei Can you share some reference about the new support?

@SimonPickup
Copy link

SimonPickup commented Jan 27, 2021

I did get it working within a WKWebView in a Swift app under iOS 14.3. It's barely functional (I found it very difficult to get any QR code to scan) and it isn't pretty but the permissions seem to be solved. Source code here: https://github.com/sjpickup/wkwebview-html5-qrcode

(I didn't yet work out why my main app isn't working.)

SimonPickup added a commit to SimonPickup/wkwebview-html5-qrcode that referenced this issue Jan 27, 2021
@georgewei
Copy link

@mebjas I've tested this project on iOS 14.3 and it works. It was confirmed by others on webkit.org already, and there is another thread: https://blog.bitsrc.io/ios-14-3-brings-webrtc-to-wkwebview-closing-gap-on-ios-accessibility-90a83fa6bda2

@mebjas mebjas removed this from the v1.1.0 milestone May 28, 2021
@ROBERT-MCDOWELL
Copy link

@mebjas
I just check Chrome, Firefox and Edge on iOS 15.1 and everything is working now as expected.
maybe update the README?

@plambrechtsen
Copy link

I can also confirm on iOS 15.1 using Chrome I was able to successfully use https://scanapp.org/

@Sevyls
Copy link

Sevyls commented Jan 14, 2022

this is solved in iOS 15.1 and beyond

@mebjas
Copy link
Owner Author

mebjas commented Jan 14, 2022

I just check Chrome, Firefox and Edge on iOS 15.1 and everything is working now as expected.
maybe update the README?

Fantastic :) Let's do it!

@mebjas
Copy link
Owner Author

mebjas commented Jan 14, 2022

What about firefox, opera, edge?

@Sevyls
Copy link

Sevyls commented Jan 14, 2022

Firefox works since 15.1

@shoyuf
Copy link

shoyuf commented May 10, 2022

Edge for iOS works since 15.1

@1bberto
Copy link

1bberto commented Jun 8, 2022

Chrome (version 102.0.5005.87) for IOS 15.5 not working 😓
Edit: its actually working I had to enable the access to the camera on the app settings 🚀🚀🚀

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

No branches or pull requests