从HTML/Angular应用程序访问移动摄像头 [英] Access mobile camera from HTML/Angular application

查看:80
本文介绍了从HTML/Angular应用程序访问移动摄像头的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找从基于html5/angular构建的应用程序访问移动后置摄像头的方法.我用了< input type ="file" accept ="image/*" capture ="camera"/> ,但是它总是打开前置摄像头而不是后置摄像头,有什么办法可以打开后置摄像头总是吗?

I am looking to access mobile back camera from an application I am building on html5/angular. I used <input type="file" accept="image/*" capture="camera" /> but it always opens the front camera rather then back camera, is there any way to open back camera always?

推荐答案

您应该能够使用capture属性在前后摄像头之间进行选择.

You should be able to select between the front and rear camera using the capture attribute.

对于后置摄像头:

<input type="file" accept="image/*" capture="environment">

对于前置摄像头,您应该可以使用: capture ="user" 或仅捕获.

For the front camera, you should be able to use: capture="user" or just capture.

如果您愿意,可以在这里详细了解以下内容:https://developers.google.com/web/fundamentals/media/capturing-images/

You can read a bit more about it here if you'd like: https://developers.google.com/web/fundamentals/media/capturing-images/

这篇关于从HTML/Angular应用程序访问移动摄像头的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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