Log In · Register

 
 
Closed TopicStart new topic
playlist trouble!!!!!, helppppp!!!!!
stick_to_your_gu...
post Jun 14 2006, 09:22 AM
Post #1


Member
**

Group: Member
Posts: 19
Joined: Apr 2005
Member No: 132,646



stubborn.gif alright so i have a dropdown playlist problem and i need some help so if you could please help me out _smile.gif
CODE
<!-- start code provided by createblog.com -->
<OBJECT ID="Player" height="0" width="0" CLASSID="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6">
<PARAM NAME="uiMode" VALUE="invisible">
<PARAM NAME="Autostart" VALUE="False">
</object>

<FORM ID="form">

<SELECT ID="playlist" size="1">

<!-- Add song info that appears in drop down list here -->
<option value="0">GnR - Welcome to the jungle</option>
<option value="1">GnR - Night Train</option>
<option value="2">GnR - Out ta get me</option>
<option value="3">GnR - Rocket Queen</option>
<option value="4">GnR - You Could be mine</option>
<option value="5">Bon Jovi - bad medicine</option>
<option value="6">Bon Jovi - Livin on a prayer</option>
<option value="7">Bon Jovi - you give love a bad name</option>
<option value="8">Def leppard - foolin</option>
<option value="9">Def Leppard - Love bites</option>
<option value="10">Def Leppard - Photograph</option>
<option value="11">Def Leppard - rock of ages</option>
<option value="12">led zepplin - kashmir</option>
<option value="13">led zepplin - black dog</option>
<option value="14">led zepplin - stairway to heaven</option>
</SELECT>

<BR>
<BUTTON ID="BackButton" onClick="Back(forms['form'].playlist);"> << </BUTTON>
<BUTTON ID="PlayPauseButton" onClick="PlayPause(forms['form'].playlist);"><FONT color="green">  Play  </FONT></BUTTON>
<BUTTON ID="NextButton" onClick="Next(forms['form'].playlist);"> >> </BUTTON>
<BUTTON ID="StopButton" onclick="Stop();"><FONT color="maroon">Stop</FONT></BUTTON>
<b><font size="3" color="black">Shuffle</font></b><INPUT TYPE=checkbox CHECKED ID="ShuffleSwitch" onclick="ToggleShuffle(this);" value="ON">

</FORM>
</CENTER>


<comment ID="PlayHTML"><FONT color="green">  Play  </FONT></comment>
<comment ID="ShuffleOnHTML"><INPUT TYPE=checkbox CHECKED ID="ShuffleSwitch" onclick="ToggleShuffle(this);"></comment>
<comment ID="ShuffleOffHTML"><INPUT TYPE=checkbox UNCHECKED ID="ShuffleSwitch" onclick="ToggleShuffle(this);"></comment>


<script ID="Main" Language="JavaScript">

    var songs = new Array();

    //*******************************//
    //****** CHANGEABLE STUFF *******//
    //*******************************//
    
    var shuffle = false;  // false = shuffle off, true = shuffle on

    var autoStart = true;   // false = autoStart off, true = autoStart on
    
    var numberTracks = true;  // true = place track number in front of list items, false = no track numbers
    
    // Add song URLs here (make sure it matches up with the order you have for song info, and urls need quotes):
    songs[0]="http://a425.v8384d.c8384.g.vm.akamaistream.net/7/426/8384/3b858b51/mtvrdstr.download.akamai.com/8512/wmp/1/749/3751_1_1_05.asf";
    songs[1]="http://a425.v8384d.c8384.g.vm.akamaistream.net/7/426/8384/3b858b51/mtvrdstr.download.akamai.com/8512/wmp/1/749/3751_1_3_05.asf";
    songs[2]="http://a425.v8384d.c8384.g.vm.akamaistream.net/7/426/8384/3b858b51/mtvrdstr.download.akamai.com/8512/wmp/1/749/3751_1_4_05.asf";
    songs[3]="http://a425.v8384d.c8384.g.vm.akamaistream.net/7/426/8384/3b858b51/mtvrdstr.download.akamai.com/8512/wmp/1/749/3751_1_12_05.asf";
    songs[4]="http://a425.v8384d.c8384.g.vm.akamaistream.net/7/426/8384/3b858b51/mtvrdstr.download.akamai.com/8512/wmp/2/749/920_1_12_05.asf";
    songs[5]="http://ditty.biz/88000060.mp3";
    songs[6]="http://siwei.nowseo.com/mp3/Livin_On_A_Prayer.mp3";
    songs[7]="http://ditty.biz/86000012.mp3";
    songs[8]="http://ditty.biz/83000112.mp3";
    songs[9]="http://audi.mine.nu/aaa/multimedia/sounds/sounds/Love%20Bites.mp3";
        songs[10]="http://www.leftdeffer.com/Slang_Tour/DefLeppard-SlangTour-Track17.mp3";
    songs[11]="http://ditty.biz/83000111.mp3";
    songs[12]="http://www.ericas-designs.com/songs/kashmir.mp3";
    songs[13]="http://92stmoritzdevils.tripod.com/sitebuildercontent/sitebuilderfiles/ledzeppelinblackdog.mp3";
    songs[14]="http://cherryfrost.com/music/stairway.mp3";
    
    //*******************************//
    //*******************************//

