Cordova - Playing audio from blob

Viewed 219

I have a following problem. I have a web based application that im referencing though an iframe in ym cordova app. I communicate iwth it via a postMessage. The problem I currently have is that i cannot play an audio from a blob. here is my code in my cordova's index.js on message handler (whic is properly invoked with correct params):

try {
    var audio = new Audio();
    audio.src = URL.createObjectURL(e.data);

    alert(audio.src);

    audio.play()
    .then(function(res){
        alert('oki');
    })
    .catch(function (err) { alert(err) });

}
catch(err) {
    alert(err);
}

The error im getting is: NotSupportedError: Failed to load because no supported source was found, even though the src of an audio element is blob:file:///xxx(where xxx is a long string).

0 Answers
Related