html input 上capture 参数在 安卓 苹果上的异同

安卓上

<input type="file" accept="image/*" capture="camera"> //只调用相机
<input type="file" accept="video/*" capture="camcorder">//只调用摄像机
<input type="file" accept="audio/*" capture="microphone">//只调用录音设备

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

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

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

苹果上

全部都是直接调用相机,就是安卓才会有这些花里胡哨的东西


原文地址:https://www.cnblogs.com/wrhbk/p/11151794.html