michaelbromley / soundcloud-visualizer

Audio visualization with web audio API, canvas & the SoundCloud API
http://www.michaelbromley.co.uk/experiments/soundcloud-vis/
MIT License
450 stars 114 forks source link

Not playing track in FireFox #3

Open michaelbromley opened 9 years ago

michaelbromley commented 9 years ago

Used to work fine. I was recently made aware that it doesn't play anymore. No error message in console. Album art loads, which means API call to SoundCloud is working ok. Track data seems to buffer judging by visual cue on the player control, but playback doesn't start, even when pressing the play button.

chardos commented 9 years ago

This one's been stumping me too. Any progress on this?

chardos commented 9 years ago

Awesome visualiser by the way. After reading your tutorial I'm attempting one now combined with three.js to get create some 3d visuals.

michaelbromley commented 9 years ago

Hi - thanks! No, I've not done anything on this issue, although I read somewhere recently that Firefox does not allow remote sources for Web Audio, so this may well be the issue. More info here: http://stackoverflow.com/questions/28984883/cannot-analyse-soundclouds-streaming-audio-because-of-the-lack-of-cors-policy

Someone suggests a solution here - I've not time to test this out right now but if you get it to work, please let me know!

TimPietrusky commented 9 years ago

Yes, the solution is:

audioElement.crossOrigin = "anonymous";

You can find more informations about it on MDN - CORS settings attributes.

This is also a "problem" in Chrome >= 42.

michaelbromley commented 9 years ago

Thanks @TimPietrusky. Just noticed that Chrome had updated to v42 on my machine and the visualization stopped working there too. Adding the line you suggest fixes it, but not for every track.

Needs more investigation...

TimPietrusky commented 9 years ago

@michaelbromley can you give me a track URL that's not working? Because I'm using the fix in my project and it's working for every track I try.

michaelbromley commented 9 years ago

Yeah try this: https://soundcloud.com/muse/undisclosed-desires

TimPietrusky commented 9 years ago

I debugged this again and I found out that some of the SoundCloud streaming servers are not sending the CORS-header to allow cross-origin access.

The CORS-problem was reported to SoundCloud one month ago.