rejetto forum

Rawr Player question [play list construction]

0 Members and 1 Guest are viewing this topic.

Offline Sentinel

  • Occasional poster
  • *
    • Posts: 28
    • View Profile
i know the file directory is the play list i just want to know 'how' the player script constructs it's play list.

If i got that information i might be able to make a static playlist and load mp3 files from multiple directories

thx in advance


Offline TSG

  • Moderator
  • Tireless poster
  • *****
    • Posts: 1934
    • View Profile
    • RAWR-Designs
Javascript function on page load. Creates an array of id's i think.
« Last Edit: February 04, 2008, 09:16:57 AM by That_Stevens_Guy »


Offline Giant Eagle

  • Moderator
  • Tireless poster
  • *****
    • Posts: 535
  • >=3 RAWR!
    • View Profile
    • RAWR-Designs.com
Code: (Terayon.js - Line: 39) [Select]
//--Change the MP3 file.-------------------------//
function changeMP3(method) {
if (method=="shuffle") {
nr = Math.round(Math.random() * playList.length - 1);
while(boxOpen==playList[nr].boxid) nr = Math.round(Math.random() * playList.length - 1);
initPreviewBox(playList[nr].boxid,'MP3',playList[nr].name);
return false;
}
for(i=0;i<playList.length;i++) {
if(boxOpen == playList[i].boxid) {
nr = method=="next"?playList[i+1]?i+1:0:i-1>=0?i-1:playList.length-1;
initPreviewBox(playList[nr].boxid,'MP3',playList[nr].name);
return false;
}
}
}

//--Create dynamic playlist.---------------------//
function dynPL() {
var elem = document.getElementsByTagName("div");
for(i=0,j=0;i<elem.length;i++) {
if(elem[i]) if(elem[i].getAttribute("name")) if(elem[i].getAttribute("name") == "mp3File") {
playList[j] = elem[i]
playList[j].name = elem[i].firstChild.name
playList[j].boxid = elem[i].childNodes[1].id
j++;
}
}
}

These 2 functions handle the dynamic playlist..

The top one reads a file from the list and opens a preview box. The bottom one actually creates the list

:P good luck