webcamjs
webcamjs copied to clipboard
Access to camera denied in IE11
I get "Webcam.js error: Access to the camera denied" in IE 11 when running from a web server. If I run the same code on a server running at 192.168.1.x (ie local machine) in the same browser/computer, everything works fine. I checked that flash was set to ask for access, and the IE security settings were set to Medium. Webcam.js is set to force flash.
Is this a bug? It says it's denied even though the camera permission request window never appears.
Seems the issue was the SWF was not preloaded. When preloading it before initializing the webcam object it worked. Race condition?
Wow, that is very bizarre. I've never experienced that issue before. I will try to reproduce once I get my PC working again.
Thanks for the bug report. How did you preload the SWF?
Joseph Huckaby [email protected]
On Fri, Jan 22, 2016, at 01:53 PM, ErikEklund wrote:
Seems the issue was the SWF was not preloaded. When preloading it before initializing the webcam object it worked. Race condition?
— Reply to this email directly or view it on GitHub[1].
Links:
- https://github.com/jhuckaby/webcamjs/issues/148#issuecomment-174064678
Used preloadjs to preload. I tried to recreate this on a test page (only the cam with no preloader and nothing else), on two different external servers, but that worked every time. Might be that I preloaded other stuff in the background while adding the webcam, causing slower loading.
Hard to tell the exact cause of the issue. Feel free to close this bug as it's not reproducable.
I'm having the same issue, but it happens local or remote, and I'm not using preloadjs. The only strange thing is that I'm showing it from a modal
Yeah, It happens when you access domain for the first time and after clearing localStorage
I have same error message. With flash plugin and a width less than < 214px
Webcam.set({
width: 200,
...
});
It seems container is to small for Flash parameters dialog.
So in this case, flash parameter dialog is not shown. And we have an error from Webcam.js:
Access to camera is denied
I understand if it would not be fixed but it can help in case of debugging
@emhar I found that the height matters too. 137px failed, 150px worked.
I have that problem too. When I use webcam.js in my website, it works fine at first, but the error "Access to camera denied" occurs when i open the camera for the second time. I still don't know why or how to fix it. Must the swf file be placed in the same category with webcam.js? Please help me and I will be very thankful. @ErikEklund @jhuckaby
Hello everyone i fixed this issue by using preloadjs. The idea is to attach the camera when the swf file is loaded. I used preloadjs which you can download it here https://www.createjs.com/downloads.
Example
`var queue = new createjs.LoadQueue(false); queue.on("fileload", handleFileComplete); queue.loadFile('/Content/Images/webcam.swf');
function handleFileComplete(event) {
$("#video").hide();
Webcam.set({
swfURL: '/Content/Scripts/webcam.swf',
width: 320,
height: 240,
image_format: 'png',
});
Webcam.attach('#cam-video');
}`