zxing-js / browser

ZXing for JS's browser layer with decoding implementations for browser.
MIT License
213 stars 43 forks source link

Camera not working in safari PWA. #122

Open ilyaqq1999 opened 1 year ago

ilyaqq1999 commented 1 year ago

We are codding the PWA and in browser we hadn't problem. But when you installing site on home screen like PWA, in this application when you open the camera and fast closing app, at the new opening app and camera it's not working. Mb it's coz videostreem not cleared. Testin on iphones 7, 10, 11.

UPD: Camera starts working on 17 IOS version, BUT, it's randomly sizing in video element, regardless of video element size. Works with switching the camera to the front and back.

alexandertopskiy commented 1 year ago

same bro...

grahn195 commented 12 months ago

same....

strom-und-spiele commented 11 months ago

I did some digging today. The issue seems to be with the webRTC API of safari (which seems to change after 'installing' a PWA) and not within zxing-js itself.

I was using inspect.dev's intractive console (If you don't know it, think chrome dev console) on an iPhone and simply tired to reproduce BrowserCodeReader.addVideoSource by getting all devices and setting one stream as the srcObj of a video tag. No image was shown. I did everything in parallel on a chrome locally, where it worked.

Annoyed and hungry, I updated the phone to v17.0.2 and went for lunch. After the update everything seems to work.

On my collegues iPhones that cannot update beyond v16, the issue still exists.

I would be thankful if anyone could find a way to make this work on older versions of iOS.

shprink commented 1 month ago

still exists