Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

readAsDataURL promise resolve with empty data at end of data:audio/mpeg;base64, in Android target API 30 #538

Open
3 tasks done
vishal-revdiwala opened this issue Aug 30, 2022 · 2 comments

Comments

@vishal-revdiwala
Copy link

vishal-revdiwala commented Aug 30, 2022

Bug Report

Problem

What is expected to happen?

It should read file data and append after data:audio/mpeg;base64, this.

What does actually happen?

It returns only string: data:audio/mpeg;base64, there is no file base64 data.

Information

Command or Code

this.audioFilePath = this.platform.is('ios') ? this.file.dataDirectory : this.file.externalDataDirectory;

this.file.readAsDataURL(this.audioFilePath, fileName).then(base64 => {
console.log("Base64 DATA: ", base64);
}).catch(error => {
console.log("Base64 ERROR: ", error);
});

Environment, Platform, Device

"cordova-android": "^10.1.0",
"@ionic/angular": "^4.0.0",
"cordova-plugin-file": "^7.0.0",
"@angular/common": "^7.2.2",
"@angular/core": "^7.2.2",

Version information

Checklist

  • I searched for existing GitHub issues
  • I updated all Cordova tooling to most recent version
  • I included all the necessary information above
@Valdenirmezadri
Copy link

same issue

@breautek
Copy link
Contributor

Unable to reproduce with a pure cordova app.

Can a minimal reproduction app can be provided? It should not include frameworks, just a pure cordova app.

I've tested loading from:

  • internal storage, like the application directory
  • external storage like the downloads directory (written by another app), permission denied as expected
  • external storage like the external application's data directory (used the file API to copy the sound file, then read from it)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants