HTML5访问调用手机相机、相册功能
来源:网络 作者:佚名 日期:2024-12-13
直接放代码(以下代码为亲测得出的结果):
<input type="file" accept="image/*" capture="camera">安卓和IOS都为:拍照
? ? <input type="file" accept="video/*" capture="camcorder">安卓和IOS都为:录像
? ? <input type="file" accept="audio/*" capture="microphone">安卓为录音(ios视频或照片)
? ? <input type="file" accept="image/*">安卓为相机或照片(ios为拍照或图库2)
?<input type="file" accept="video/*">安卓为录像或视频录--(ios为录像或照片图库【照片图库已做筛选,全是视频】)
? ? <input type="file" accept="audio/*">安卓为录音机音乐之类的(ios为拍照或录像【包含视频和照片】)
accept?表示打开的系统文件目录;
? ? ? ? ?--camera:照相机;
--camcorder:摄像机;
--microphone:录音。
? ? ? ? 如果不加上capture,则只会显示相应的,例如上述三种依次是:拍照或图库,录像或图库,录像或拍照或图库,加上capture之后不会调用图库。
当支持多选时,multiple优先级高于capture,所以只用写成:
<input type="file" accept="image/*" multiple>就可以。
IOS系统是不能访问录音,安卓全都可以正常访问。
相关文章
- 2025-01-08 照妖镜
- 2025-01-08 识花PictureThis中文版
- 2024-12-13 HTML5访问调用手机相机、相册功能
- 2024-12-13 全民识花_1
- 2024-11-26 图像识别,这几款软件简单好用!