How to manage system volume using javascript

I use a media player to play audio and video. I create my own button to increase and decrease the volume of the media player. works fine too.

Problem:

Even after the volume reaches 0%, it is audible. If the volume of the player increases, the volume of the system also increases. Is it possible. How to achieve this task.

Control:

<object id="mediaPlayer" classid="clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95"
    codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701"
    height="1" standby="Loading Microsoft Windows Media Player components..."
    type="application/x-oleobject" width="1">
    <param name="fileName" value="" />
    <param name="animationatStart" value="true" />
    <param name="transparentatStart" value="true" />
    <param name="autoStart" value="true" />
    <param name="showControls" value="true" />
    <param name="volume" value="70"  />
</object>

the code:

function decAudio() {
    if (document.mediaPlayer.Volume >= -1000) {
        var newVolume = document.mediaPlayer.Volume - 100;
        if (newVolume >= -1000) {
            document.mediaPlayer.Volume = document.mediaPlayer.Volume - 100;
        } else {
            document.mediaPlayer.Volume = -1000;
        }
    } 
}
+5
source share
2 answers

if sound is still audible as soon as document.mediaPlayer.Volumeset to 0, why don't you set document.mediaPlayer.Settings.mute = true?

, document.mediaPlayer.Settings.Volume document.mediaPlayer.Volume? , / , javascript ( jscript) mediaplayer.

" " , Windows Media Player 7 :

obj = document.getElementById("mediaPlayer");

  • Code
    • Parameters
    • Description
  • obj.Settings.autoStart
    • true
    • , , .
  • obj.Settings.baseURL
    • -
    • URL-, URL script, .
  • ClosedCaption.captioningID
    • 0
    • , .
  • obj.Controls.currentMarker
    • 0
    • .
  • obj.Controls.currentPosition
    • 0
    • .
  • obj.Settings.defaultFrame
    • -
    • , URL-.
  • obj.enableContextMenu
    • true
    • , , , .
  • obj.enabled
    • false
    • , Windows Media.
  • obj.fullScreen
    • false
    • , .
  • obj.Settings.invokeURLs
    • true
    • , , URL- -.
  • obj.Settings.mute
    • false
    • , .
  • obj.Settings.PlayCount
    • 1
    • , . .
  • obj.Settings.rate
    • 1.0
    • . 0,5 , 2 .
  • obj.stretchToFit
    • false
    • , , , , .
  • obj.uiMode
    • full
    • , . : , , , .
  • obj.URL
    • -
    • . URL-.
  • obj.Settings.volume
    • Zero , 100 .
  • obj.Settings.balance
    • false
    • . 0 egual, -100 , 100 - .
  • obj.windowlessVideo
    • false
    • , , Windows Media . windowlessVideo true, Player , . Windows Media Windows XP .
+5

[: ]

, MediaPlayer, ? this

0 100? .

javascript-, ?

0

All Articles