crossan007 / jQuery-Photo-Uploader

jQuery Plugin for uploading local photos and capturing from a webcam
MIT License
6 stars 5 forks source link

TypeError: navigator.mediaDevices is undefined #10

Open apmuthu opened 7 years ago

apmuthu commented 7 years ago

Precede Line 219 in PhotoUploader.js with the following:

    if (!navigator.mediaDevices || !navigator.mediaDevices.enumerateDevices) {
      cameraChooser.hide();
//      console.log("enumerateDevices() not supported.");
      return cameraChooser;
    }

Ref: https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/enumerateDevices

crossan007 commented 7 years ago

This scenario should already be accomplished by function canCapture() on line 600.

I'll investigate a little more though

apmuthu commented 7 years ago

The WebConsole in FireFox (CTRL-SHIFT-K) showed the error and it appears that Line 219 gets executed before Line 600 probably based on order of function calls.

Anyway, my fix solved my issue.