iOS Standalone PWA input capture

2020-02-28 06:19发布

I think we found a regression in iOS 13.2/13.3 in regard to PWAs running in standalone mode.

Since on iOS PWA cannot access getUserMedia() we rely on the capture attribute on the HTML5 input tag to let the user take a picture and send it to a server.

Our code looks like this:

<div class="camera-upload">
     <input type="file" class="hidden" name="uploadPhotoInput" accept="image/*" capture="environment" (change)="onTakePhoto($event)">
     <button type="button" class="btn btn-primary">Take photo</button>
</div>

When we run the PWA in standalone mode on devices with iOS 13.1 or lower everything works as expected. If we run the PWA in browser mode on Safari everything works regardless of the iOS version.

When we run the PWA on devices with iOS 13.2 or 13.3 the feature works until we put the PWA in background and then in foreground again. After the PWA is sent to the background the capture launch the camera, but the preview is jut black. All the camera controls (flash, etc) works, but no picture is taken.

We run a test with the XCode console logger attached and it looks AVCaptureSession cannot be started after the app has been put in background once.

Here is a trace of the device logs:

https://pastebin.com/qGZpN6dM

We are building our PWA with Angular 8.

Has anyone seen something like this or can give us an hint?

1条回答
在下西门庆
2楼-- · 2020-02-28 07:06

@elbuild

https://bugs.webkit.org/show_bug.cgi?id=206219

Bug was posted here. Feel free to contribute to posting as well to gain traction, I'll be doing the same

查看更多
登录 后发表回答