Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
None
-
None
-
None
-
Android 6.0.0
Description
By adding the following to an ionic project:
In the package.json
+ "@ionic-native/media-capture": "^4.5.2",
In the config.xml
+ <plugin name="cordova-plugin-media-capture" spec="^3.0.1" />
After this a code sample like this:
var result = null; var reader = new FileReader(); reader.onloadend = function (encodedFile: any) { result = encodedFile.target.result; }; reader.onerror = function() { console.error("some error with reader") }; reader.readAsDataURL(file);
or another example:
var result = null; var reader = new FileReader(); reader.onload = function() { result=reader.result; }; reader.onerror = function() { console.error("some error with reader") }; //reader.readAsDataURL(file); //reader.readAsBinaryString(file); reader.readAsArrayBuffer(file)
In all cases result is not defined. No errors are emitted.