H5 调用手机摄像机、相册功能

mac2022-06-30  18

 

<input type="file" accept="image/*" capture="camera">

<input type="file" accept="video/*" capture="camcorder">

<input type="file" accept="audio/*" capture="microphone">

 

accept表示打开的系统文件目录;

capture表示的是系统所捕获的默认设备,camera:照相机;camcorder:摄像机;microphone:录音;

还有一个属性multiple,支持多选,当支持多选时,multiple优先级高于capture,所以只用写成:<input type="file" accept="image/*" multiple>就可以。

转载于:https://www.cnblogs.com/wangEddy/p/7977675.html

相关资源:h5调用手机相册,摄像头以及文件夹
最新回复(0)