July- opened a new issue #503:
URL: https://github.com/apache/cordova-plugin-file/issues/503
The following code works in Android 8:
```
var onSuccess = function (e) {
console.log('onSuccess', e);
};
var onError = function (e) {
console.log('onError', e);
};
my_media = new Media(cordova.file.externalDataDirectory + 'audio.mp3',
onSuccess, onError);
my_media.startRecord();
```
However startRecord gives an error {code: 1} in Android 10.
What have I tried with same result:
```
my_media = new Media(cordova.file.cacheDirectory + 'audio.mp3', onSuccess,
onError);
my_media.startRecord();
my_media = new Media(cordova.file.applicationStorageDirectory + 'audio.mp3',
onSuccess, onError);
my_media.startRecord();
my_media = new Media(cordova.file.dataDirectory + 'audio.mp3', onSuccess,
onError);
my_media.startRecord();
```
I also tried to create file before recording:
```
resolveLocalFileSystemURL(cordova.file.externalDataDirectory , function
(entry) {
entry.getFile('audio.mp3', {
create: true,
exclusive: false
}, function (fileEntry) {
console.log('getFile', fileEntry);
my_media = new Media(cordova.file.externalDataDirectory +
'audio.mp3', onSuccess, onError);
my_media.startRecord();
}, function (err) {
console.log(err);
});
}, function (err) {
console.log(err);
});
```
The file is created but recording does not start.
Please tell if I am doing something wrong or if this plugin is not working
with Android 10+ so I will not waste my days trying to make it work.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]