addyosmani / getUserMedia.js

Shim for getUserMedia(). Uses native implementation for modern browsers and a Flash fallback for everyone else.
MIT License
903 stars 158 forks source link

Object doesn't support property or method 'setTimeout' on IE #48

Open drazik opened 9 years ago

drazik commented 9 years ago

Hello,

I'm trying to use the fallback on IE (version 11), but I have a strange error :

Object doesn't support property or method setTimeout

It happens on line 129 of the unminified version, which is the following :

window.setTimeout(register, 1000 * (4 - run), run - 1);

Here is how I instanciate getUserMedia :

getUserMedia(_this.options.webcam, _this.initWebcamSuccess, _this.initWebcamError);
window.webcam = _this.options.webcam;

Here is my _this.options.webcam object :

{
    'audio': false,
    'video': true,
    el: 'webcam-preview',
    extern: null,
    append: true,
    noFallback: false,
    swffile: '/jscam_canvas_only.swf',
    width: 640,
    height: 480,
    mode: 'callback',
    quality: 85,
    context: 'webrtc',
    debug: function() {},
    onCapture: function() {},
    onTick: function() {},
    onSave: function(data) {},
    onLoad: function() {}
}

Can somebody guess what is happening ? Your help is precious !

IanYates commented 9 years ago

Hmm.. window.SetTimeout certainly exists in IE 11. Can you put a breakpoint just before or on that line in IE 11's F12 debugger and then type window into the console? Is it still the window object or is there some other unexpected object there?

drazik commented 9 years ago

Thank you for your answer. I can't test this by myself for the moment, but one of my coworker will try it. We will let you know asap :)

Thanks !

tennety commented 8 years ago

I ran into this issue as well when using browserify with Safari. At the mentioned line, window is just an empty object. I changed it from window.setTimeout to just setTimeout and it worked. I'm not sure whether the issue is how browserify's require is passing scope to getUserMedia or something within the library itself.

drazik commented 8 years ago

The day after I ran this issue, I went to holidays and I totally forgot to add details here. I know one of my coworkers fixed the issue but I don't know how. I will ask next monday when I meet him.

firdausshajahan commented 5 years ago

any answer from your coworker?