// Initializations //
with (document){
    var length = forms['form'].playlist.length;

    if(numberTracks){
  for (var i = 0; i < length; i++){
      forms['form'].playlist.options[i].innerHTML = (i+1) + " - " + forms['form'].playlist.options[i].innerHTML;
  }
    }
    
    if (shuffle) {
  var randsg = Math.floor(Math.random()*songs.length);
  Player.url = songs[randsg];
  forms['form'].playlist.options[randsg].selected = true;
  forms['form'].ShuffleSwitch.outerHTML = ShuffleOnHTML.innerHTML;
    }

    else {
  forms['form'].ShuffleSwitch.outerHTML = ShuffleOffHTML.innerHTML;
  Player.url = songs[0];
    }

    if(autoStart){
  var snum = forms['form'].playlist.selectedIndex;
  if(Player.url != songs[snum]){
      Player.url = songs[snum];
  }
  Player.controls.Play();
    }
}

// Functions //
// Discription: "PlayPause" will toggle playing and pausing if the same song is still selected,
//              otherwise it will load the newly selected song
function PlayPause(list) {
    var snum = list.selectedIndex;
    
    if((Player.url == songs[snum] && Player.url != "") && Player.playState != 1){
  if(Player.playState == 3){
      Player.controls.Pause();
  }
  
  else {
      Player.controls.Play();
  }
    }

    else {
  Player.url = songs[snum];
  Player.controls.Play();
    }
}

// Discription: "Next" will move to the next music file if shuffle is off
//              otherwise it will load a random song. Calls PlayPause to start music.
function Next(list) {
    var snum = list.selectedIndex;
    if (!shuffle) {
  if (snum == list.length-1) {
      snum = -1;
  }
  snum++;
    }
    
    else {
  var temp;
  do{
      temp = Math.floor(Math.random()*songs.length);
  } while(temp == snum);
  snum = temp;
    }
    
    list.options[snum].selected = true;
    PlayPause(list);
}

// Discription: "Back" does the same thing as "Next" but moves backwads
//              through the list. If shuffle is on then picks a random song.
function Back(list) {
    var snum = list.selectedIndex;
    if (!shuffle) {
  if (snum == 0){
      snum = list.length;
  }
  snum--;
    }
    
    else {
  var temp;
  do{
      temp = Math.floor(Math.random()*songs.length);
  } while(temp == snum);
  snum = temp;
    }
    
    list.options[snum].selected = true;
    PlayPause(list);
}

// Discription: Self explanitory.
function Stop(){
    Player.controls.Stop();
}

// Discription: Makes the shuffle flag the same as the status of the CheckBox
//    The status of the checkbox (true/false) indicates if the box is checked
function ToggleShuffle(CheckBox) {
    shuffle = CheckBox.status;
}

</SCRIPT>

<script ID="StateChangeHandler" Language = "JavaScript" For = "Player" Event = playStateChange(NewState)>

// 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 -->
 
talcumpowder
post Jun 14 2006, 06:34 PM
Post #2


You'll find me in your dreams.
*******

Group: Official Member
Posts: 8,536
Joined: Mar 2005
Member No: 114,010



What specifically is wrong? If it's justnot playing, check your links.
 
n00b
post Jun 15 2006, 02:11 AM
Post #3


Hello My Name Is INSERT HERE
******

Group: Member
Posts: 1,372
Joined: Apr 2006
Member No: 394,903



yeah.
what's not working with it?
I hate it when people aren't specific _dry.gif
 
Melissawilson5
post Jun 15 2006, 02:48 AM
Post #4


..♥.A Girl With Talents.♥..
****

Group: Member
Posts: 172
Joined: Jun 2006
Member No: 422,238



Why Show your whole Code why not just show were the problem is???
 
gelionie
post Jun 15 2006, 05:04 AM
Post #5


say maydayism.
*******

Group: Staff Alumni
Posts: 7,447
Joined: Jun 2004
Member No: 26,344



^ if the person knew what his/her problem is, he/she doesn't need to post here.

Please do not post if you are unable to help. We don't need so many people to repeat the same thing.

akamaistream.net no longer hosts songs.
So you may need to search for new links for those songs.
 
stick_to_your_gu...
post Jun 16 2006, 12:27 PM
Post #6


Member
**

Group: Member
Posts: 19
Joined: Apr 2005
Member No: 132,646



QUOTE(niez_cho @ Jun 15 2006, 6:04 AM) *
^ if the person knew what his/her problem is, he/she doesn't need to post here.

Please do not post if you are unable to help. We don't need so many people to repeat the same thing.

akamaistream.net no longer hosts songs.
So you may need to search for new links for those songs.


good piont and thanks for that valuable peice of info ill look for different links

thanks again
 
gelionie
post Jun 17 2006, 01:35 AM
Post #7


say maydayism.
*******

Group: Staff Alumni
Posts: 7,447
Joined: Jun 2004
Member No: 26,344



You're welcome. :)
You can look in the BBoR for song sites.
If you have any other questions on this, feel free to PM me.

[ TOPIC CLOSED ]
 

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