h5调用相机相册

我们利用input 输入框 ,把type属性改为file, 然后调用系统默认相机,摄像,系统相册。

accept:表示要打开的文件类型      capture:表示可以捕获到系统默认的设备

< input type="file" accept="image/*" capture="camera">   相机
 
< input type="file" accept="video/*" capture="camcorder">  录像
 
< input type="file" accept="audio/*" capture="microphone">  录音
 
< input type="file" accept="image/*" multiple>   多选
扫码体验

猜你喜欢

转载自www.cnblogs.com/xiaocuncheng/p/11322025.html
今日推荐