javascript - What can I use as an alternative to the readAsDataURL method to get a base64 encoded data url -


i'm working on phonegap app , records audio , uploads audio server. code below allows me read recorded audio file , return data base64 encoded data url using readasdataurl method , display url in alert box. code works on android not on ios. documentation says in regard ios: "ios quirks encoding parameter not supported, utf8 encoding used." wondering if provide me alternative. end result same result on android, alert box displaying data url. understand alert box may not display entire url. using alert box confirmation. want variable have data url stored in it.

my code:

function gotfs(filesystem) { filesystem.root.getfile("myaudio.wav", null, gotfileentry, fail); }  function gotfileentry(fileentry) { fileentry.file(gotfile, fail); }  function gotfile(file){ readdataurl(file); }  function readdataurl(file) { var reader = new filereader(); reader.onloadend = function(evt) {     console.log("read data url");     console.log(evt.target.result);     var thefile = evt.target.result;     alert(thefile); //shows data url on android };     reader.readasdataurl(file); }  window.requestfilesystem(localfilesystem.persistent, 0, gotfs, function fail(){}); 


Comments

Popular posts from this blog

php - Submit Form Data without Reloading page -

linux - Rails running on virtual machine in Windows -

php - $params->set Array between square bracket -