gszauer
01-07-2007, 04:43 PM
Hi all, i am trying to controll the volume of an embeded windows media player VIA javascript, and found this code
function VolumeUp() {
if (document.MediaPlayer.Volume+1000<0) {
document.MediaPlayer.Volume=document.MediaPlayer.Volume+1000;
}
}
function VolumeDown() {
document.MediaPlayer.Volume=document.MediaPlayer.Volume-1000;
}
Now this works for incrementing and decreasing the volume, but i dont get where 1000 comes from or why "if volume is less than 0" for incrementing...
It makes no real sence.
I thought volume was on a scale of 1 to 100....
Can anyone please explain to me?
Oe provide a code that lets me set volume from 1 to 100?
Eather would be wery appriciated.
Thanks for your time
~Gabor
function VolumeUp() {
if (document.MediaPlayer.Volume+1000<0) {
document.MediaPlayer.Volume=document.MediaPlayer.Volume+1000;
}
}
function VolumeDown() {
document.MediaPlayer.Volume=document.MediaPlayer.Volume-1000;
}
Now this works for incrementing and decreasing the volume, but i dont get where 1000 comes from or why "if volume is less than 0" for incrementing...
It makes no real sence.
I thought volume was on a scale of 1 to 100....
Can anyone please explain to me?
Oe provide a code that lets me set volume from 1 to 100?
Eather would be wery appriciated.
Thanks for your time
~Gabor