title: How to access webcam in Safari and IE? Are there alternatives to getUserMedia?
body: <p>I am currently accessing webcam in javascript, then streams to browsers using getUserMedia, <a href="http://caniuse.com" rel="nofollow">caniuse.com</a> shows that Safari and Internet Explorer 11 and above are not able to access getUserMedia. </p>
  
  <p>I use this to check if there is a webcam,</p>
  
  <pre><code>navigator.getUserMedia  =   navigator.getUserMedia ||
                              navigator.webkitGetUserMedia ||
                              navigator.mozGetUserMedia ||
                              navigator.msGetUserMedia;
  </code></pre>
  
  <p>Then I display using this</p>
  
  <pre><code>if (navigator.getUserMedia){
      //document.getElementById("webcam").style.display = "block";
  
      window.addEventListener("DOMContentLoaded", function() {
          // Grab elements, create settings, etc.
          var canvas = document.getElementById("canvas"),
              context = canvas.getContext("2d"),
              video = document.getElementById("video"),
              videoObj = { "video": true },
              errBack = function(error) {
                  console.log("Video capture error: ", error.code);
              };
  
          // Put video listeners into place
          if(navigator.getUserMedia) { // Standard
              navigator.getUserMedia(videoObj, function(stream) {
                  video.src = stream;
                  video.play();
              }, errBack);
          }
          else if(navigator.webkitGetUserMedia) { // WebKit-prefixed
              navigator.webkitGetUserMedia(videoObj, function(stream){
                  video.src = window.webkitURL.createObjectURL(stream);
                  video.play();
              }, errBack);
          }
          else if(navigator.mozGetUserMedia) { // Firefox-prefixed
              navigator.mozGetUserMedia(videoObj, function(stream){
                  video.src = window.URL.createObjectURL(stream);
                  video.play();
              }, errBack);
          }
          // Trigger photo take
          document.getElementById("snap").addEventListener("click", function() {
              context.drawImage(video, 0, 0, 640, 480);
              canvasToDataURLString = canvas.toDataURL();
              var blob = dataURItoBlob(canvasToDataURLString);
              base64result = canvasToDataURLString.split(',')[1];
              //console.debug(base64result);
              document.getElementById("base64result").innerHTML = base64result;
  
          });
      }, false);
  }
  </code></pre>
  
  <p>Or there simply is no way of accessing webcam using IE and safari?
  I understand there are limitations in Chrome as the webpage has to be accessed from a secure origin.</p>
  
  <ol>
  <li>I wonder if I am doing it wrongly...</li>
  <li>I want to know if there are any other alternatives to getUserMedia!</li>
  </ol>
  
  <p>Thank you and please be kind, I have already tried googling and nth much came out, I am just seeking for alternatives, if it is really impossible, then ok.</p>