![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Well i got a embed list to embe wmp in my site one thing i want it to shuffle the playlist like everytime when someon comes on my site my mediaplayer must randomize the playlist. its about 200 songs so its gonna be boring if someon hear the same numbers everytime they wanna listen music someon know the command or Param of it?? |
#3
| |||
| |||
|
|
Dj Psycho wrote: Well i got a embed list to embe wmp in my site one thing i want it to shuffle the playlist like everytime when someon comes on my site my mediaplayer must randomize the playlist. its about 200 songs so its gonna be boring if someon hear the same numbers everytime they wanna listen music someon know the command or Param of it?? You would have to use javascript to generate the wmp embed code, so that each time the page loads, a new target song is written within the embed code. The basic method would be to create a javascript array with all the songs, then a javacsript function that randomly picks one, then a javsacript function that generates the embed code with the choosen song. Don't know javascript enough to give you a code example, but you can Google that, or else, wait for some javascript guru to answer. |
#4
| |||
| |||
|
#5
| |||
| |||
|
|
well i dont know what you mean with the java script.. and PHP pff i dont know how it works.. i already searched for java scripts and bulshit diddent find a shuffle playlit param with it.. |
#6
| |||
| |||
|
#7
| |||
| |||
|
|
jes my host provides PHP and i will be pleased if you could help me :-) |
#8
| |||
| |||
|
|
Dj Psycho wrote: jes my host provides PHP and i will be pleased if you could help me :-) ok, so I'll try to give you a step by step instruction: first, put all your audio files in one folder, within your main site folder, and call that folder "audio". Second, change the extension of the page in which you will have the songs playing, from htm to php. I will assume this page is also in the main site folder. If it's called 'index.html', change it to 'index.php'. Third, in code view, paste the following code, above all the rest of the code (above the doctype). Code to paste start with "<?php" and ends with "?>". ?php // GENERATE ARRAY WITH ALL AUDIO FILES if ($handle = opendir('audio')){ while (false !== ($file = readdir($handle))){ if (is_file($path.'/'.$file) && $file !== '.' && $file !== '..' && $file !== '.DS_Store'){ $files[] = $file; } } } // COUNT THE FILES $songsNum = count($files); // GENERATE RANDOM NUMBER FROM 0 TO THE NUMBER OF FILES $rand = rand(0,$songsNum-1); ? Third, find in your code the part that concerns the embedding of window media player. It should look something like this: object id="MediaPlayer" width="500" height="400" classid="CLSID:22D6f312-B0F6-11D0-94AB-0080C74C7E95" standby="Loading Windows Media Player components..." type="application/x-oleobject" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,7,1112" param name="filename" value="folder/song1.mp3" param name="stretchtofit" value="true" param name="Showcontrols" value="True" param name="autoStart" value="True" embed type="application/x-mplayer2" src="folder/song1.mp3" name="MediaPlayer"></embed /object In any case, in this code, there are two occurences of the link to your audio file. In the above example, these two occurences are: param name="filename" value="folder/song1.mp3" and: embed type="application/x-mplayer2" src="folder/song1.mp3" name="MediaPlayer" In both occurences, replace "folder/song1.mp3" with: <?php echo 'audio/'.$files[$rand]; ? so that the lines will be changed to: param name="filename" value="<?php echo 'audio/'.$files[$rand]; ?>" and: embed type="application/x-mplayer2" src="<?php echo 'audio/'.$files[$rand]; ?>" name="MediaPlayer" That's all. The PHP code will look into your audio folder, and select one audio file at random each time you reload the page. Note that if you preview the page locally, it won't work. It will only work ONLINE, once you upload the page and the folder containing all the audio files. Let me know if that's clear and if it works. |
#9
| |||
| |||
|
#10
| |||
| |||
|
nope not working at all is there a other why beside php ??a target=_blank class=ftalternatingbarlinklarge href="http://radiots.atspace.us/index.php">Link to php adress</a |
![]() |
| Thread Tools | |
| Display Modes | |
| |