【问题标题】:Behavior of Non-standard attribute "capture" in input type=file tag in AndroidAndroid 中输入类型 = 文件标记中非标准属性“捕获”的行为
【发布时间】:2013-10-09 18:02:15
【问题描述】:

我尝试使用以下方法从 Android 手机获取图像:

<input type="file" name="file_camera" accept="image/*" capture="camera" />
  • Android 2.x:capture 属性被忽略,并且允许图库和文件管理器应用程序从中进行选择。
  • Android 4.x:尊重capture 属性,允许选择相机应用程序。

如果属性不存在(&lt;input type="file" name="file_camera" accept="image/*" /&gt;),结果如下:

  • Android 2.x:只允许选择图库和文件管理器应用程序
  • Android 4.x:允许选择相机、图库和文件管理器应用程序

如何在 Android 2.x 中安装摄像头?另外,capture 属性的其他值是什么?

注意:

  • 使用默认浏览器。 Chrome 也有同样的结果。
  • 在 Firefox 中,Android 2.x 和 4.x 可以从相机、图库和文件管理器应用程序中进行选择。

【问题讨论】:

标签: android html-input


【解决方案1】:

在低级别上,您通过在 Android API lvl 8 (Android 2.2+) 中实现的 android.media.CameraProfile 类捕获图像

我认为 Mobile Safari 4(默认浏览器)没有实现捕获,因为 MS v4 在 Android 2.0+(API 级别 5+)上可用并且无法实现。

Firefox 是一个单一的低级应用程序,它可以从一个 API 级别更新到另一个 API 级别。 Android 2.x.x 的最高 API 级别为 10。

别忘了 Mobile Safari 使用 Webkit,FF - Gecko。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-05-11
    • 1970-01-01
    • 2017-07-21
    • 2016-06-19
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多