From 480497bea48a7200cdbdc4c3d7467d95dd7a2224 Mon Sep 17 00:00:00 2001 From: calzoneman Date: Tue, 16 Jun 2015 07:39:39 -0400 Subject: [PATCH] Initial soundcloud implementation --- player/soundcloud.coffee | 105 +++++++++++++ player/update.coffee | 1 + www/js/player-new.js | 126 ++++++++++++++- www/js/sc.js | 331 +-------------------------------------- 4 files changed, 231 insertions(+), 332 deletions(-) create mode 100644 player/soundcloud.coffee 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 = $('