Here we're setting a link handler to over-ride and hijack the default player functionality. In this case, we want to allow users to modify the playlist by removing items.

 

  1. <script>
  2.  
  3. // A custom function to handle user clicks.
  4. function myLinkHandler(returnedItemData){
  5. // Pop up a confirmation dialog.
  6. var answer = confirm ("Are you sure you want to delete this playlist item?");
  7. // Only delete if the user is sure.
  8. if (answer){
  9. player.removePlaylistItems("i", returnedItemData.i);
  10. }
  11. }
  12.  
  13. // Create a new player
  14. var player = new wimpyPlayer({
  15. linkEnable : 1, // Turns the link icon on all the time.
  16. glyphLink : "x" // Assigning a custom icon to the link icon.
  17. });
  18.  
  19.  
  20. // Setting the "setLinkHandler" to the "myLinkHandler" function above.
  21. player.setLinkHandler(myLinkHandler);
  22.  
  23.  
  24. </script>
  25.  
  26.  
  27. Here we're setting a link handler to over-ride and hijack the default player functionality. In this case, we want to allow users to modify the playlist by removing items.
giItT1WQy@!-/#