ionic-video-call
ionic-video-call copied to clipboard
Error! getUserMedia error: NotReadableError in android device
Issue: getUserMedia error: NotReadableError in android device
Description: I have created .apk file from this example by ionic cordova build android command
and when I am trying to login with name r1 it's return error.
Screenshot:

package.json
"@ionic/angular": "^5.0.0", "cordova-android": "^8.1.0", "core-js": "^2.5.4", "peerjs": "^1.2.0", "rxjs": "~6.5.1", "tslib": "^1.10.0", "zone.js": "~0.10.2"
Make sure you have permission to access camera and microphone. Check your config.Xml. or maybe camera is using by another app. usually this error happening when camera is using by another app like you are using webcam in chrome and want to open webcam in firefox too in the same time.
@timsar2 I have write a code for AndroidPermission But after allow permission and trying to login in device It returns same issue.

Code in app.components.ts
initializeApp() {
this.platform.ready().then(() => {
this.androidPermissions.checkPermission(this.androidPermissions.PERMISSION.CAMERA).then(
result => console.log('Has permission?',result.hasPermission),
err => this.androidPermissions.requestPermission(this.androidPermissions.PERMISSION.CAMERA)
);
this.androidPermissions.requestPermissions([this.androidPermissions.PERMISSION.CAMERA, this.androidPermissions.PERMISSION.GET_ACCOUNTS]);
this.statusBar.styleDefault();
this.splashScreen.hide();
});
}
@timsar2 I have write a code for AndroidPermission But after allow permission and trying to login in device It returns same issue.
Code in app.components.ts
initializeApp() { this.platform.ready().then(() => { this.androidPermissions.checkPermission(this.androidPermissions.PERMISSION.CAMERA).then( result => console.log('Has permission?',result.hasPermission), err => this.androidPermissions.requestPermission(this.androidPermissions.PERMISSION.CAMERA) ); this.androidPermissions.requestPermissions([this.androidPermissions.PERMISSION.CAMERA, this.androidPermissions.PERMISSION.GET_ACCOUNTS]); this.statusBar.styleDefault(); this.splashScreen.hide(); }); }
What about record? Add request permission and uses-feature to config.xml too.
<platform name="android">
<config-file parent="/manifest" target="AndroidManifest.xml" xmlns:android="http://schemas.android.com/apk/res/android">
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-feature android:name="android.hardware.camera" android:required="true" />
<uses-feature android:name="android.hardware.microphone" android:required="true" />
</config-file>
...
</platform>