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

相关推荐
yongui4783422 分钟前
实现线结构光技术的摄像机标定、光平面标定与三维重建
数码相机·平面
天才少年曾牛42 分钟前
【无标题】
android·frameworks
2601_949575861 小时前
Flutter for OpenHarmony二手物品置换App实战 - 自定义组件实现
android·javascript·flutter
、BeYourself1 小时前
动作栏 (ActionBar) 与工具栏 (Toolbar) 的基本使用
android·android-studio
zfoo-framework1 小时前
kotlin
android·开发语言·kotlin
峥嵘life1 小时前
Android16 EDLA【CTS】CtsNetTestCases存在fail项
android·java·linux·学习·elasticsearch
weixin_403810132 小时前
EasyClick iOS自动化代理IPA挂了 如何再次启动?
android·ios·自动化
银河系栋梁2 小时前
Android AIDL理解
android·运维·服务器
掘根2 小时前
【jsonRpc项目】Dispatcher模块
android·网络
独行soc2 小时前
2026年渗透测试面试题总结-10(题目+回答)
android·网络·python·安全·web安全·渗透测试·安全狮