输出

示例代码

The page shows how you can access Web Camera in the page.

HTML:

  <script>
  function onsuccess(stream){
    var url = webkitURL.createObjectURL(stream);
    var v = document.getElementById('vid');
    v.src = url;
  }

  function onerror(error){
    alert(error);
  }
  
  function onloaded(){
    navigator.webkitGetUserMedia("video", onsuccess, onerror);
  }
  </script>