Advertisement
Guest User

Untitled

a guest
Aug 28th, 2014
218
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.                 var song =
  2.                 {
  3.                     name : ['PointO' , 'Lead Cruel' , 'My Glitch' , 'Swist' , 'Piano Loop' , 'KillZone 42'],
  4.                     file : ['pointo' , 'leadcruel' , 'glitch' , 'swist' , 'pianoloop' , 'killzone42'],
  5.                     source : 'http://doggysklad.ucoz.ru',
  6.                     dir : 'music',
  7.                     format : 'mp3'
  8.                 };
  9.                     for(var a = 0 ; a <= song.file.length-1 ; a++)
  10.                     {
  11.                         document.write("<tr><td style='background-color:rgb(180,180,255);'><b>"+(a+1)+"</b></td><td>"+song.name[a]+"</td><td><audio id='pl"+(a+1)+"' src='"+song.source+"/"+song.dir+"/"+song.file[a]+"."+song.format+"'></audio>");
  12.                         document.write('<button onclick="');
  13.                             document.write("document.getElementById('pl"+(a+1)+"').play();");
  14.                                 for(var i=0;i<song.file.length;i++)
  15.                                 {
  16.                                     if(a!=i)
  17.                                     {
  18.                                         document.write("document.getElementById('pl"+(i+1)+"').pause();");
  19.                                     }
  20.                                 }
  21.                                
  22.                         document.write('">Play</button>');
  23.                        
  24.                         document.write('<button onclick="');
  25.                             document.write("document.getElementById('pl"+(a+1)+"').pause();");
  26.                         document.write('">Pause</button>');
  27.                        
  28.                         document.write('<button onclick="');
  29.                             document.write("document.getElementById('pl"+(a+1)+"').pause();");
  30.                             document.write("document.getElementById('pl"+(a+1)+"').currentTime = 0;");
  31.                         document.write('">Stop</button></td>');
  32.                         document.write('<td><span id="pont'+(a+1)+'"></span>');
  33.                         document.write("</td></tr>");
  34.                     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement