I am using cordova-plugin-media-capture
and I copy pasted the sample code from ngCordova webpage in to my Ionic hybrid project.
The thing is when I click the button in my app, it opens the native recorder in the device. But when I click record the native recorder app says Insufficient space, cannot record
and returns back to my app with error code 3
.
var options = { limit: 1};
$cordovaCapture.captureAudio(options).then(function(audioData) {
// Success! Audio data is here
}, function(err) {
// An error occurred. Show a message to the user
$scope.err.msg = err;
});
I have added the following in my AndroidManifest.xml
<uses-sdk android:minSdkVersion="16" android:targetSdkVersion="22" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.RECORD_VIDEO" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
I have tested the captureImage
in the ngCordova to check if there is an issue with the SDK itself but it turns out that it works fine.