Is there anywhere, or has anyone achieved to have, a working example of a Firefox addon (made with the firefox addon sdk, using HTML/CSS/JS) where the camera is accessed and displayed using HTML5 (with getUserMedia) in a panel.
If we try to access the camera while the panel of the addon is closed we get the error raised here : https://bugzilla.mozilla.org/show_bug.cgi?id=1007817
I can confirm I got this error too.
However if I try to access the camera once the panel is open (for eg when I click on a button inside this panel), then Firefox asks if I want to share my camera, so it seems to work, but unfortunately my <video>
element of my panel displays nothing, and the camera isn't accessed (no Firefox notification the camera is being used and my hardware LED of my laptop indicating whereas the camera is accessed remains switched off). And I have no error in the cfx console.
Taking still photos with WebRTC
https://developer.mozilla.org/en-US/docs/Web/API/WebRTC_API/Taking_still_photos
MDN - WebRTC: Still photo capture demo
http://mdn-samples.mozilla.org/s/webrtc-capturestill/
Source code
https://github.com/a2sheppy/mdn-samples/tree/master/s/webrtc-capturestill
A production example using webcam in a XULRunner based application
https://dxr.mozilla.org/comm-central/source/im/content/blist.js#633
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With