Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

getUserMedia Android Webview Ionic

I'm trying to do some basic things by getting an Android device's camera stream with getUserMedia. To my understanding, this should be supported on Android Lollipop, which I'm running, but even with permissions set to allow video and audio my request for a media stream is automatically denied.

So I tried using Crosswalk with Ionic, and I can get the media stream. The data is just empty. To my understanding this should be supported. Does anyone else have experience with getting camera video stream data with Cordova / Ionic?

like image 282
Jack Guy Avatar asked Dec 09 '22 04:12

Jack Guy


1 Answers

Make sure that you have RECORD_AUDIO and CAMERA permissions in platforms/android/AndroidManifest.xml:

<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.CAMERA" />

Cordova takes care about necessary permissions for Cordova API and adds them into manifest file, but it doesn't for HTML5 API.

like image 84
oaleynik Avatar answered Dec 11 '22 09:12

oaleynik