如何编程“相机选择照片库或拍照” [英] How to program "Camera choose from photo library or Take a photo"

查看:91
本文介绍了如何编程“相机选择照片库或拍照”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hello Experts,



我有一个现场直播的网站。我的客户想要一个新功能。该网站将提交在线索赔表。在某些情况下,用户需要发送原始发票/帐单的图像。当在具有此功能的Ipad / Iphone /任何手机上使用时,他们希望通过拍摄照片或从照片库中选择来上传图像。

现在我陷入了想法/示例/教程。

,是的,只有当电脑/手机里面装有摄像头时才能正常工作。

任何教程和想法都很受欢迎。

请帮帮我在知道如何实现这一目标。



非常感谢您的帮助

解决方案

我认为没有上传文件的问题。这可以在Web表单中完成。



在线捕获更成问题。我建议使用WebRTC从浏览器发送媒体。从这里开始:

http://en.wikipedia.org/wiki/WebRTC [< a href =http://en.wikipedia.org/wiki/WebRTCtarget =_ blanktitle =New Window> ^ ],

http://www.html5rocks.com/en/tutorials/webrtc/basics [ ^ ],

https://developer.mozilla.org/en-US/docs/Web/Guide/API/WebRTC [< a href =https://developer.mozilla.org/en-US/docs/Web/Guide/API/WebRTC\"target =_ blanktitle =New Window> ^ ],
http://www.w3.org/TR/webrtc [ ^ ]。



当时在写作方面,WebRTC得到所有主流浏览器的支持,但不支持Safary而不是IE(不出意外)。

我想警告你反对通常的IE解决办法:嵌入在浏览器中的ActiveX。这完全不安全。对于一些精通安全的用户来说,了解你正在使用ActiveX进行那些肮脏的技巧可能足以将你的网站列入黑名单,原因很简单。



-SA

Hello Experts,

I have a website that is on live. My customers wanted a new feature in it. The website is to submit online claim forms. There are some cases where user needs to send an image of original Invoice/ bill. When used on Ipad/ Iphone/ any phone with this feature they want to upload an image either by capturing the picture or choosing from photo library.
Now I am stuck with ideas/ examples/ tutorials.
and yeah it should work only when the computer/phone has camera in it.
Any tutorials and ideas are appreciated.
Please help me in knowing how to achieve this.

Your help is much appreciated

解决方案

I think there are no problems with uploading files. This can be done in a Web form.

The online capture is much more problematic. I would advise using WebRTC for sending media from browser. Start here:
http://en.wikipedia.org/wiki/WebRTC[^],
http://www.html5rocks.com/en/tutorials/webrtc/basics[^],
https://developer.mozilla.org/en-US/docs/Web/Guide/API/WebRTC[^],
http://www.w3.org/TR/webrtc[^].

At the time of writing, WebRTC is supported by all major browsers but not Safary and not IE (not surprisingly).
I want to warn you against the "usual" IE work-around: ActiveX embedded in the browser. This is utterly unsafe. For some safety-savvy users, learning that you are doing those dirty tricks with ActiveX can be enough to blacklist your site, for some very good reasons.

—SA


这篇关于如何编程“相机选择照片库或拍照”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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