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

相关推荐
bianshaopeng1 小时前
android 原生加载pdf
android·pdf
hhzz1 小时前
Linux Shell编程快速入门以及案例(Linux一键批量启动、停止、重启Jar包Shell脚本)
android·linux·jar
火红的小辣椒2 小时前
XSS基础
android·web安全
勿问东西4 小时前
【Android】设备操作
android
五味香4 小时前
C++学习,信号处理
android·c语言·开发语言·c++·学习·算法·信号处理
摇曳的树5 小时前
【3D目标检测】激光雷达和相机联合标定(一)——ROS同步解包
数码相机·目标检测·3d
图王大胜6 小时前
Android Framework AMS(01)AMS启动及相关初始化1-4
android·framework·ams·systemserver
工程师老罗8 小时前
Android Button “No speakable text present” 问题解决
android
小雨cc5566ru9 小时前
hbuilderx+uniapp+Android健身房管理系统 微信小程序z488g
android·微信小程序·uni-app
小雨cc5566ru10 小时前
微信小程序hbuilderx+uniapp+Android 新农村综合风貌旅游展示平台
android·微信小程序·uni-app