通过浏览器访问相机 [英] Camera access through browser
本文介绍了通过浏览器访问相机的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我们正在为移动设备创建一个HTML5网站,并且需要通过网络浏览器访问摄像头,而不是原生应用。我们在iOS中无法完成这项工作。有人知道这个的解决方案吗?
解决方案
你可以试试这个:
< input type =filecapture =cameraaccept =image / *id =cameraInputname =cameraInput>
但它必须是iOS 6 + 才能使用。这会给你一个很好的对话,让你选择拍摄一张照片或从你的专辑上传一张照片,例如
可以在这里找到一个例子:
在没有PhoneGap的情况下捕获相机/图片数据
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?
解决方案
You could try this:
<input type="file" capture="camera" accept="image/*" id="cameraInput" name="cameraInput">
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.
An example can be found here: Capturing camera/picture data without PhoneGap
这篇关于通过浏览器访问相机的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文