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--录音。

相关推荐
沐言人生20 小时前
React Native 源码分析1——HybridData 机制深度分析
android·react native
程序员陆业聪20 小时前
跨平台框架全景图:Flutter/KMP/KuiKly/RN的2026年格局
android
꯭爿꯭巎꯭21 小时前
root环境检测软件(环境检测工具大全root )Nativetest
智能手机·安卓
码云数智-园园1 天前
Fibers(纤程)来了:打破阻塞,实现纯PHP下的异步非阻塞IO
android
shaoming37761 天前
检查系统硬件配置是否满足PyCharm最低要求
android·spring boot·mysql
一起搞IT吧1 天前
高通Camx功能feature分析之十五:insensor zoom介绍及实现
android·智能手机·相机
aqi001 天前
一文读懂 HarmonyOS 6.1 带来的十大重要升级
android·华为·harmonyos·鸿蒙·harmony
老黄编程1 天前
大型工地实时数据处理与三维重构系统方案(极简中心化部署版)
人工智能·数码相机·计算机视觉·大数据处理·入侵检测·三维重构
秋91 天前
MySQL 9.7.0 使用详解:新特性、实战与避坑指南
android·数据库·mysql
狼与自由1 天前
clickhouse ReplacingMergeTree
android·clickhouse