Loads a playlist using the "onReady" method and including additional arguments to return to our function.

  1. <div id="player1" data-wimpyplayer data-media="none"></div>
  2. <div id="player2" data-wimpyplayer data-media="none"></div>
  3.  
  4. <script>
  5.  
  6. // Put variables on the "widnow" scope so all functions have access to them.
  7. var p1;
  8. var p2;
  9.  
  10. // Set up a function to "ping" once the player
  11. // is set up and ready to be interacted with.
  12. function loadPlaylists(){
  13. // Set playlist on player 1
  14. p1 = wimpy.getPlayer("player1");
  15. p1.setPlaylist("../song1.mp3|../song2.mp3|../song3.mp3");
  16. // Set playlist on player 2
  17. p2 = wimpy.getPlayer("player2");
  18. p2.setPlaylist("../song3.mp3");
  19. }
  20.  
  21. // Send in our function to "ping" once wimpy is ready.
  22. wimpy.onReady(loadPlaylists);
  23.  
  24.  
  25. </script>
giItT1WQy@!-/#