h5页面上传图片安卓手机无法调用摄像头

<input type=”file”>

在ios中,会

 

而安卓中,没有这些选项

解决方法:

给input 加上accept属性

<input type=”file” accept=”image/*” /> //调用相机 ,图片或者相册 (两者都行)

加上了capture=camera”属性之后安卓手机就直接调用了相机,没有了图库的选项

<input type=”file” accept=”image/*;capture=camera”> //直接调用相机

<input type=”file” accept=”video/*;capture=camcorder”> // 调取视频

<input type=”file” accept=”audio/*;capture=microphone”> //调取音频

注:capture表示,可以捕获到系统默认的设备,比如:camera–照相机;camcorder–摄像机;microphone–录音。

相关推荐

  1. H5调用原生相机API案例

    2024-06-14 11:48:09       51 阅读
  2. uni-app-H5页面调用设备摄像头扫描二维码

    2024-06-14 11:48:09       28 阅读
  3. uni-app H5图片压缩体积大小

    2024-06-14 11:48:09       32 阅读

最近更新

  1. docker php8.1+nginx base 镜像 dockerfile 配置

    2024-06-14 11:48:09       94 阅读
  2. Could not load dynamic library ‘cudart64_100.dll‘

    2024-06-14 11:48:09       101 阅读
  3. 在Django里面运行非项目文件

    2024-06-14 11:48:09       82 阅读
  4. Python语言-面向对象

    2024-06-14 11:48:09       91 阅读

热门阅读

  1. React native新架构组成

    2024-06-14 11:48:09       26 阅读
  2. hive split 特殊用法

    2024-06-14 11:48:09       29 阅读
  3. k8s 证书更新

    2024-06-14 11:48:09       32 阅读
  4. Cesium4Unreal - # 009 直接加载显示shapefile

    2024-06-14 11:48:09       35 阅读
  5. 对iOS开发中的链接器ld64和-ld_classic的深入理解

    2024-06-14 11:48:09       39 阅读
  6. 策略模式(设计模式)

    2024-06-14 11:48:09       28 阅读
  7. apex触发器满足条件时弹出对话框

    2024-06-14 11:48:09       30 阅读
  8. TCP标志

    2024-06-14 11:48:09       33 阅读
  9. ISBN查询图书api接口

    2024-06-14 11:48:09       30 阅读
  10. XXE漏洞详解:从基础到防御

    2024-06-14 11:48:09       32 阅读
  11. Python爬虫获取古诗文网中的古诗文

    2024-06-14 11:48:09       26 阅读