【发布时间】:2018-11-24 21:58:51
【问题描述】:
我希望从我在 html5/angular 上构建的应用程序访问移动后置摄像头。我用了
<input type="file" accept="image/*" capture="camera" /> 但是它总是打开前置摄像头而不是后置摄像头,有什么办法总是打开后置摄像头?
【问题讨论】:
标签: angular html camera android-camera
我希望从我在 html5/angular 上构建的应用程序访问移动后置摄像头。我用了
<input type="file" accept="image/*" capture="camera" /> 但是它总是打开前置摄像头而不是后置摄像头,有什么办法总是打开后置摄像头?
【问题讨论】:
标签: angular html camera android-camera
您应该能够使用 capture 属性在前置和后置摄像头之间进行选择。
对于后置摄像头:
<input type="file" accept="image/*" capture="environment">
对于前置摄像头,您应该可以使用:capture="user" 或只是捕获。
如果您愿意,可以在此处阅读更多相关信息:https://developers.google.com/web/fundamentals/media/capturing-images/
【讨论】:
还有ngx-webcam,功能不错:
【讨论】: