如何从Mobile Safari访问iPhone的相机 [英] How to access the iPhone's camera from Mobile Safari

查看:71
本文介绍了如何从Mobile Safari访问iPhone的相机的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有用于从Mobile Safari访问iPhone相机的API或方法?我想创建一个可以在浏览器中读取条形码的应用程序.预先感谢.

Is there a API or way for accessing the the iPhone's camera from Mobile Safari?I want to create a application that can read barcode within the browser. Thanks in advance.

推荐答案

否.无法做到这一点.没有网页可以访问内部设备.

No. There's no way to do that. No web page can access internal devices.

但是,您可以执行一个小型微型应用程序,该微型应用程序通过移动safari链接启动,并让用户选择条形码图像,然后重定向到将要处理的网页(该小型应用程序也将上载).就像的人实际实现的一样(链接提供了代码).

You can do however a small tiny app that its launched via mobile safari link and makes user select the barcode image and then redirect to a web page that will process (the small app will also upload). Like what THIS guys actually implemented (the link provides code).

如果您没有使用Objective C和Cocoa Touch的经验,可以通过 PhoneGap 创建该应用如果您正在创建网页.

If you doesn't have experience with Objective C and Cocoa Touch you can create that app via PhoneGap like if you were creating a Web Page.

更新

在iOS 6等系统上,您实际上可以按照官方规范所说的,您可以通过在这里看到.

From iOS 6 and so on you actually can as the official specs says, you can use it via the upload API as seen here.

这篇关于如何从Mobile Safari访问iPhone的相机的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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