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

 

<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>就可以。

posted @ 2017-12-04 16:26  wangEddy  阅读(706)  评论(0编辑  收藏  举报