ToneDen / Player

A pure JS customizable audio player for SoundCloud.
toneden.io/player
MIT License
529 stars 77 forks source link

Certain tracks crash the player ('undefined' is not an object (evaluating 'url.indexOf')) #21

Closed shazzy89 closed 10 years ago

shazzy89 commented 10 years ago

Embedding certain tracks from soundcloud will crash the player.

TypeError: 'undefined' is not an object (evaluating 'url.indexOf') toneden.js line 24447: if (url.indexOf('secret_token') === -1) { url += '?'; } else { url += '&'; }

I have not been able to find a pattern yet, at first i was suspecting it might have to do with the naming of the tracks "A1. ...", however this turned out to be a false assumption.

e.g. these track will crash toneden: https://soundcloud.com/tresorberlin/a1-scan-7-the-resistance https://soundcloud.com/tresorberlin/a1-terrence-dixon-light-of-day

yet this one works flawless: https://soundcloud.com/tresorberlin/a1-acronym-nabu-1

shazzy89 commented 10 years ago

Ah I think I figured it out! The tracks that cause the issue have streaming disabled on soundcloud (yet are public): <streamable type="boolean">false</streamable>

So maybe it would be a good idea to check against this and exclude these tracks from crashing the player.

elsbree commented 10 years ago

Changes that fix this are deployed.