I'm creating an Audio Visualizer for a website using Canvas, but it's not appearing in Safari. I'm thinking it could be an issue with loading the audio, as the visualizer won't display until the audio loads.
Here is what I'm using to load the audio:
var request = new XMLHttpRequest();
request.open('GET', 'http://content.jwplatform.com/videos/gNilRtS6-xLS6q3Uo.m4a', true);
request.responseType = 'blob';
request.onload = function() {
audio.src = window.URL.createObjectURL(request.response);
console.log(request.response);
}
request.send();
If I navigate to the audio URL, it loads fine (and fairly quickly).
I've created a codepen example that works fine in Chrome and Firefox, but won't work in Safari: http://codepen.io/ericjacksonwood/pen/bBGEbM