Log In · Register

 
playlist issues, something wrong with code
TheYellowDart_06
post Sep 5 2005, 04:52 PM
Post #1


Newbie
*

Group: Member
Posts: 5
Joined: Sep 2005
Member No: 226,670



Ok, I suddenly have a problem with my player on my Xanga. I added a few more songs today to my playlist, no big deal, I change it all the time; but something went terribly wrong and I'm not sure how. I believe it must be something wrong with the last few lines of code, seeing as how they show up at the bottom of my Xanga page now. I've noticed that the player no longer automatically plays the next song (whether the shuffle is on or off) as it formerly did. I know hardly anything about coding, so any help on this issue would be greatly appreciated. Below is my page, and below that is the block of code I'm having problems with. I believe the error in the code is isolated in that chunk, but if needed, I can paste the entire media player code on here

My Webpage



// Description: This is an interupt handler used to handle instances when the
// state of the player changes to play or stop for example.

//STATE.innerText = NewState;

switch(NewState){
case 8: // Handles player after it just finishes playing through a song
var num = document.forms['form'].playlist.selectedIndex;

if (!shuffle){
if(num == document.forms['form'].playlist.length-1){
num = -1;
}

num++;
}
else {
var temp;
do{
temp = Math.floor(Math.random()*songs.length);
} while(temp == num);
num = temp;
}

document.forms['form'].playlist.options[num].selected = true;

PreviousState = NewState;
break;

case 1: // Handles player after it stops
if(PreviousState == 8){
var num = document.forms['form'].playlist.selectedIndex;
Player.settings.autoStart = true;
Player.url = songs[num];
PreviousState = NewState;
}

else if (PreviousState != 3 && PreviousState != 2){
Player.controls.Play();
Player.settings.autoStart = false;
}

else{
forms['form'].PlayPauseButton.innerHTML = PlayHTML.innerHTML;
}
break;

case 3: // Handles player after it starts to play
PreviousState = NewState;
forms['form'].PlayPauseButton.innerHTML = "Pause";
shuffle = document.forms['form'].ShuffleSwitch.status;
break;

case 2: // Handles player after being paused
PreviousState = NewState;
forms['form'].PlayPauseButton.innerHTML = PlayHTML.innerHTML;
break;

default:
}

</SCRIPT>
<!-- end code provided by createblog.com -->
 

Posts in this topic


Closed TopicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members: