0

As I asked previously that I am doing a webcam application.

I can detect the browser supports webcam or not using getUserMedia as navigator.webkitGetUserMedia. But Some time the computer doesn't have webcam then too usermedia is true. I am using webcam.js framework for it.

How to get to know that the computer not supported webcam before processing webcam application code?

              this.mediaDevices.getUserMedia({
                "audio": false,
                "video": this.params.constraints || {
                    mandatory: {
                        minWidth: this.params.dest_width,
                        minHeight: this.params.dest_height
                    }
                }
            })
            .then( function(stream) {
                // got access, attach stream to video
                alert(12);
                video.src = window.URL.createObjectURL( stream ) || stream;
                self.stream = stream;
                self.loaded = true;
                self.live = true;
                self.dispatch('load');
                self.dispatch('live');
                self.flip();
            })
            .catch( function(err) {
                return self.dispatch('error', "Could not access webcam: " + err.name + ": " + err.message, err);
            });

If webcam is not there then catch block is catching but how to catch manually?

Joe
  • 479
  • 3
  • 8
  • 31
  • 1
    have you tried this answer http://stackoverflow.com/questions/23288918/check-if-user-has-webcam-or-not-using-javascript-only – navnit Jun 03 '16 at 05:18
  • Possible duplicate of [How can I check if user has a webcam or not?](http://stackoverflow.com/questions/20641213/how-can-i-check-if-user-has-a-webcam-or-not) – Rohit416 Jun 03 '16 at 06:16

0 Answers0