I am trying to play an m4a file from the cache in safari. The error first occured on iOS (it is a Meteor Cordova app, therefore it uses Safari Webview), then I realized that it can also be reproduced in Safari on desktop. I am using the following code to try and play the audio:
LocalForage.getItem(track_id, (err, value)=>{
if(err)
throw err;
//the loaded value is an arraybuffer of an m4a file
let blob = new Blob([value]);
let url = (window.URL || window.webkitURL || window || {}).createObjectURL(blob);
let testAudio = new Audio(url);
testAudio.play().then(()=>{console.log("play successful")}).catch((err)=>{console.error(err)});
});
The only error message I get is
DOMError: NotSupportedError (Message: "This operation is not supported")
If you are interested in the code used to download into the cache, it can be found in my other question, the fix for chrome provided there is implemented and working, but the testing code here is as simplified as possible.