输入捕获的特征检测=视频

时间:2012-11-27 14:52:01

标签: javascript jquery html5 video-capture capture

我需要使用一个字段才能让Android和iOS用户选择用相机拍照,我用jQuery附加了输入字段,但是如何进行功能检测,所以我只向浏览器显示该字段需要那种方法代替例如flash或getUserMedia?

类似的东西,

if (navigator.captureFeature) {
 //append the input field
} else {
 //device does not support capture=camera
}

1 个答案:

答案 0 :(得分:-1)

修改:我发现了这个:

https://github.com/addyosmani/getUserMedia.js

也许这有帮助?

  

这看起来像你想要的:

     

http://www.html5rocks.com/en/tutorials/getusermedia/intro/

function hasGetUserMedia() {
  // Note: Opera is unprefixed.
  return !!(navigator.getUserMedia || navigator.webkitGetUserMedia ||
            navigator.mozGetUserMedia || navigator.msGetUserMedia);
}

if (hasGetUserMedia()) {
  // Good to go!
} else {
  alert('getUserMedia() is not supported in your browser');
}