diff --git a/player/soundcloud.coffee b/player/soundcloud.coffee new file mode 100644 index 00000000..eb45ec5f --- /dev/null +++ b/player/soundcloud.coffee @@ -0,0 +1,105 @@ +window.SoundCloudPlayer = class SoundCloudPlayer extends Player + constructor: (data) -> + if not (this instanceof SoundCloudPlayer) + return new SoundCloudPlayer(data) + + @setMediaProperties(data) + + waitUntilDefined(window, 'SC', => + removeOld() + + # For tracks that are private, but embeddable, the API returns a + # special URL to load into the player. + # TODO: rename scuri? + if data.meta.scuri + soundUrl = data.meta.scuri + else + soundUrl = data.id + + widget = $('