2 Replies Latest reply on Jun 10, 2008 9:58 AM by DFord425

    control volume in VideoDisplay

    DFord425 Level 1
      Is there a way to control the volume of a <mx:VideoDisplay> in the way of built in functions or any way to write it myself. I could not see anything that would let allow the user to control the volume with any type of user input, other than adjusting the volume of the OS or speakers. By the way, im using AIR. Thanks in advance.
        • 1. control volume in VideoDisplay
          EvolvedDSM Level 2
          There's really no difference between AIR and Flex web-based as far as VideoDisplay is concerned I believe. I've done video apps in both.

          You need to use the volume property of VideoDisplay, "volume". It's really that simple.

          name your video display, we'll call it myVideoDisplay.

          to statically set the volume, you can just do
          myVideoDisplay.volume = "a number between 0 and 1"

          The volume control only deals with numbers between 0 and 1, so you could do 0.5, 0.85, etc.

          To adjust the volume dynamically, you could use a slider.
          <mx:HSlider id="myVolumeSlider" change="changeVolume()" snapInterval="0.10" value="1" minimum="0" maximum="1"/>
          Then create a method
          private function changeVolume():void{
          myVideoDisplay.volume = myVolumeSlider.value;

          The snapInterval tells the slider to mark it's increments, so when you slide this one, it will increase by 0.10 up to 1. The slider's value is the current volume level. You will need to set your myVideoDisplay.volume=myVolumeSlider.value somewhere in your creationComplete property.
          • 2. Re: control volume in VideoDisplay
            DFord425 Level 1
            Thank You