From 68b2e4a8a14c871d3e172077b22b5ae0ee8922b0 Mon Sep 17 00:00:00 2001 From: Jacek Tomaszewski Date: Thu, 11 Jun 2015 17:02:34 +0200 Subject: [PATCH 1/2] Extract soundcloud's client_id to a Popcorn.SOUND_CLOUD_CLIENT_ID variable --- wrappers/soundcloud/popcorn.HTMLSoundCloudAudioElement.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/wrappers/soundcloud/popcorn.HTMLSoundCloudAudioElement.js b/wrappers/soundcloud/popcorn.HTMLSoundCloudAudioElement.js index 904e7d4d0..e6b56d065 100644 --- a/wrappers/soundcloud/popcorn.HTMLSoundCloudAudioElement.js +++ b/wrappers/soundcloud/popcorn.HTMLSoundCloudAudioElement.js @@ -20,7 +20,7 @@ // XXX: SoundCloud won't let us use real URLs with the API, // so we have to lookup the track URL, requiring authentication. SC.initialize({ - client_id: "PRaNFlda6Bhf5utPjUsptg" + client_id: Popcorn.SOUND_CLOUD_CLIENT_ID }); var i = scCallbacks.length; @@ -701,4 +701,6 @@ return type === "audio/x-soundcloud" ? "probably" : EMPTY_STRING; }; + Popcorn.SOUND_CLOUD_CLIENT_ID = Popcorn.SOUND_CLOUD_CLIENT_ID || "PRaNFlda6Bhf5utPjUsptg"; + }( Popcorn, window, document )); From 67f2eaa00fa3ae3ee8900f46d10e60a4edc44e5a Mon Sep 17 00:00:00 2001 From: Jacek Tomaszewski Date: Thu, 11 Jun 2015 17:04:34 +0200 Subject: [PATCH 2/2] Extract soundcloud's js urls to Popcorn.SOUND_CLOUD_SDK_JS and Popcorn.SOUND_CLOUD_API_JS variables ... so we can replace the soundcloud js url, if we want to use our custom, forked version of their sdk --- wrappers/soundcloud/popcorn.HTMLSoundCloudAudioElement.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/wrappers/soundcloud/popcorn.HTMLSoundCloudAudioElement.js b/wrappers/soundcloud/popcorn.HTMLSoundCloudAudioElement.js index e6b56d065..14a0461ff 100644 --- a/wrappers/soundcloud/popcorn.HTMLSoundCloudAudioElement.js +++ b/wrappers/soundcloud/popcorn.HTMLSoundCloudAudioElement.js @@ -13,8 +13,8 @@ function isSoundCloudReady() { // If the SoundCloud Widget API + JS SDK aren't loaded, do it now. if( !scLoaded ) { - Popcorn.getScript( "https://w.soundcloud.com/player/api.js", function() { - Popcorn.getScript( "https://connect.soundcloud.com/sdk.js", function() { + Popcorn.getScript( Popcorn.SOUND_CLOUD_API_JS, function() { + Popcorn.getScript( Popcorn.SOUND_CLOUD_SDK_JS, function() { scReady = true; // XXX: SoundCloud won't let us use real URLs with the API, @@ -702,5 +702,7 @@ }; Popcorn.SOUND_CLOUD_CLIENT_ID = Popcorn.SOUND_CLOUD_CLIENT_ID || "PRaNFlda6Bhf5utPjUsptg"; + Popcorn.SOUND_CLOUD_SDK_JS = Popcorn.SOUND_CLOUD_SDK_JS || "https://connect.soundcloud.com/sdk.js"; + Popcorn.SOUND_CLOUD_API_JS = Popcorn.SOUND_CLOUD_API_JS || "https://w.soundcloud.com/player/api.js"; }( Popcorn, window, document ));