]> khamidou — GitHub mirrors - popcorn-js.git/commitdiff
[#380] API and doc updated fully
authorstevenaw <sweerdenburg@gmail.com>
Wed, 20 Apr 2011 22:16:34 +0000 (18:16 -0400)
committerstevenaw <sweerdenburg@gmail.com>
Wed, 20 Apr 2011 22:16:34 +0000 (18:16 -0400)
players/soundcloud/popcorn.soundcloud.js
players/soundcloud/popcorn.soundcloud.unit.html
players/soundcloud/popcorn.soundcloud.unit.js

index 459a6f5f0a482815c4245b72634a1efd95d8bea7..5ace125edfc1fa5a6aa4cf08d3726c8272ecabd2 100644 (file)
   *                                                     //           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()
       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",
index b7ad745a297a4fa02af65575e6ba5142d797bd05..3a94d50dfc3bd6057ba5116835248a0894356ec1 100644 (file)
@@ -36,6 +36,7 @@
   <ol id="qunit-tests"></ol>
   <div id="qunit-fixture">  </div>
   
+  <div id="commentOutput" />
   <div class="soundcloudPlayer" id="player_1" ></div>
   <div class="soundcloudPlayer" id="player_2" ></div>
   
index 129f95989df6c15d27068a922cc7334337bffc0e..4c812b0b041411c28c9497290a6098a186183050 100644 (file)
@@ -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" )