TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

Members
  • Total Members: 3,963
  • Latest: BiZaJe
Stats
  • Total Posts: 195,917
  • Total Topics: 21,308
  • Online today: 629
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 509
  • Total: 509

JukeBox

Started by borgBOB, September 24, 2005, 07:24:53 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

WizardHawk

Anyone know enough java to either randomize the above array or put it in alpabetic order?

I'm pretty sure the work would be done in, or before the third from last section (/// the tracks files names)

This loads the $trck() array with the names of the files to play.

I don't know how logic works in java but in other languages you would need a declaired temp array ($temp()) and create a for(#of files) loop that creates a random whole number between 1 and # of files and checks the $temp() array at that number to see if a file name already exists. If name already exists, pick a new number, if not, store the file name at the current step in (for) at the current random number. Once complete a simple for loop that moves the contents of $temp() back over to the $trck() before it is sent out to the player is all that is needed.

Alpha sorts aren't much harder either.

The ideal would be a php file with a variable we can set at the front to tell the code to leave it as is, alphabetize the list, or random sort.

This simple code addition would double the value of this addon.

WizardHawk

OK, no one had the time (or was willing) to help me figure out how to randomize or order the play lists so I spent some time reading up on PHP and found what I needed. Turns out to do either is only one added command.

To randomize you need to add:
shuffle($list);

To sort by name you need to add:
sort($list);

Add either one to this section:
/// the tracks files names
for($i=0;$i<$countFile;$i++) {
$trck[$i] = "$list[$i]";
Parse ("trck$i" , $trck[$i] ) ;

}


Add either one of them before the for() statement. So to randomize the music list, just make it look like this:
/// the tracks files names
shuffle($list);
for($i=0;$i<$countFile;$i++) {
$trck[$i] = "$list[$i]";
Parse ("trck$i" , $trck[$i] ) ;

}

Now each time the player is opened the music will be shuffled into a different order and play more like a random radio station.

Now, if anyone can tell me how to create a popup to ask the user if they want a sorted, raw, or random play list I've have the ultimate upgrade of this player.

houston

My music files are not showing up in the players song list. I beleive that I have uploaded the music files to the right folder.

This is the path to the player

'hxxp://www.xxxxx.com/forum/osPlayer/files/osplayer.html\

And this is the path to music files.

'hxxp://www.xxxxx.com/forum/osPlayer/

Any comments

Thanks

borgBOB

Quote from: houston on November 07, 2005, 02:56:22 AM
My music files are not showing up in the players song list. I beleive that I have uploaded the music files to the right folder.

This is the path to the player

'hxxp://www.xxxxx.com/forum/osPlayer/files/osplayer.html\

And this is the path to music files.

'hxxp://www.xxxxx.com/forum/osPlayer/

Any comments

Thanks

osplayer.html need to be in the same folder as your music files, not in a sub-folder.
Make sure the osplayer.html, osplayer_parser.php, and os_player.swf are in the
osPlayer folder, along with all of your music files.

What I meant in the first post was to take the contents of the "files" folder from the osplayer.zip and load them to your server in the 'osPlayer' folder.

Hope that clears things up.

houston

borgBOB

I have placed the music files in the same directory as the osplayer.html, osplayer_parser.php, and os_player.swf files It is finding something thier in the list but it does not identify it. I know that something is thier because a bar changes color and I get a message that's scrolling across saying undefined. The sound bars start moving up and down as well. I only have one mp3 file uploaded right know.

Franky500

hey guys. Normally i dont have a problem fixing things myself but on this i have followed the instructions in post 1 and still have not got that button to appear.. any ideas?

borgBOB

Quote from: Franky500 on November 07, 2005, 06:00:26 PM
hey guys. Normally i dont have a problem fixing things myself but on this i have followed the instructions in post 1 and still have not got that button to appear.. any ideas?
Did you modify each theme you are using? And did you do a page refresh(F5) to clear any cached images?

borgBOB

Quote from: houston on November 07, 2005, 04:58:50 AM
borgBOB

I have placed the music files in the same directory as the osplayer.html, osplayer_parser.php, and os_player.swf files It is finding something thier in the list but it does not identify it. I know that something is thier because a bar changes color and I get a message that's scrolling across saying undefined. The sound bars start moving up and down as well. I only have one mp3 file uploaded right know.

I can only suggest you ask the Mod author for assistance, I have done all I can.

Xarcell

Is there a Demo that I can take a look at?


This website is proudly hosted on Crocweb Cloud Website Hosting.