Gönderen Konu: Web sayfaniza devamli müzik  (Okunma sayısı 1788 defa)

0 Üye ve 1 Ziyaretçi konuyu incelemekte.

Çevrimdışı Babacool

  • İleti: 8
  • Puan: 1
Web sayfaniza devamli müzik
« : Nisan 03, 2007, 07:05:33 ÖÖ »
Asagidaki script'i web sayfanizin body kismina yerlestiriniz ve sonra kendi sarki adres ve isimlerini buradakiler ile degistiriniz.

*************************************
Kod:
<p><center><start>
<OBJECT>
<PARAM>
<PARAM>
</object>
<FORM>
<SELECT>

<Add>
<option>Unchained Melody</option>
<option>Brown eyes blue</option>
<option>Longer</option>
<option>Only You</option>
<option>Leaving on a jet plain</option>
<option>I will always love you</option>
<option>I just called to say..</option>
<option>Love me tender</option>
<option>My heart will go on</option>
<option>Lookin' for love</option>

</SELECT>
<BR>
<BUTTON> << </BUTTON>
<BUTTON><FONT color="green">Play</FONT></BUTTON>
<BUTTON> >> </BUTTON>
<BUTTON><FONT color="maroon">Stop</FONT></BUTTON>
<font size="3" color="black">Shuffle</font><INPUT>
</FORM>
<comment><FONT color="green">  Play  </FONT></comment>
<comment><INPUT></comment>
<comment><INPUT></comment>


<script>

   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://www.angelfire.com/ok2/WildDancer/images/unchained2.wav";
   songs[1]="http://jacsplace.topcities.com/dontitmakemybrowneyesblue.wav";
   songs[2]="http://www.angelfire.com/on3/oceanangel/DanFogelbergLonger.wav";
   songs[3]="http://www.celebritydirect.org/notweb/music/pl-onlyyou.mp3";
   songs[4]="http://www.angelfire.com/on2/MoniqueM/images/LeavingOnAJetPlane.wav";
   songs[5]="http://www.angelfire.com/hi4/MoniqueM/images/alwaysloveyou.wav";
   songs[6]="http://www.geocities.com/poppage11/StevieWonderIJustCalledToSayILovedYou.wav";
   songs[7]="http://www.angelfire.com/oh2/MoniqueM/images/lovemetender.wav";
   songs[8]="http://www.angelfire.com/on3/MoniqueM/images/MyHeartWillGoOn.wav";
   songs[9]="http://www.davidruffo.com/snippets/johnny lee - looking for love in all the wrong places.mp3";

   
   //*******************************//
   //*******************************//

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

   if(numberTracks){
  for (var i = 0; i < length; i++){
     forms['form'].playlist.options.innerHTML = (i+1) + " - " + forms['form'].playlist.options.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>

// 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>
        &nbsp;
</center>


*******************************************

NOT : center 'i

<left> veya <right> ile degistirebilirsiniz. Ama formülün sonunda da </left> veya </right>yazmaniz gerekiyor.

Kolay gelsin.  :)   Eger script'in nasil calistini görmek istiyorsaniz > IZMIR  ' e hoparlörleriniz acik olarak bakabilirsiniz.
« Son Düzenleme: Nisan 03, 2007, 11:31:15 ÖÖ Gönderen: Dinç »
Konuyu Paylaş:
  delicious  facebook  twitter  google

Çevrimdışı Dinç

  • Süper Moderatör
  • *
  • İleti: 361
  • Puan: 87
  • Cinsiyet: Bay
  • Eskiden sadakate inanırdım. Şimdi ASİ olmuşum.
-Web sayfaniza devamli müzik
« Yanıtla #1 : Nisan 03, 2007, 11:31:58 ÖÖ »
Yukarıdaki mesajda gülümse kullanımını iptal ettim çünkü script içindeki bazı kodlar gülümseme olarak çıkıyordu.

 

Benzer Konular

  Konu / Başlatan Yanıt Son İleti
2 Yanıt
4556 Gösterim
Son İleti Ocak 14, 2011, 06:28:35 ÖÖ
Gönderen: g3z3g3n
1 Yanıt
1913 Gösterim
Son İleti Nisan 15, 2007, 23:29:34 ÖS
Gönderen: SoN_DaRBe
5 Yanıt
2710 Gösterim
Son İleti Eylül 29, 2009, 18:46:11 ÖS
Gönderen: seyit822
16 Yanıt
4860 Gösterim
Son İleti Eylül 27, 2009, 20:17:07 ÖS
Gönderen: gencler
1 Yanıt
1458 Gösterim
Son İleti Nisan 25, 2010, 20:37:20 ÖS
Gönderen: burajan