I'm having an issue with certain MP3 files in Safari only.
Here's a codepen: https://codepen.io/parliament718/pen/ExjwWEp
In chrome, both buttons work to play both files. In safari only the first button works.
Why is this? Does safari just choke when it doesn't see a ".mp3" suffix or is it something else?
But only one of the files plays programatically using WebkitAudioContext.
Failing code:
window.webkitAudioContext.decodeAudioData(request.response, ...)
Your MP3 file isn't valid. There is multi-part form garbage at the beginning of the file. If you open it with a hex editor, you'll see it:
Anywhere else that's playing this file is simply being nice to you. :-)
Also, use audio/mpeg
for your Content-Type
header. It doesn't matter in your case since you're using the audio context to decode the data... it doesn't know what the original Content-Type
header was. I'm mention it here for others, as it's a common mistake.