[Javascript/HTML] Random Music Player
Hi. I'd like to know how to program a random music player that would work on any standard web browser. Here is the code I have so far:
Code:
<html> 1) I need it to work similar to the standard HTML code above as far as how user-friendly it is and how it is displayed. 2) I need either a random or sequential number within a range to be selected every time an external button (placed under the display, saying "Click here to change the song!") is clicked. 3) I need an "if" clause that aligns that range of numbers with URLs to different songs (which I will provide later), and then assigns them to the "FileName" value in the code above. 4) I also need the range of numbers to be assigned to the names of the songs, which will display in a label above the display. 5) If at all possible, it would also be cool if there can be a checkbox stuck next to the display that says "Autoplay?", and when checked, it would assign "AutoStart" value to "1", and when unchecked, it would assign that same value to "0". Can anyone help me out with this? I've been wondering how to do this for quite some time. I've accomplished it in Visual Basic, but I have absolutely no experience with Javascript, and I haven't done any Visual Basic work at all for over 2 years. |
I'd really appreciate it if someone could point me in the right direction here.
|
Anyone? Please?
|
I have very little experience with javascript, and what little I did was quite a while ago, so there is certainly a more elegant way to do this, but here I go:
Code:
<HTML> The "change track" link actually refreshes the page, causing a different random number to be picked. This might not be a very satisfactory way of doing it, but its a start at least. Unfortunately, this method does not lend itself to easily implementing your "Autoplay" check box. |
All times are GMT -8. The time now is 05:13 AM. |
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Search Engine Optimization by vBSEO 3.6.0 PL2
© 2002-2012 Tilted Forum Project