## 在webapp上使用input:file, 指定capture属性调用默认相机,摄像,录音功能

在iOS6下开发webapp,使用inputz之file,很有用

<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表示,直接打开系统文件目录。

其实html5的input:file标签还支持一个multiple属性,表示可以支持多选,如:

<input type="file" accept="image/*" multiple>

加上这个multiple后,capture就没啥用了,因为multiple是专门yong用来支持多选的。

相关文章:

  • 2021-11-07
  • 2022-12-23
  • 2021-11-17
  • 2021-12-19
  • 2021-08-18
  • 2022-01-25
  • 2022-12-23
  • 2021-10-16
猜你喜欢
  • 2022-12-23
  • 2021-12-03
  • 2022-03-05
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案