Have a look at https://mydemoversion8-sandbox.mxapps.io/p/webcam, on the right bottom of the screen there is a working implementation of Camera widget, see if it works for your webcam too. Code of that project can get forked from github, if need be.
There is also an alternative on the left bottom, which is just using javascript in nanoflows. See whatever works for you.