soundcloud / soundcloud-custom-player

The SoundCloud custom javascript based player
http://soundcloud.com
704 stars 231 forks source link

added logic to abort applying the scPlayer() if the source element has already had an scPlayer assigned #58

Open lvl99 opened 11 years ago

lvl99 commented 11 years ago

I found through some dodgy JS code of my own that multiple calls of scPlayer() on a source element weren't being aborted if the scPlayer() functionality was already applied. This resulted in the internal links of the generated scPlayer() element (such as #play, #pause, #info, etc.) to then try to be referenced as scApiUrl()s which then resulted in errors and no media being loaded.

I think ideally all the var setting logic which involves DOM-crawling would follow the abort code so as to lower any further unnecessary overheads.