我尝试使用以下方法从 Android 手机获取图像:
<input type="file" name="file_camera" accept="image/*" capture="camera" />
- Android 2.x:
capture
忽略该属性,允许Gallery & File Manager 应用程序进行选择。 - Android 4.x:
capture
尊重属性,允许Camera应用选择。
如果该属性不存在 ( <input type="file" name="file_camera" accept="image/*" />
),结果如下:
- Android 2.x:仅允许选择图库和文件管理器应用程序
- Android 4.x:允许选择相机、图库和文件管理器应用程序
如何在 Android 2.x 中安装摄像头?另外,该属性的其他值是capture
什么?
笔记:
- 使用默认浏览器。Chrome 也有同样的结果。
- 在 Firefox 中,Android 2.x 和 4.x 可以从相机、图库和文件管理器应用程序中进行选择。