iOS11 getUserMedia与苹果Web应用程序不起作用 [英] iOS11 getUserMedia with apple web-app not working

查看:65
本文介绍了iOS11 getUserMedia与苹果Web应用程序不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

的副本在iOS11主屏幕网络应用上访问摄像头?

Duplicate of How to access camera on iOS11 home screen web app?

在使用Apple Web应用程序以及通过getUserMedia API进行摄像头访问时遇到了问题.

I'm running into a problem with using a apple web-app together with camera access through the getUserMedia API.

我有一些通过Safari浏览器访问时运行良好的应用程序,它要求允许使用相机,并在获得批准后可以看到相机供稿.但是,如果我将同一页面另存为Web应用程序到主屏幕,则此功能将不再起作用.没有提示访问摄像机的提示,这似乎是问题所在,因为默认情况下未启用它.

I have some application that is working fine when accessed through safari, it asks for persmission to use the camera and upon approval I can see the camera feed. But if I save this same page to the home screen as an web-app this does not work anymore. There is no prompt for camera access, which seems to be the problem as it is not enabled by default.

出现问题的那一行是一个meta标签,该标签可为iOS上的Web应用程序提供全屏显示.

The line that gives the problems is a meta tag which enables full screen for a web application on iOS.

<meta name="apple-mobile-web-app-capable" content="yes">

任何人都知道这里发生了什么,为什么会失败?我是否还需要通过meta标签设置摄像机权限?

Anyone know what is going on here and why this fails? Do I need to set camera permission somehow through a meta tag also?

提前谢谢!

推荐答案

Apple删除了在UIWebView,WKWebView,SFSafariViewController或已添加到"主屏幕".

Apple has removed the ability to use getUserMedia inside a UIWebView, WKWebView, SFSafariViewController, or a webpage that has been "added to the home screen".

原因尚不清楚,但是我不认为这是一个错误.

The reasoning is not clear, however I do not believe this to be a bug.

一位Apple员工在iOS 11中撰写了有关WebRTC的内容:

...目前,仅Safari支持WebRTC.没有WKWebView,甚至没有SFSafariViewController.

...right now, WebRTC is only supported in Safari. No WKWebView, not even SFSafariViewController.

而且我可以确认(其中还包括UIWebView)(通过个人测试).

And I can confirm that this includes the UIWebView as well (through personal tesing).

这篇关于iOS11 getUserMedia与苹果Web应用程序不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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