basic question here that I have been unable to get an answer from.
Does navigator.mediaDevices.getUserMedia work in a hybrid app?
Let me expand on this a bit.
I have a hybrid app currently that I am trying to transition to use mainly web apis, while for the most part everything is working as expected I am unable to get the camera to be accessable in an ‘app’ form.
When I run the code
navigator.mediaDevices.getUserMedia
I get back one of two errors (depending on the hybrid framework I use)
- Dom message stating permission is denied
- Dom message stating video stream is not ready
Now, item one would indicate that the user has not ‘allowed’ permissions to the actual camera but the catch is, I never get prompted to grant permissions in-app.
For number two, that would seem to indicate that the stream is already in use (have seen some stating this too can be related to permissions so I’m leaning toward that assumption)
So I guess back to the question at hand and that is, is this even possible in a hybrid app? I have seen many of similar questions with similar Dom messages but non seem to have an answer in the sense of is it even possible? I have seen some mention setting the ‘feature-policy’ headers but in the context of a hybrid app, running a localhost how or where is this set?
Anyhow, just wanted to ask and see if anyone else has been successful in doing this or do we need to use the native plugins for this?
Thanks again!