zoukankan      html  css  js  c++  java
  • html5调用手机摄像头(图片可多选 限pc)

    html5自带的 input file=”” ,纯html5,并且不涉及到js ,就可以实现。代码如下:

    <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是专门用来支持多选的。

  • 相关阅读:
    wc
    wbinfo
    wall -- 向所有人的终端发送消息
    w
    vt-is-UTF8
    vmstat
    vimtutor
    vim
    centos7
    Web 在线文件管理器学习笔记与总结(8)删除文件
  • 原文地址:https://www.cnblogs.com/chancy/p/9848005.html
Copyright © 2011-2022 走看看