From: stevenaw Date: Wed, 20 Apr 2011 22:16:34 +0000 (-0400) Subject: [#380] API and doc updated fully X-Git-Tag: v0.5~1^2~1 X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=2eb3db8982e09b7da2f3e60af0db23b5c5c8519c;p=popcorn-js.git [#380] API and doc updated fully --- diff --git a/players/soundcloud/popcorn.soundcloud.js b/players/soundcloud/popcorn.soundcloud.js index 459a6f5..5ace125 100644 --- a/players/soundcloud/popcorn.soundcloud.js +++ b/players/soundcloud/popcorn.soundcloud.js @@ -36,9 +36,11 @@ * // Defaults to the maximum possible width * height: "81px", // Optional, the height for the player. May also be as '###%' * // Defaults to 81px - * api_key: "abcdefsdfsdf", // Optional, the Soundcloud API key, required for retrieving comments - * commentdiv: "divId_for_output", // Optional, the Div Id for outputting comments. Required if comments are desired - * commentformat: function( comment ) {} // Optional, a function to format a comment. Returns HTML string + * api: { // Optional, information for Soundcloud API interaction + * key: "abcdefsdfsdf", // Required for API interaction. The Soundcloud API key + * commentdiv: "divId_for_output", // Required for comment retrieval, the Div Id for outputting comments. + * commentformat: function( comment ) {} // Optional, a function to format a comment. Returns HTML string + * } * })); * * Comments are retrieved from Soundcloud when the player is registered with Popcorn by calling the registerWithPopcorn() @@ -207,7 +209,7 @@ object_id: self._playerId, url: self.src, // Hide comments in player if showing them elsewhere - show_comments: !self._options.api_key && !self._options.commentdiv + show_comments: !self._options.api.key && !self._options.api.commentdiv }, params = { allowscriptaccess: "always", diff --git a/players/soundcloud/popcorn.soundcloud.unit.html b/players/soundcloud/popcorn.soundcloud.unit.html index b7ad745..3a94d50 100644 --- a/players/soundcloud/popcorn.soundcloud.unit.html +++ b/players/soundcloud/popcorn.soundcloud.unit.html @@ -36,6 +36,7 @@
    +
    diff --git a/players/soundcloud/popcorn.soundcloud.unit.js b/players/soundcloud/popcorn.soundcloud.unit.js index 129f959..4c812b0 100644 --- a/players/soundcloud/popcorn.soundcloud.unit.js +++ b/players/soundcloud/popcorn.soundcloud.unit.js @@ -183,8 +183,11 @@ test( "Testing Comments", function() { players = { player1: Popcorn.soundcloud( "player_1", "http://soundcloud.com/forss/flickermood" ), player2: Popcorn.soundcloud( "player_2", "http://soundcloud.com/forss/flickermood", { - commentformat: function( comment ) { - return comment.text + api: { + commentdiv: "commentOutput", + commentformat: function( comment ) { + return comment.text + } } }), player3: Popcorn.soundcloud( "player_1", "http://soundcloud.com/forss/flickermood" )