iOS独立PWA输入捕获 [英] iOS Standalone PWA input capture

查看:87
本文介绍了iOS独立PWA输入捕获的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我认为我们在iOS 13.2/13.3中发现了以独立模式运行的PWA的回归.

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

由于在iOS上PWA无法访问getUserMedia(),因此我们依赖于 capture 属性在HTML5输入标签上,以便用户拍照并将其发送到服务器.

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.

我们的代码如下:

<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>

当我们在装有iOS 13.1或更低版本的设备上以独立模式运行PWA时,一切正常.如果我们在Safari上以浏览器模式运行PWA,则无论iOS版本如何,一切都能正常工作.

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.

当我们在装有iOS 13.2或13.3的设备上运行PWA时,该功能将起作用,直到将PWA置于后台,然后再次置于前景.将PWA发送到后台后,捕获会启动相机,但预览会变成黑色.所有相机控件(闪光灯等)都可以正常工作,但是无法拍摄照片.

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.

我们在连接了XCode控制台记录器的情况下运行了一个测试,它看起来在将应用程序置于后台一次后,AVCaptureSession似乎无法启动.

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

我们正在使用Angular 8构建我们的PWA.

We are building our PWA with Angular 8.

有人看到这样的东西还是可以给我们提示吗?

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

推荐答案

@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

这篇关于iOS独立PWA输入捕获的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