在iOS中通过浏览器进行HTML5相机访问 [英] HTML5 Camera Access Through Browser in iOS

查看:967
本文介绍了在iOS中通过浏览器进行HTML5相机访问的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在为移动设备创建一个html5网站,需要通过网络浏览器访问相机,而不是原生应用。我们在iOS中无法使用此工作。是否有人知道这个解决方案?

We are creating an html5 website for mobile and need to get camera access through the web browser without being a native app. We are having trouble making this work in iOS. Is anyone aware of a solution for this?

推荐答案

您可以尝试这样:

<input type="file" capture="camera" accept="image/*" id="cameraInput" name="cameraInput">

必须是iOS 6 + 才能运作。这将给你一个很好的对话,你可以选择拍摄照片或从你的相册上传一个

but it has to be iOS 6+ to work. That will give you a nice dialogue for you to choose either to take a picture or to upload one from your album i.e.

一个例子可以在这里找到:
在没有PhoneGap的情况下捕获相机/图片数据

An example can be found here: Capturing camera/picture data without PhoneGap

这篇关于在iOS中通过浏览器进行HTML5相机访问的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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