soundcloud-visualizer icon indicating copy to clipboard operation
soundcloud-visualizer copied to clipboard

Not playing track in FireFox

Open michaelbromley opened this issue 10 years ago • 8 comments

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.

michaelbromley avatar Jan 08 '15 10:01 michaelbromley

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

chardos avatar Apr 20 '15 14:04 chardos

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

chardos avatar Apr 20 '15 14:04 chardos

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!

michaelbromley avatar Apr 21 '15 06:04 michaelbromley

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.

TimPietrusky avatar Apr 21 '15 07:04 TimPietrusky

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...

michaelbromley avatar Apr 21 '15 19:04 michaelbromley

@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.

TimPietrusky avatar Apr 21 '15 21:04 TimPietrusky

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

michaelbromley avatar Apr 22 '15 06:04 michaelbromley

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.

TimPietrusky avatar Jun 09 '15 17:06 TimPietrusky