Posted By

sondosia on 12/30/06


Tagged

music audio xanga blogs blogging songs playlist


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

yuconner


Music Playlist


 / Published in: JavaScript
 

URL: http://www.geocities.com/cheerfreak908/FAQ.htm

  1. <object id="darkplayer" codeBase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701" type="application/x-oleobject" height="0" standby="Loading Microsoft Windows Media Player components..." width="0" classid="CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95">
  2. <param NAME VALUE>
  3. <param NAME="ShowControls" VALUE="0">
  4. <param NAME="ShowStatusBar" VALUE="0">
  5. <param NAME="ShowDisplay" VALUE="0">
  6. <param NAME="DefaultFrame" VALUE="Slide">
  7. <param NAME="Autostart" VALUE="1">
  8. <param NAME="Loop" VALUE="True">
  9. </object>
  10. <form name="form">
  11. <select name="playlist" size="1">
  12. <!-- Add song info here -->
  13. <option value="0">SONG TITLE-ARTIST NAME</option>
  14. <option value="1">SONG TITLE-ARTIST NAME</option>
  15. <option value="2">SONG TITLE-ARTIST NAME</option>
  16. <option value="3">SONG TITLE-ARTIST NAME</option>
  17. <option value="4">SONG TITLE-ARTIST NAME</option>
  18. <option value="5">SONG TITLE-ARTIST NAME</option>
  19. </select><br>
  20. <input TYPE="BUTTON" NAME="darkplay" VALUE="play" OnClick="play(document.forms['form'].playlist);">
  21. <input TYPE="BUTTON" NAME="darkpause" VALUE="pause" OnClick="document.darkplayer.pause(); playstate=2;">
  22. <input TYPE="BUTTON" NAME="darkstop" VALUE="stop" OnClick="document.darkplayer.stop(); playstate=2;"></p>
  23. </form>
  24. <script language="JavaScript">
  25. <!--
  26. var playstate = 1;
  27. shuffle = 1; // Set to 0 to always play first song in list
  28. // Set to 1 to randomly choose the first song to play
  29. songs=new Array();
  30. // Add song URLs here
  31. songs[0]="SONG URL";
  32. songs[1]="SONG URL";
  33. songs[2]="SONG URL";
  34. songs[3]="SONG URL";
  35. songs[4]="SONG URL";
  36. songs[5]="SONG URL";
  37. if (shuffle == 1) {
  38. var randsg = Math.floor(Math.random()*songs.length);
  39. document.darkplayer.FileName = songs[randsg];
  40. document.darkplayer.scr = songs[randsg];
  41. document.forms['form'].playlist.options[randsg].selected = true;
  42. }
  43. function play(list) {
  44. if (playstate == 2) {
  45. document.darkplayer.Play();
  46. } else {
  47. var snum = list.options[list.selectedIndex].value
  48. document.darkplayer.FileName = songs[snum];
  49. document.darkplayer.scr = songs[snum];
  50. }
  51. playstate = 1;
  52. }
  53. //-->
  54. </script>

Report this snippet  

Comments

RSS Icon Subscribe to comments
Posted By: thanhdia on October 28, 2009

How to work on firefox ?

You need to login to post a comment.