我期待从我在html5 / angular上构建的应用程序访问移动后置摄像头。我使用<input type="file" accept="image/*" capture="camera" />
但它总是打开前置摄像头而不是后置摄像头,有没有办法打开后置摄像头?
您应该能够使用捕获属性在前后摄像头之间进行选择。
对于后置摄像头:
<input type="file" accept="image/*" capture="environment">
对于前置摄像头,您应该可以使用:capture="user"
或只是捕获。
如果您愿意,可以在这里阅读更多相关内容:https://developers.google.com/web/fundamentals/media/capturing-images/