jhuckaby / webcamjs

HTML5 Webcam Image Capture Library with Flash Fallback
MIT License
2.49k stars 1.11k forks source link

webcamjs for TWO web cameras? #47

Open myongjailee opened 9 years ago

myongjailee commented 9 years ago

webcamjs is very useful for my web project. Is there any way to control TWO webcams installed in a computer? thanks

jhuckaby commented 9 years ago

Hmmm, you might be able to make this work by running WebcamJS in two separate IFRAMEs. Not sure tho -- the library is designed as a singeton, so only one may exist in each DOM space. Sorry this isn't easier :(

myongjailee commented 9 years ago

Thanks a lot for your reply. I was able to make two frames like camera1, camera2. And I created two objects of webcam like webcam1 and webcam2 by slightly modifying the webcam.js file. Each webcam object works well, ie. takes photo, uploads to server. except the callback_function. it seems the webcam object does not receive the flash_notify during the initialization. I used the JPEGCam v1.0.9 script. thanks again,

positlabs commented 9 years ago

This is related to #63. If we rewrite a few parts of the lib, it could potentially be used as a module and support multiple instances.