last day (15 days later) » 

4:00 PM
1
A: Cordova: getUserMedia() no longer works on insecure origins

André DSYou can't. Using getUserMedia() is no longer supported over http:// (Unsecure Origin), It will work only over https:// (Secure Origin) For development purpose, localhost is treated as a secure origin over HTTP, so if you're able to run your server from localhost, you should be able to work on ...

 
Thanks for replying @André. I know that getUserMedia() doesn't work on HTTP. The problem here is that I am not running on http or https, but that I need it to run in a cordova mobile app. I think that there must be a way to use getUserMedia() on a cordova app.
 
Are you trying to use getUserMedia through a webview, or within cordova itself ?
 
Through the webview
 
How is your webview loaded ?
 
I am not doing anything directly about it. it's handled by the framework (Quasar).
 
4:00 PM
@FrancescoMussi ok I edited my answer.
 
Oh my god!! I wasted all day trying every possible solution and every possible cordova plugin.. and the solution was just to set https: true. Thanks Andre! Next time I better read the docs more in depth!
Actually unfortunately it works only on dev mode. After building the app doesn't work anymore.. Do you know how can I achieve the same in a production environment?
 
Hello there
Better discussing here to prevent comments spam
Once we find a solution, i'll edit my answer :)
 
Thanks!
 
So
You're trying to run your app in production mode
and you get the same insecure error on getUserMedia ?
 
Yes, I am checking how to install certificates on Cordova but could not find info about that
I will try now with a different way to get the video: https://cordova.apache.org/docs/en/latest/reference/cordova-plugin-media-capture/

And see if it works also in production
 
Thanks, interesting! I will try it right away
What should be the host? the same 0.0.0.0 ?
 
Hum
Try ?
I d'ont really know haha
 
Okay :) I will try with the same
 
Keep me posted
 
Is not working
And that plugin that I have tried is not good :( It just open the camera to record video.
 

last day (15 days later) »