html5调用手机摄像头 && 震动

 <input type="file" accept="image/*" capture="camera">
<input type="file" accept="image/gif,image/jpeg" capture="camera"> <input type="file" accept="video/*" capture="camcorder"> <input type="file" accept="audio/*" capture="microphone">
<input type="file" accept="image/*" multiple>(multiple 多选)
<input type="file" multiple>

capture表示,能够捕获到系统默认的设备,好比:camera--照相机;camcorder--摄像机;microphone--录音。
 web

震动浏览器

var vibrateSupport = "vibrate" in navigator;
    if (vibrateSupport) { //兼容不一样的浏览器
        document.getElementById('div').innerHTML='yes';
        navigator.vibrate = navigator.vibrate || navigator.webkitVibrate || navigator.mozVibrate || navigator.msVibrate;
        navigator.vibrate([1000, 500, 1000, 500, 1000, 500, 1000, 500, 1000, 500, 1000, 500, 1000, 500]);
      //  navigator.vibrate(3000)
    }else{
        document.getElementById('div').innerHTML='no';
    }
相关文章
相关标签/搜索