| | |
Javascript MP3 Player
Please support our JavaScript / DHTML / AJAX advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
Most likely you've seen a flash MP3 player or two while searching the web but I have a favorite. This is the JW MP3 Player, mainly because it has external JavaScript functions that can be used to access data about the player dynamically. I've written a few things for it that don't come "standard." While searching around I found a CSS progress bar and found it pretty pointless since it's static, then I put 2 and 2 together. This is a little script that can be used with the external functions of the MP3 player to show the loading buffer.
The JavaScript for the external functions are found at http://www.jeroenwijering.com/extras/javascript.html
After adding the the variables to allow external javascript functions in the player (explained in the readme).
In your stylesheet add the following
The colors can be changed any way you like which is the reason why I chose to go with the JavaScript external functions rather than the flash player.
Wherever you want your progress bar to display put
Note: The script could be easily modified to allow the progress bar to be the play time though it would require some extra math to change the seconds to a % of the running time.
Here it is in action at the bottom of the page. The entire player is using the JavaScript functions, a table, some css and the silk iconset
The JavaScript for the external functions are found at http://www.jeroenwijering.com/extras/javascript.html
After adding the the variables to allow external javascript functions in the player (explained in the readme).
- Add a currentLoad variable to the script.
- Inside of the getUpdate function add javascript Syntax (Toggle Plain Text)
- var id2 = document.getElementById(typ);
- Below else if(typ == "item") add the following javascript Syntax (Toggle Plain Text)
- else if(typ == "load"){currentLoad = pr1;}
- After that line go below the if(typ == "time") add this line javascript Syntax (Toggle Plain Text)
- else if(typ == "load"){id2.style.width = (currentLoad-1)+"%" ;}
In your stylesheet add the following
css Syntax (Toggle Plain Text)
#prog-border { height: 13px; width: 205px; background: #e6d3a9; margin: 0; } #load { height: 10px; margin: 1px; padding-right: 1px; background: #006600; width: 0%; }
The colors can be changed any way you like which is the reason why I chose to go with the JavaScript external functions rather than the flash player.
Wherever you want your progress bar to display put
html Syntax (Toggle Plain Text)
<div id="prog-border"> <div id="load"></div> </div>
Note: The script could be easily modified to allow the progress bar to be the play time though it would require some extra math to change the seconds to a % of the running time.
Here it is in action at the bottom of the page. The entire player is using the JavaScript functions, a table, some css and the silk iconset
Last edited by ShawnCplus; Jul 10th, 2007 at 3:58 pm.
GCS d- s+ a-->? C++(++++) UL+++ P+>+++ L+++ E--- W+++
N+ o K w++(---) O? !M- V PS+>++ PE+ Y+ PGP !t- 5? X- R tv+
b+>++ DI+ D G++>+++ e+ h+>++ r y+
PMs asking for help will not be answered, post on the forums. That's what they're there for.
N+ o K w++(---) O? !M- V PS+>++ PE+ Y+ PGP !t- 5? X- R tv+
b+>++ DI+ D G++>+++ e+ h+>++ r y+
PMs asking for help will not be answered, post on the forums. That's what they're there for.
•
•
Join Date: Jul 2007
Posts: 8
Reputation:
Solved Threads: 2
it is possible to do almost the same things using embedded windows media player 9 and above
voynex.com - high quality software and web development.
![]() |
Similar Threads
- .cab files? drivers? ('MOSMP028'- ministry of sound mp3 player) (Windows 95 / 98 / Me)
- MP3 Player (C)
Other Threads in the JavaScript / DHTML / AJAX Forum
- Previous Thread: urgent- i have dead line
- Next Thread: Open.window popup
| Thread Tools | Search this Thread |
acid2 ajax ajaxexample ajaxjspservlets array beta box browser captchaformproblem cart child close codes column css date debugger decimal dependent design disablefirebug dom download element embed engine enter error events ext file firefox focus form forms frameworks getselection google gwt gxt hiddenvalue highlightedword hint html ie7 ie8 iframe index java javascript javascripthelp2020 jquery jsp jump libcurl listbox maps masterpage math media menu microsoft mimic mp4 onerror onmouseoutdivproblem onmouseover onreadystatechange paypal pdf php position post problem programming prototype rated rating redirect safari scale scriptlets scroll search security select software star starrating synchronous toggle unicode variables w3c web webservice window windowofwords xml \n






