Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

215
Views
Does navigator.mediaDevices.getUserMedia work on hybrid apps?

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)

  1. Dom message stating permission is denied
  2. 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!

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Yes, it’s possible to use it, I have a sample app that uses it https://github.com/jcesarmobile/can-i-use-on-webview/tree/master/getusermedia

You have to provide certain permissions on android and add certain usage descriptions on iOS.

The example app only provides camera permission/usage description because it doesn’t capture audio.

Doesn’t work on all iOS versions, I think the first version to support it was 14.5.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!