首页 > 技术文章 > input type=‘file’方法

lljun 2019-12-19 10:53 原文

使用input:file标签, 去调用系统默认相机,摄像,录音功能,使用capture属性,直接说明需要调用什么功能

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

accept表示,直接打开系统文件目录。

转载:SoftBlue的博客

推荐阅读