docs: function onSuccess(stream) {
            videoStream = stream;
  
            if (window.hasModernUserMedia) {
              videoElem.srcObject = stream;
            } else if (navigator.mozGetUserMedia) {
              // Firefox supports a src object
              videoElem.mozSrcObject = stream;
            } else {
              var vendorURL = window.URL || window.webkitURL;
              videoElem.src = vendorURL.createObjectURL(stream);
            }
  
            /* Start playing the video to show the stream from the webcam */
            videoElem.play();
            $scope.config.video = videoElem;
  
            /* Call custom callback */
            if ($scope.onStream) {
              $scope.onStream({stream: stream});
            }
          }