Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var song =
- {
- name : ['PointO' , 'Lead Cruel' , 'My Glitch' , 'Swist' , 'Piano Loop' , 'KillZone 42'],
- file : ['pointo' , 'leadcruel' , 'glitch' , 'swist' , 'pianoloop' , 'killzone42'],
- source : 'http://doggysklad.ucoz.ru',
- dir : 'music',
- format : 'mp3'
- };
- for(var a = 0 ; a <= song.file.length-1 ; a++)
- {
- 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>");
- document.write('<button onclick="');
- document.write("document.getElementById('pl"+(a+1)+"').play();");
- for(var i=0;i<song.file.length;i++)
- {
- if(a!=i)
- {
- document.write("document.getElementById('pl"+(i+1)+"').pause();");
- }
- }
- document.write('">Play</button>');
- document.write('<button onclick="');
- document.write("document.getElementById('pl"+(a+1)+"').pause();");
- document.write('">Pause</button>');
- document.write('<button onclick="');
- document.write("document.getElementById('pl"+(a+1)+"').pause();");
- document.write("document.getElementById('pl"+(a+1)+"').currentTime = 0;");
- document.write('">Stop</button></td>');
- document.write('<td><span id="pont'+(a+1)+'"></span>');
- document.write("</td></tr>");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement