code: function startVideoStreaming(callback, options) {
  
          options = options || {};
  
          var noGUMSupportTimeout;
          var timeoutLength = options.timeout !== undefined ? options.timeout : 0;
  
          if(navigator.getMedia) {
  
              // Some browsers apparently have support for video streaming because of the
              // presence of the getUserMedia function, but then do not answer our
              // calls for streaming.
              // So we'll set up this timeout and if nothing happens after a while, we'll
              // conclude that there's no actual getUserMedia support.
              if(timeoutLength > 0) {
                  noGUMSupportTimeout = setTimeout(onStreamingTimeout, 10000);
              }
  
              startStreaming(function() {
  
                      // ERROR!!!
                      callback(new Error('getUserMedia cannot access the camera'));
  
                  }, function() {
                      
                      // The streaming started somehow, so we can assume /there is/
                      // gUM support
                      clearTimeout(noGUMSupportTimeout);
  
                  }, function(stream, videoElement, width, height) {
  
                      // Keep references, for stopping the stream later on.
                      cameraStream = stream;
                      video = videoElement;
  
                      callback(null, stream, videoElement, width, height);
  
                  }
              );
  
          } else {
  
              callback(new Error('Native device media streaming (getUserMedia) not supported in this browser.'));
  
          }
  
  
          function onStreamingTimeout() {
              callback(new Error('Timed out while trying to start streaming'));
          }
  
      }
docs: Try to initiate video streaming, and transparently handle cases
  where that is not possible (includes 'deceptive' browsers, see inline
  comment for more info)